summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rw-r--r--process_multiples.c28
2 files changed, 28 insertions, 2 deletions
diff --git a/TODO b/TODO
index c7716d0..b947f8e 100644
--- a/TODO
+++ b/TODO
@@ -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;