Skip to content
Snippets Groups Projects
Commit 1124f51a authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Some consitifications

parent 1ab49b16
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2695 passed
...@@ -424,11 +424,11 @@ typedef struct { ...@@ -424,11 +424,11 @@ typedef struct {
/* str is the title for the application banner. */ /* str is the title for the application banner. */
/* Returns 0 on success, non-zero on failure. */ /* Returns 0 on success, non-zero on failure. */
/****************************************************************************/ /****************************************************************************/
int (*scrn) (char* str); int (*scrn) (const char* str);
/****************************************************************************/ /****************************************************************************/
/* Popup a message, maybe wait for the user to hit a key or click button. */ /* Popup a message, maybe wait for the user to hit a key or click button. */
/****************************************************************************/ /****************************************************************************/
int (*msg) (char* str); int (*msg) (const char* str);
int (*msgf) (char* fmt, ...); int (*msgf) (char* fmt, ...);
BOOL (*deny) (char* fmt, ...); BOOL (*deny) (char* fmt, ...);
BOOL (*confirm) (char* fmt, ...); BOOL (*confirm) (char* fmt, ...);
...@@ -437,7 +437,7 @@ typedef struct { ...@@ -437,7 +437,7 @@ typedef struct {
/* str is the message to display on popup. */ /* str is the message to display on popup. */
/* if str==NULL, then the the status is to be cleared (popdown). */ /* if str==NULL, then the the status is to be cleared (popdown). */
/****************************************************************************/ /****************************************************************************/
void (*pop) (char* str); void (*pop) (const char* str);
/****************************************************************************/ /****************************************************************************/
/* General menu function. */ /* General menu function. */
/* mode contains WIN_* flags to control display and functionality. */ /* mode contains WIN_* flags to control display and functionality. */
...@@ -453,7 +453,7 @@ typedef struct { ...@@ -453,7 +453,7 @@ typedef struct {
/* option number OR'd with MSK_INS, MSK_DEL, MSK_GET, MSK_PUT, or MSK_EDIT. */ /* option number OR'd with MSK_INS, MSK_DEL, MSK_GET, MSK_PUT, or MSK_EDIT. */
/****************************************************************************/ /****************************************************************************/
int (*list) (int mode, int left, int top, int width, int* dflt int (*list) (int mode, int left, int top, int width, int* dflt
,int* bar, char *title, char** option); ,int* bar, const char *title, char** option);
/****************************************************************************/ /****************************************************************************/
/* Windowed string input routine. */ /* Windowed string input routine. */
/* mode contains WIN_* flags to control display and functionality. */ /* mode contains WIN_* flags to control display and functionality. */
...@@ -465,7 +465,7 @@ typedef struct { ...@@ -465,7 +465,7 @@ typedef struct {
/* This function sets uifcapi_t.changes to TRUE if the string is modified. */ /* This function sets uifcapi_t.changes to TRUE if the string is modified. */
/* Returns the length of the string or -1 on escape/abort. */ /* Returns the length of the string or -1 on escape/abort. */
/****************************************************************************/ /****************************************************************************/
int (*input)(int mode, int left, int top, char* prompt, char* str int (*input)(int mode, int left, int top, const char* prompt, char* str
,int len, int kmode); ,int len, int kmode);
/****************************************************************************/ /****************************************************************************/
/* Sets the current help index by source code file and line number. */ /* Sets the current help index by source code file and line number. */
......
...@@ -76,16 +76,16 @@ static void timedisplay(BOOL force); ...@@ -76,16 +76,16 @@ static void timedisplay(BOOL force);
/* API routines */ /* API routines */
static void uifcbail(void); static void uifcbail(void);
static int uscrn(char *str); static int uscrn(const char *str);
static int ulist(int mode, int left, int top, int width, int *dflt, int *bar static int ulist(int mode, int left, int top, int width, int *dflt, int *bar
,char *title, char **option); ,const char *title, char **option);
static int uinput(int imode, int left, int top, char *prompt, char *str static int uinput(int imode, int left, int top, const char *prompt, char *str
,int len ,int kmode); ,int len ,int kmode);
static int umsg(char *str); static int umsg(const char *str);
static int umsgf(char *fmt, ...); static int umsgf(char *fmt, ...);
static BOOL confirm(char *fmt, ...); static BOOL confirm(char *fmt, ...);
static BOOL deny(char *fmt, ...); static BOOL deny(char *fmt, ...);
static void upop(char *str); static void upop(const char *str);
static void sethelp(int line, char* file); static void sethelp(int line, char* file);
static void showbuf(int mode, int left, int top, int width, int height, char *title static void showbuf(int mode, int left, int top, int width, int height, char *title
, char *hbuf, int *curp, int *barp); , char *hbuf, int *curp, int *barp);
...@@ -535,7 +535,7 @@ void uifcbail(void) ...@@ -535,7 +535,7 @@ void uifcbail(void)
/* Clear screen, fill with background attribute, display application title. */ /* Clear screen, fill with background attribute, display application title. */
/* Returns 0 on success. */ /* Returns 0 on success. */
/****************************************************************************/ /****************************************************************************/
int uscrn(char *str) int uscrn(const char *str)
{ {
textattr(api->bclr|(api->cclr<<4)); textattr(api->bclr|(api->cclr<<4));
gotoxy(1,1); gotoxy(1,1);
...@@ -620,7 +620,7 @@ inactive_win(struct vmem_cell *buf, int left, int top, int right, int bottom, in ...@@ -620,7 +620,7 @@ inactive_win(struct vmem_cell *buf, int left, int top, int right, int bottom, in
/* General menu function, see uifc.h for details. */ /* General menu function, see uifc.h for details. */
/****************************************************************************/ /****************************************************************************/
int ulist(int mode, int left, int top, int width, int *cur, int *bar int ulist(int mode, int left, int top, int width, int *cur, int *bar
, char *initial_title, char **option) , const char *initial_title, char **option)
{ {
struct vmem_cell *ptr, *win, shade[MAX_LINES*2], line[MAX_COLS]; struct vmem_cell *ptr, *win, shade[MAX_LINES*2], line[MAX_COLS];
static char search[MAX_OPLN] = ""; static char search[MAX_OPLN] = "";
...@@ -1836,7 +1836,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -1836,7 +1836,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
/*************************************************************************/ /*************************************************************************/
/* This function is a windowed input string input routine. */ /* This function is a windowed input string input routine. */
/*************************************************************************/ /*************************************************************************/
int uinput(int mode, int left, int top, char *inprompt, char *str, int uinput(int mode, int left, int top, const char *inprompt, char *str,
int max, int kmode) int max, int kmode)
{ {
struct vmem_cell shade[MAX_COLS], save_buf[MAX_COLS*4], in_win[MAX_COLS*3]; struct vmem_cell shade[MAX_COLS], save_buf[MAX_COLS*4], in_win[MAX_COLS*3];
...@@ -2000,7 +2000,7 @@ int uinput(int mode, int left, int top, char *inprompt, char *str, ...@@ -2000,7 +2000,7 @@ int uinput(int mode, int left, int top, char *inprompt, char *str,
/****************************************************************************/ /****************************************************************************/
/* Displays the message 'str' and waits for the user to select "OK" */ /* Displays the message 'str' and waits for the user to select "OK" */
/****************************************************************************/ /****************************************************************************/
int umsg(char *str) int umsg(const char *str)
{ {
int i=0; int i=0;
char *ok[2]={"OK",""}; char *ok[2]={"OK",""};
...@@ -2638,7 +2638,7 @@ char *utimestr(time_t *intime) ...@@ -2638,7 +2638,7 @@ char *utimestr(time_t *intime)
/****************************************************************************/ /****************************************************************************/
/* Status popup/down function, see uifc.h for details. */ /* Status popup/down function, see uifc.h for details. */
/****************************************************************************/ /****************************************************************************/
void upop(char *str) void upop(const char *str)
{ {
static struct vmem_cell sav[80*3], buf[80*3]; static struct vmem_cell sav[80*3], buf[80*3];
int i,j,k; int i,j,k;
......
...@@ -54,16 +54,16 @@ static void help(void); ...@@ -54,16 +54,16 @@ static void help(void);
/* API routines */ /* API routines */
static void uifcbail(void); static void uifcbail(void);
static int uscrn(char *str); static int uscrn(const char *str);
static int ulist(int mode, int left, int top, int width, int *dflt, int *bar static int ulist(int mode, int left, int top, int width, int *dflt, int *bar
,char *title, char **option); ,const char *title, char **option);
static int uinput(int imode, int left, int top, char *prompt, char *str static int uinput(int imode, int left, int top, const char *prompt, char *str
,int len ,int kmode); ,int len ,int kmode);
static int umsg(char *str); static int umsg(const char *str);
static int umsgf(char *str, ...); static int umsgf(char *str, ...);
static BOOL confirm(char *str, ...); static BOOL confirm(char *str, ...);
static BOOL deny(char *str, ...); static BOOL deny(char *str, ...);
static void upop(char *str); static void upop(const char *str);
static void sethelp(int line, char* file); static void sethelp(int line, char* file);
/****************************************************************************/ /****************************************************************************/
...@@ -134,7 +134,7 @@ void uifcbail(void) ...@@ -134,7 +134,7 @@ void uifcbail(void)
/* Clear screen, fill with background attribute, display application title. */ /* Clear screen, fill with background attribute, display application title. */
/* Returns 0 on success. */ /* Returns 0 on success. */
/****************************************************************************/ /****************************************************************************/
int uscrn(char *str) int uscrn(const char *str)
{ {
return(0); return(0);
} }
...@@ -193,7 +193,7 @@ static int which(char* prompt, int max) ...@@ -193,7 +193,7 @@ static int which(char* prompt, int max)
/* General menu function, see uifc.h for details. */ /* General menu function, see uifc.h for details. */
/****************************************************************************/ /****************************************************************************/
int ulist(int mode, int left, int top, int width, int *cur, int *bar int ulist(int mode, int left, int top, int width, int *cur, int *bar
, char *title, char **option) , const char *title, char **option)
{ {
char str[128]; char str[128];
int i,opts; int i,opts;
...@@ -336,7 +336,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -336,7 +336,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
/*************************************************************************/ /*************************************************************************/
/* This function is a windowed input string input routine. */ /* This function is a windowed input string input routine. */
/*************************************************************************/ /*************************************************************************/
int uinput(int mode, int left, int top, char *prompt, char *outstr, int uinput(int mode, int left, int top, const char *prompt, char *outstr,
int max, int kmode) int max, int kmode)
{ {
char str[256]; char str[256];
...@@ -361,7 +361,7 @@ int uinput(int mode, int left, int top, char *prompt, char *outstr, ...@@ -361,7 +361,7 @@ int uinput(int mode, int left, int top, char *prompt, char *outstr,
/****************************************************************************/ /****************************************************************************/
/* Displays the message 'str' and waits for the user to hit ENTER */ /* Displays the message 'str' and waits for the user to hit ENTER */
/****************************************************************************/ /****************************************************************************/
int umsg(char *str) int umsg(const char *str)
{ {
int ch; int ch;
printf("%s\nHit enter to continue:",str); printf("%s\nHit enter to continue:",str);
...@@ -415,7 +415,7 @@ BOOL deny(char* fmt, ...) ...@@ -415,7 +415,7 @@ BOOL deny(char* fmt, ...)
/****************************************************************************/ /****************************************************************************/
/* Status popup/down function, see uifc.h for details. */ /* Status popup/down function, see uifc.h for details. */
/****************************************************************************/ /****************************************************************************/
void upop(char *str) void upop(const char *str)
{ {
static int len; static int len;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment