From c2844d947d2e8fdc43f9ede54fbeab89b3387183 Mon Sep 17 00:00:00 2001 From: Oskar Date: Sun, 31 Mar 2024 20:47:40 +0200 Subject: 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. --- input.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 8776f4d..1f2f81e 100644 --- a/input.c +++ b/input.c @@ -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]; -- cgit v1.2.3