diff options
author | Oskar <[email protected]> | 2024-03-31 20:47:40 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-03-31 20:47:40 +0200 |
commit | c2844d947d2e8fdc43f9ede54fbeab89b3387183 (patch) | |
tree | e5a23165cfbc84a083ea2bd6f51a50ed9f077b69 /input.c | |
parent | 637d43e58f72b0b6a3cc4577370cb52e07836b89 (diff) |
Alright. 'D' and 'X' will work exactly like validate_LN with MODE_N. May
change in the future but for now it will only support MODE_N for
simplicity sake. I really want the new input system out.
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 28 |
1 files changed, 22 insertions, 6 deletions
@@ -53,18 +53,34 @@ int smode_input(char *single, char **multiple, uint64_t focus) { // This functio *multiple = (char *)malloc(strlen(smode_buf) + 1); strcpy(*multiple, smode_buf); return _MULTIPLE; + break; } case 'x': - case 'X': + case 'X': { + + // X will work with MODE_N mode for now. I may update in the future to use MODE_L but for now i will only use MODE_N for simplicity sake. + int chk = validate_LN(smode_buf, MODE_N); + if (chk == _INVALID) { + return _FAIL; + } + *multiple = (char *)malloc(strlen(smode_buf) + 1); + strcpy(*multiple, smode_buf); return _MULTIPLE; - break; - case 'd': - case 'D': - *multiple = (char *)malloc(strlen(smode_buf) + 1); // just a test + break; } + case 'd': + case 'D': { + + // X will work with MODE_N mode for now. I may update in the future to use MODE_L but for now i will only use MODE_N for simplicity sake. + int chk = validate_LN(smode_buf, MODE_N); + if (chk == _INVALID) { + return _FAIL; + } + *multiple = (char *)malloc(strlen(smode_buf) + 1); strcpy(*multiple, smode_buf); return _MULTIPLE; - break; // singles below this point + + break; }// singles below this point case 'p': case 'P': *single = smode_buf[0]; |