diff options
Diffstat (limited to 'process_multiples.c')
-rw-r--r-- | process_multiples.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/process_multiples.c b/process_multiples.c index ade2a67..dc950f2 100644 --- a/process_multiples.c +++ b/process_multiples.c @@ -7,3 +7,68 @@ #include "input.h" #include "i_validation.h" #include <stdint.h> + +int call_L_plus_continue(char *multiple) { + + fprintf(stdout, "+ or - CONTINUE %s\n", multiple); + return 0; +} + +uint64_t call_L_plus_minus_only(uint64_t focus, char p_or_m) { + switch (p_or_m) { + case '+': + return focus+1; + break; + case '-': + return focus-1; + break; + } + + return _NA; +} + +uint64_t call_L(char *multiple, uint64_t focus) { + + int imm = _IMM_NUMBER; + + if (multiple[1] == '\n') { + imm = _NA; + fprintf(stdout, "L only\n"); + } + + if (multiple[1] == '+' || multiple[1] == '-') { + imm = _NA; + if (multiple[2] == '\n') { // This is where - and + only inputs happen and get processed + focus = call_L_plus_minus_only(focus, multiple[1]); + return focus; + } + call_L_plus_continue(multiple); + + } + + if (imm == _IMM_NUMBER) { + fprintf(stdout, "immediate\n"); + } + + + return focus; +} + +int call_N(char *multiple) { + + fprintf(stdout, "%s\n", multiple); + return 0; +} + +int call_X(char *multiple) { + + fprintf(stdout, "%s\n", multiple); + return 0; +} + +int call_D(char *multiple) { + + fprintf(stdout, "%s\n", multiple); + return 0; +} + |