]> Kevux Git Server - fll/commitdiff
Update: Add additional signal checks in loops.
authorKevin Day <Kevin@kevux.org>
Sun, 18 Aug 2024 04:56:18 +0000 (23:56 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 18 Aug 2024 04:56:18 +0000 (23:56 -0500)
level_3/fss_read/c/main/print/data.c
level_3/fss_read/c/main/process_normal.c

index 7f8cf20a8591e99b5cca20f05d37039f808b3b24..c9e2c84a70c03c8e9ef6ce84a10bdf85e5b8c69c 100644 (file)
@@ -57,6 +57,8 @@ extern "C" {
           // Loop through with conditionals only when necessary for performance reasons.
           for (print_state |= 0x8; i < main->setting.contents.array[at].used; ++i) {
 
+            if (fss_read_signal_check(main)) return F_status_set_error(F_interrupt);
+
             if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) {
               print_state &= ~0x8;
 
@@ -78,6 +80,8 @@ extern "C" {
 
           for (; i < main->setting.contents.array[at].used; ++i) {
 
+            if (fss_read_signal_check(main)) return F_status_set_error(F_interrupt);
+
             if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) {
               if (main->callback.print_content_next) {
                 main->callback.print_content_next(&main->program.output);
index 6f6561bad2d68b9defdc59c2121bb0419f5e5473..157aa9e30d93949f7e6f6134cdfc36ebfe263918 100644 (file)
@@ -410,6 +410,9 @@ extern "C" {
           current = 0;
 
           for (i = 0; i < main->setting.contents.array[at].used; ++i) {
+
+            if (fss_read_signal_check(main)) return;
+
             if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) ++current;
           } // for
 
@@ -582,6 +585,8 @@ extern "C" {
 
         for (i = 0; i < main->setting.contents.array[at].used; ++i) {
 
+          if (fss_read_signal_check(main)) return;
+
           range.start = main->setting.contents.array[at].array[i].start;
           range.stop = main->setting.contents.array[at].array[i].stop;