diff --git a/src/uifc/uifc.h b/src/uifc/uifc.h index 40312ca5dc9ae630d91e3bdb140304dffcaebdb9..90b2aed26f9ec0cc0536bfd69c43c056b1b17204 100644 --- a/src/uifc/uifc.h +++ b/src/uifc/uifc.h @@ -424,11 +424,11 @@ typedef struct { /* str is the title for the application banner. */ /* 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. */ /****************************************************************************/ - int (*msg) (char* str); + int (*msg) (const char* str); int (*msgf) (char* fmt, ...); BOOL (*deny) (char* fmt, ...); BOOL (*confirm) (char* fmt, ...); @@ -437,7 +437,7 @@ typedef struct { /* str is the message to display on popup. */ /* if str==NULL, then the the status is to be cleared (popdown). */ /****************************************************************************/ - void (*pop) (char* str); + void (*pop) (const char* str); /****************************************************************************/ /* General menu function. */ /* mode contains WIN_* flags to control display and functionality. */ @@ -453,7 +453,7 @@ typedef struct { /* 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* bar, char *title, char** option); + ,int* bar, const char *title, char** option); /****************************************************************************/ /* Windowed string input routine. */ /* mode contains WIN_* flags to control display and functionality. */ @@ -465,7 +465,7 @@ typedef struct { /* This function sets uifcapi_t.changes to TRUE if the string is modified. */ /* 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); /****************************************************************************/ /* Sets the current help index by source code file and line number. */ diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index 3ecdf9ff60406678b2d60f300508afccf2148bc0..32bc93670db0f743d20a831d4707452e3e3abe1b 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -76,16 +76,16 @@ static void timedisplay(BOOL force); /* API routines */ 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 - ,char *title, char **option); -static int uinput(int imode, int left, int top, char *prompt, char *str + ,const char *title, char **option); +static int uinput(int imode, int left, int top, const char *prompt, char *str ,int len ,int kmode); -static int umsg(char *str); +static int umsg(const char *str); static int umsgf(char *fmt, ...); static BOOL confirm(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 showbuf(int mode, int left, int top, int width, int height, char *title , char *hbuf, int *curp, int *barp); @@ -535,7 +535,7 @@ void uifcbail(void) /* Clear screen, fill with background attribute, display application title. */ /* Returns 0 on success. */ /****************************************************************************/ -int uscrn(char *str) +int uscrn(const char *str) { textattr(api->bclr|(api->cclr<<4)); gotoxy(1,1); @@ -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. */ /****************************************************************************/ 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]; static char search[MAX_OPLN] = ""; @@ -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. */ /*************************************************************************/ -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) { 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, /****************************************************************************/ /* Displays the message 'str' and waits for the user to select "OK" */ /****************************************************************************/ -int umsg(char *str) +int umsg(const char *str) { int i=0; char *ok[2]={"OK",""}; @@ -2638,7 +2638,7 @@ char *utimestr(time_t *intime) /****************************************************************************/ /* 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]; int i,j,k; diff --git a/src/uifc/uifcx.c b/src/uifc/uifcx.c index fda34ebd6fd88cb1497a66309561fe65a72bd772..766f67527ea7393ca640a913e25a1dbf1c1cb559 100644 --- a/src/uifc/uifcx.c +++ b/src/uifc/uifcx.c @@ -54,16 +54,16 @@ static void help(void); /* API routines */ 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 - ,char *title, char **option); -static int uinput(int imode, int left, int top, char *prompt, char *str + ,const char *title, char **option); +static int uinput(int imode, int left, int top, const char *prompt, char *str ,int len ,int kmode); -static int umsg(char *str); +static int umsg(const char *str); static int umsgf(char *str, ...); static BOOL confirm(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); /****************************************************************************/ @@ -134,7 +134,7 @@ void uifcbail(void) /* Clear screen, fill with background attribute, display application title. */ /* Returns 0 on success. */ /****************************************************************************/ -int uscrn(char *str) +int uscrn(const char *str) { return(0); } @@ -193,7 +193,7 @@ static int which(char* prompt, int max) /* General menu function, see uifc.h for details. */ /****************************************************************************/ 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]; int i,opts; @@ -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. */ /*************************************************************************/ -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) { char str[256]; @@ -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 */ /****************************************************************************/ -int umsg(char *str) +int umsg(const char *str) { int ch; printf("%s\nHit enter to continue:",str); @@ -415,7 +415,7 @@ BOOL deny(char* fmt, ...) /****************************************************************************/ /* Status popup/down function, see uifc.h for details. */ /****************************************************************************/ -void upop(char *str) +void upop(const char *str) { static int len;