Skip to content
Snippets Groups Projects
Commit 8a6efb4d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Change uifcapi_t.kmode to .input_mode, only appy in input() method

parent 021949b0
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3842 passed
...@@ -633,7 +633,7 @@ int main(int argc, char **argv) ...@@ -633,7 +633,7 @@ int main(int argc, char **argv)
printf("uifc library init returned error %d\n",i); printf("uifc library init returned error %d\n",i);
exit(1); exit(1);
} }
uifc.kmode = K_TRIM; // trim all leading & trailing whitespace on string input uifc.input_mode = K_TRIM; // trim all leading & trailing whitespace on string input
if((opt=(char **)malloc(sizeof(char *)*(MAX_OPTS+1)))==NULL) if((opt=(char **)malloc(sizeof(char *)*(MAX_OPTS+1)))==NULL)
allocfail(sizeof(char *)*(MAX_OPTS+1)); allocfail(sizeof(char *)*(MAX_OPTS+1));
......
...@@ -248,9 +248,6 @@ enum { ...@@ -248,9 +248,6 @@ enum {
#ifndef uint #ifndef uint
#define uint unsigned int #define uint unsigned int
#endif #endif
#ifndef ulong
#define ulong unsigned long
#endif
#ifndef BOOL #ifndef BOOL
#define BOOL int #define BOOL int
...@@ -333,7 +330,10 @@ typedef struct { ...@@ -333,7 +330,10 @@ typedef struct {
/* Controls general UIFC library behavior. */ /* Controls general UIFC library behavior. */
/****************************************************************************/ /****************************************************************************/
int mode; int mode;
int kmode; /****************************************************************************/
/* Common input mode flags (K_*) to always set. */
/****************************************************************************/
int input_mode;
/****************************************************************************/ /****************************************************************************/
/* Set to TRUE when changes to data have been made by input function. */ /* Set to TRUE when changes to data have been made by input function. */
/****************************************************************************/ /****************************************************************************/
......
...@@ -1888,6 +1888,8 @@ int uinput(uifc_winmode_t mode, int left, int top, const char *inprompt, char *s ...@@ -1888,6 +1888,8 @@ int uinput(uifc_winmode_t mode, int left, int top, const char *inprompt, char *s
reset_dynamic(); reset_dynamic();
kmode |= api->input_mode; // Global keyboard input mode flags (e.g. K_TRIM)
if(mode&WIN_FAT) { if(mode&WIN_FAT) {
s_top=1; s_top=1;
s_left=2; s_left=2;
...@@ -2135,8 +2137,6 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int ...@@ -2135,8 +2137,6 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
char *pastebuf=NULL; char *pastebuf=NULL;
unsigned char *pb=NULL; unsigned char *pb=NULL;
mode |= api->kmode; // Global keyboard input mode flags (e.g. K_TRIM)
api->exit_flags = 0; api->exit_flags = 0;
if((str=alloca(max+1))==NULL) { if((str=alloca(max+1))==NULL) {
cprintf("UIFC line %d: error allocating %u bytes\r\n" cprintf("UIFC line %d: error allocating %u bytes\r\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment