diff options
author | Oskar <[email protected]> | 2024-04-11 10:32:12 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-04-11 10:32:12 +0200 |
commit | d6ea48c5be4ec380d2ae18af19ce6107926f58ac (patch) | |
tree | fef506eb5f2d73b218c54a6c7d7a561e44c95eef | |
parent | 5d9aa978796cd7290c4c7ece59a75da532fd839c (diff) |
Prepared call_X functions, i havent had alot of time to work on this but
i have not abandoned this.
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | process_multiples.c | 28 |
2 files changed, 28 insertions, 2 deletions
@@ -1,6 +1,6 @@ TODO list. This is mostly so i can plan more granularly and remember small stuff i was working on last time and what i should prioritise first. This is not my overall big planning board. (1 highest prio, 10 lowest) -1 - +1 - Start working on X 2 - All L and N functionality is done. Did some testing and made some fixes. I will keep this here for now in case i find anything more. 2 - Not really a TODO point but more of an observation and a realisation i have made. I could have just used regex to do the validation of my commands. How about that... Well im too far in (sunk cost fallacy or whatever its called). diff --git a/process_multiples.c b/process_multiples.c index e690280..a2de559 100644 --- a/process_multiples.c +++ b/process_multiples.c @@ -266,7 +266,33 @@ uint64_t call_N(char *multiple, uint64_t focus, uint64_t Flines, char *filename) return 0; } -int call_X(char *multiple) { +int call_X(char *multiple, uint64_t focus, uint64_t Flines, char *filename) { + + int imm = _IMM_NUMBER; + + if (multiple[1] == '\n') { // X Will remove current line + imm = _NA; + remove_line_contents(filename, focus); + return 0; + } + + if (multiple[1] == '+') { // X+ Will..... idk + imm = _NA; + if (multiple[2] == '\n') { + // Will have to really think about this + return 0; + } + + // X plus continue. Still figuring out how this is gonna work. + + return 0; + } + + if (imm == _IMM_NUMBER) { + // X immediate, process immediates + + return 0; + } fprintf(stdout, "%s\n", multiple); return 0; |