]> Kevux Git Server - fll/commitdiff
Update: Use signal_check more consistently in programs.
authorKevin Day <thekevinday@gmail.com>
Wed, 30 Mar 2022 01:17:09 +0000 (20:17 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 30 Mar 2022 01:17:09 +0000 (20:17 -0500)
There are programs that do not use the fll_program_data_t structure.
These now define the signal_check in their main.
Such cases will go away as soon as they are converted into using fll_program_data_t.

32 files changed:
level_3/byte_dump/c/common.h
level_3/byte_dump/c/private-byte_dump.c
level_3/firewall/c/common.h
level_3/firewall/c/private-firewall.c
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_read/c/private-read.c
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/private-read.c
level_3/fss_embedded_list_read/c/common.h
level_3/fss_embedded_list_read/c/fss_embedded_list_read.c
level_3/fss_embedded_list_read/c/private-read.c
level_3/fss_extended_list_read/c/fss_extended_list_read.c
level_3/fss_extended_list_read/c/private-read.c
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/private-read.c
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_extended_write/c/private-write.c
level_3/fss_identify/c/fss_identify.c
level_3/fss_identify/c/private-identify.c
level_3/fss_payload_read/c/fss_payload_read.c
level_3/fss_payload_read/c/private-read.c
level_3/fss_status_code/c/fss_status_code.c
level_3/iki_read/c/common.h
level_3/iki_read/c/iki_read.c
level_3/iki_read/c/private-read.c
level_3/iki_write/c/common.h
level_3/iki_write/c/iki_write.c
level_3/status_code/c/status_code.c
level_3/utf8/c/private-utf8.c
level_3/utf8/c/private-utf8_binary.c
level_3/utf8/c/private-utf8_codepoint.c
level_3/utf8/c/utf8.c

index 931506a053ddccf7b2419d92ebe9125604e4141b..d4a61b8bb0d296f6b2a7e3041dcc5681f5d4e5a7 100644 (file)
@@ -346,13 +346,12 @@ extern "C" {
  * warning:      The output file for warning printing.
  * signal:       The process signal management structure.
  * context:      The color context.
- *
- * @todo
  */
 #ifndef _di_byte_dump_main_t_
   typedef struct {
     f_console_parameters_t parameters;
 
+    uint16_t signal_check;
     bool process_pipe;
 
     fl_print_t output;
@@ -374,6 +373,7 @@ extern "C" {
   #define byte_dump_main_t_initialize \
     { \
       f_console_parameters_t_initialize, \
+      0, \
       F_false, \
       fl_print_t_initialize, \
       macro_fl_print_t_initialize_error(), \
index 202d81ef2012ff4c2732316aa2a75de6698e5f4b..ea3a29b16b97dac80cdacd82db542177d655b559 100644 (file)
@@ -57,14 +57,14 @@ extern "C" {
     memset(&invalid, 0, sizeof(f_char_t) * main->width);
 
     if (byte_get >= 0) {
-      for (uint16_t signal_check = 0; ; ) {
+      for (;;) {
 
-        if (!((++signal_check) % byte_dump_signal_check_d)) {
+        if (!((++main->signal_check) % byte_dump_signal_check_d)) {
           if (byte_dump_signal_received(main)) {
             return F_status_set_error(F_interrupt);
           }
 
-          signal_check = 0;
+          main->signal_check = 0;
         }
 
         byte_get = getc(file.stream);
index 2d06eeef479e8adfa6df7910e564c6688c86bd9d..6d8a17dbec0029e561e248a7eface6f58db039f2 100644 (file)
@@ -419,6 +419,7 @@ extern "C" {
   typedef struct {
     f_console_parameters_t parameters;
 
+    uint16_t signal_check;
     bool process_pipe;
     int child;
 
@@ -437,6 +438,7 @@ extern "C" {
   #define firewall_main_t_initialize \
     { \
       f_console_parameters_t_initialize, \
+      0, \
       F_false, \
       0, \
       fl_print_t_initialize, \
index 06361a98065b4ca9ecbd1e22548fdf75079b1da4..a439b45542c8dc9ac2c08819991dc89d0a049eed 100644 (file)
@@ -61,9 +61,9 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
     chain = firewall_chain_custom_id_e;
   }
 
-  for (uint16_t signal_check = 0; F_status_is_error_not(status) && i < local.rule_objects.used; ++i) {
+  for (; F_status_is_error_not(status) && i < local.rule_objects.used; ++i) {
 
-    if (!((++signal_check) % firewall_signal_check_d)) {
+    if (!((++main->signal_check) % firewall_signal_check_d)) {
       if (firewall_signal_received(main)) {
         f_string_dynamic_resize(0, &ip_list);
         f_string_dynamics_resize(0, &arguments);
@@ -73,7 +73,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
         return F_status_set_error(F_interrupt);
       }
 
-      signal_check = 0;
+      main->signal_check = 0;
     }
 
     length = macro_firewall_structure_size(local.rule_objects, i);
@@ -816,12 +816,12 @@ f_status_t firewall_create_custom_chains(firewall_main_t * const main, firewall_
   reserved->has_stop = F_false;
   reserved->has_main = F_false;
 
-  for (uint16_t signal_check = 0; i < local->chain_objects.used; ++i) {
+  for (; i < local->chain_objects.used; ++i) {
 
     new_chain = F_true;
     j = 0;
 
-    if (!((++signal_check) % firewall_signal_check_d)) {
+    if (!((++main->signal_check) % firewall_signal_check_d)) {
       if (firewall_signal_received(main)) break;
     }
 
index 3bee387581144960b7980d21b591e7a445c1311b..520de0426365cd2d81113d959ee77c942503bad1 100644 (file)
@@ -353,21 +353,20 @@ extern "C" {
       if (F_status_is_error_not(status) && main->parameters.array[fss_basic_list_read_parameter_delimit_e].result == f_console_result_additional_e) {
         f_array_length_t index = 0;
         f_array_length_t length = 0;
-        uint16_t signal_check = 0;
 
         // Set the value to 0 to allow for detecting mode based on what is provided.
         data.delimit_mode = 0;
 
         for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_read_parameter_delimit_e].values.used; ++i) {
 
-          if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+          if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
             if (fss_basic_list_read_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           index = main->parameters.array[fss_basic_list_read_parameter_delimit_e].values.array[i];
@@ -551,18 +550,17 @@ extern "C" {
       if (F_status_is_error_not(status) && main->parameters.remaining.used) {
         f_file_t file = f_file_t_initialize;
         f_array_length_t size_file = 0;
-        uint16_t signal_check = 0;
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+          if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
             if (fss_basic_list_read_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
index 8720f41e67862278020e6da238787ee745eb77f8..af5c7253dce01fe07d97a93e2bf41c6e4edbd914 100644 (file)
@@ -83,16 +83,15 @@ extern "C" {
     f_array_length_t position_depth = 0;
     f_array_length_t position_at = 0;
     f_array_length_t position_name = 0;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
-      if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
         if (fss_basic_list_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       data->depths.array[i].depth = 0;
@@ -173,12 +172,12 @@ extern "C" {
 
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
-        if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+        if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
           if (fss_basic_list_read_signal_received(main)) {
             return F_status_set_error(F_interrupt);
           }
 
-          signal_check = 0;
+          main->signal_check = 0;
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
@@ -342,7 +341,6 @@ extern "C" {
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
     f_array_lengths_t *delimits_object = fss_basic_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
     f_array_lengths_t *delimits_content = fss_basic_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
-    uint16_t signal_check = 0;
 
     if (data->option & fss_basic_list_read_data_option_raw_d) {
       delimits_object = &except_none;
@@ -353,12 +351,12 @@ extern "C" {
 
       if (!names[i]) continue;
 
-      if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
         if (fss_basic_list_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       fss_basic_list_read_print_at(main, i, *delimits_object, *delimits_content, data);
@@ -394,18 +392,17 @@ extern "C" {
 
     f_array_length_t at = 0;
     f_status_t status = F_none;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t i = 0; i < data->objects.used; ++i) {
 
       if (!names[i]) continue;
 
-      if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
         if (fss_basic_list_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       if (at == data->depths.array[0].value_at) {
@@ -493,7 +490,6 @@ extern "C" {
 
       f_string_range_t range = data->contents.array[at].array[0];
       f_array_length_t i = 0;
-      uint16_t signal_check = 0;
 
       // This content has no data, do not even check "include empty" because it cannot be counted as a line.
       if (range.start > range.stop) {
@@ -502,12 +498,12 @@ extern "C" {
 
       for (i = range.start; i <= range.stop; ++i) {
 
-        if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+        if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
           if (fss_basic_list_read_signal_received(main)) {
             return F_status_set_error(F_interrupt);
           }
 
-          signal_check = 0;
+          main->signal_check = 0;
         }
 
         if (data->buffer.string[i] == f_string_eol_s.string[0]) {
@@ -578,18 +574,17 @@ extern "C" {
     }
 
     f_array_length_t max = 0;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t i = 0; i < data->contents.used; ++i) {
 
       if (!names[i]) continue;
 
-      if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
         if (fss_basic_list_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       if (data->contents.array[i].used > max) {
@@ -617,18 +612,17 @@ extern "C" {
 
     f_array_length_t line = 0;
     f_status_t status = F_none;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t i = 0; i < data->contents.used; ++i) {
 
       if (!names[i]) continue;
 
-      if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
         if (fss_basic_list_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       status = fss_basic_list_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
@@ -733,18 +727,17 @@ extern "C" {
     f_array_length_t total = 0;
     f_string_range_t range = f_string_range_t_initialize;
     f_array_length_t i = 0;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t at = 0; at < data->contents.used; ++at) {
 
       if (!names[at]) continue;
 
-      if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
         if (fss_basic_list_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       if (data->option & fss_basic_list_read_data_option_object_d) {
index 654c9da24ebd86fca028ecfc0b374064c0b7ba1c..71acf22b0439f0fb2db263b07de56a76a1d5621e 100644 (file)
@@ -359,10 +359,14 @@ extern "C" {
 
         for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_read_parameter_delimit_e].values.used; ++i) {
 
-          if (fss_basic_read_signal_received(main)) {
-            status = F_status_set_error(F_interrupt);
+          if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
+            if (fss_basic_read_signal_received(main)) {
+              status = F_status_set_error(F_interrupt);
 
-            break;
+              break;
+            }
+
+            main->signal_check = 0;
           }
 
           index = main->parameters.array[fss_basic_read_parameter_delimit_e].values.array[i];
@@ -557,10 +561,14 @@ extern "C" {
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (fss_basic_read_signal_received(main)) {
-            status = F_status_set_error(F_signal);
+          if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
+            if (fss_basic_read_signal_received(main)) {
+              status = F_status_set_error(F_signal);
 
-            break;
+              break;
+            }
+
+            main->signal_check = 0;
           }
 
           data.files.array[data.files.used].range.start = data.buffer.used;
index 3c033ca7b87749f946e7aaf95e4e95af03096a49..325fbe0c4e7e2167016828e14ac140eafad612fa 100644 (file)
@@ -63,8 +63,12 @@ extern "C" {
 
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
-      if (fss_basic_read_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
+        if (fss_basic_read_signal_received(main)) {
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       data->depths.array[i].depth = 0;
@@ -145,8 +149,12 @@ extern "C" {
 
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
-        if (fss_basic_read_signal_received(main)) {
-          return F_status_set_error(F_interrupt);
+        if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
+          if (fss_basic_read_signal_received(main)) {
+            return F_status_set_error(F_interrupt);
+          }
+
+          main->signal_check = 0;
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
@@ -358,8 +366,12 @@ extern "C" {
 
       if (!names[i]) continue;
 
-      if (fss_basic_read_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
+        if (fss_basic_read_signal_received(main)) {
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       if (at == data->depths.array[0].value_at) {
@@ -435,8 +447,12 @@ extern "C" {
 
       if (!names[at]) continue;
 
-      if (fss_basic_read_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
+        if (fss_basic_read_signal_received(main)) {
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       if (data->contents.array[at].used > max) {
@@ -462,8 +478,12 @@ extern "C" {
 
       if (!names[i]) continue;
 
-      if (fss_basic_read_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
+        if (fss_basic_read_signal_received(main)) {
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       if (!(data->option & fss_basic_read_data_option_object_d) && (data->option & fss_basic_read_data_option_content_d)) {
@@ -607,8 +627,12 @@ extern "C" {
 
       if (!names[i]) continue;
 
-      if (fss_basic_read_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
+        if (fss_basic_read_signal_received(main)) {
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       if (!(data->option & fss_basic_read_data_option_object_d) && data->option & fss_basic_read_data_option_content_d) {
index 4d533bc714f9b2c32169ac63ca7e2f61b4387bd9..1ce39357fa76fa517bce783e144fef627b5f5dc7 100644 (file)
@@ -285,6 +285,7 @@ extern "C" {
   typedef struct {
     f_console_parameters_t parameters;
 
+    uint16_t signal_check;
     f_array_lengths_t remaining;
     bool process_pipe;
 
@@ -307,6 +308,7 @@ extern "C" {
   #define fss_embedded_list_read_main_t_initialize \
     { \
       f_console_parameters_t_initialize, \
+      0, \
       f_array_lengths_t_initialize, \
       F_false, \
       fl_print_t_initialize, \
index ad65cd987c6525ecf63b00695c02a4bf01e2f1c6..9219ebc0bf18b9720a17f97c400d3b8d67185d14 100644 (file)
@@ -444,10 +444,14 @@ extern "C" {
       if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (fss_embedded_list_read_signal_received(main)) {
-            status = F_status_set_error(F_interrupt);
+          if (!((++main->signal_check) % fss_embedded_list_read_signal_check_d)) {
+            if (fss_embedded_list_read_signal_received(main)) {
+              status = F_status_set_error(F_interrupt);
 
-            break;
+              break;
+            }
+
+            main->signal_check = 0;
           }
 
           f_file_t file = f_file_t_initialize;
index 15552db2baf32d64ec1e15c61e84d83e5e6e33ab..0ca32636ebcf4c4981d0116584a1aab8dd9d7094 100644 (file)
@@ -129,8 +129,12 @@ extern "C" {
 
       for (i = 0; i < values_total; ++i) {
 
-        if (fss_embedded_list_read_signal_received(main)) {
-          return F_status_set_error(F_interrupt);
+        if (!((++main->signal_check) % fss_embedded_list_read_signal_check_d)) {
+          if (fss_embedded_list_read_signal_received(main)) {
+            return F_status_set_error(F_interrupt);
+          }
+
+          main->signal_check = 0;
         }
 
         if (values_type[i] == fss_embedded_list_read_parameter_depth_e || values_type[i] == fss_embedded_list_read_parameter_at_e) {
@@ -554,8 +558,12 @@ extern "C" {
 
         if (skip[i]) continue;
 
-        if (fss_embedded_list_read_signal_received(main)) {
-          return F_status_set_error(F_interrupt);
+        if (!((++main->signal_check) % fss_embedded_list_read_signal_check_d)) {
+          if (fss_embedded_list_read_signal_received(main)) {
+            return F_status_set_error(F_interrupt);
+          }
+
+          main->signal_check = 0;
         }
 
         if (!items->array[i].content.used) {
index fd33c887487531e41196120f0f69ebabe1005f8c..ebb472c462a984d59d703dbaa68cca955fd1791a 100644 (file)
@@ -359,10 +359,14 @@ extern "C" {
 
         for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.used; ++i) {
 
-          if (fss_extended_list_read_signal_received(main)) {
-            status = F_status_set_error(F_interrupt);
+          if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
+            if (fss_extended_list_read_signal_received(main)) {
+              status = F_status_set_error(F_interrupt);
 
-            break;
+              break;
+            }
+
+            main->signal_check = 0;
           }
 
           index = main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.array[i];
@@ -557,10 +561,14 @@ extern "C" {
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (fss_extended_list_read_signal_received(main)) {
-            status = F_status_set_error(F_interrupt);
+          if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
+            if (fss_extended_list_read_signal_received(main)) {
+              status = F_status_set_error(F_interrupt);
 
-            break;
+              break;
+            }
+
+            main->signal_check = 0;
           }
 
           data.files.array[data.files.used].range.start = data.buffer.used;
index 134d73b43d894594d71fd2ea2cf87fb78ff3b81e..72e338a0c6b34ba958192f7cdca9ac158fc48858 100644 (file)
@@ -86,8 +86,12 @@ extern "C" {
 
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
-      if (fss_extended_list_read_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
+        if (fss_extended_list_read_signal_received(main)) {
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       data->depths.array[i].depth = 0;
@@ -168,8 +172,12 @@ extern "C" {
 
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
-        if (fss_extended_list_read_signal_received(main)) {
-          return F_status_set_error(F_interrupt);
+        if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
+          if (fss_extended_list_read_signal_received(main)) {
+            return F_status_set_error(F_interrupt);
+          }
+
+          main->signal_check = 0;
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
index 36e9e55cab51f6fc9a75afe9e375dba7ddfed5d9..e605f5e08ba2e3751a1288c1032ae0094e488878 100644 (file)
@@ -351,21 +351,20 @@ extern "C" {
       if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_delimit_e].result == f_console_result_additional_e) {
         f_array_length_t index = 0;
         f_array_length_t length = 0;
-        uint16_t signal_check = 0;
 
         // Set the value to 0 to allow for detecting mode based on what is provided.
         data.delimit_mode = 0;
 
         for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_read_parameter_delimit_e].values.used; ++i) {
 
-          if (!((++signal_check) % fss_extended_read_signal_check_d)) {
+          if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
             if (fss_extended_read_signal_received(main)) {
               status = F_status_set_error(F_signal);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           index = main->parameters.array[fss_extended_read_parameter_delimit_e].values.array[i];
@@ -557,17 +556,17 @@ extern "C" {
       if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
         f_file_t file = f_file_t_initialize;
         f_array_length_t size_file = 0;
-        uint16_t signal_check = 0;
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % fss_extended_read_signal_check_d)) {
+          if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
             if (fss_extended_read_signal_received(main)) {
               status = F_status_set_error(F_signal);
+
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           data.files.array[data.files.used].range.start = data.buffer.used;
index d23d8d4688277c4661b50ddb5b6e9abd8160c431..74f26046ce77a385a6e58ec326203aa69ded401e 100644 (file)
@@ -87,16 +87,15 @@ extern "C" {
     f_array_length_t position_depth = 0;
     f_array_length_t position_at = 0;
     f_array_length_t position_name = 0;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
-      if (!((++signal_check) % fss_extended_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
         if (fss_extended_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       data->depths.array[i].depth = 0;
@@ -177,12 +176,12 @@ extern "C" {
 
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
-        if (!((++signal_check) % fss_extended_read_signal_check_d)) {
+        if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
           if (fss_extended_read_signal_received(main)) {
             return F_status_set_error(F_interrupt);
           }
 
-          signal_check = 0;
+          main->signal_check = 0;
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
index fa2d301789dc1f9724b3dc4c9505da4a8b0cbaab..9bdefb184cb5256b7fcbac706c80933ec2600bf9 100644 (file)
@@ -450,18 +450,16 @@ extern "C" {
           if (main->parameters.array[fss_extended_write_parameter_object_e].result == f_console_result_additional_e) {
             contents.used = 0;
 
-            uint16_t signal_check = 0;
-
             for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
 
-              if (!((++signal_check) % fss_extended_write_signal_check_d)) {
+              if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
                 if (fss_extended_write_signal_received(main)) {
                   status = F_status_set_error(F_interrupt);
 
                   break;
                 }
 
-                signal_check = 0;
+                main->signal_check = 0;
               }
 
               status = fss_extended_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]], 0, &buffer);
@@ -497,16 +495,16 @@ extern "C" {
           f_array_length_t object_next = 0;
           f_array_length_t content_current = 0;
 
-          for (uint16_t signal_check = 0; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
+          for (; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
 
-            if (!((++signal_check) % fss_extended_write_signal_check_d)) {
+            if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
               if (fss_extended_write_signal_received(main)) {
                 status = F_status_set_error(F_interrupt);
 
                 break;
               }
 
-              signal_check = 0;
+              main->signal_check = 0;
             }
 
             object_current = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[i];
index c2c07085685a68ae344ee9cd83c2e684c36391d7..90e211b4f5fc665e08ec74742d53d20a1e5985b1 100644 (file)
@@ -175,14 +175,14 @@ extern "C" {
     // 0x0 = start new object/content set, 0x1 = processing object, 0x2 = new individual content, 0x3 = processing content, 0x4 = end object/content set.
     uint8_t state = 0;
 
-    for (uint16_t signal_check = 0; ; ) {
+    for (;;) {
 
-      if (!((++signal_check) % fss_extended_write_signal_check_d)) {
+      if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
         if (fss_extended_write_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       if (range.start > range.stop) {
index 233a04ce1104cae823371f75998291352ca78147..e6a8211719280bff46e76fe6b7aeab0873f6cf8d 100644 (file)
@@ -300,18 +300,16 @@ extern "C" {
     }
 
     if (F_status_is_error_not(status)) {
-      uint16_t signal_check = 0;
-
       for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-        if (!((++signal_check) % fss_identify_signal_check_d)) {
+        if (!((++main->signal_check) % fss_identify_signal_check_d)) {
           if (fss_identify_signal_received(main)) {
             status = F_status_set_error(F_interrupt);
 
             break;
           }
 
-          signal_check = 0;
+          main->signal_check = 0;
         }
 
         if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_additional_e) {
index ed623ffef1b62d387b4a22441de52f18bee10b58..13d039b7399973ae4f421798d1bbbce86b067305 100644 (file)
@@ -11,7 +11,6 @@ extern "C" {
   f_status_t fss_identify_load_line(fll_program_data_t * const main, const f_file_t file, const f_string_static_t file_name, f_string_static_t *buffer, f_string_range_t *range) {
 
     f_status_t status = F_none;
-    uint16_t signal_check = 0;
 
     buffer->used = 0;
 
@@ -19,14 +18,14 @@ extern "C" {
     range->stop = 0;
 
     do {
-      if (!((++signal_check) % fss_identify_signal_check_d)) {
+      if (!((++main->signal_check) % fss_identify_signal_check_d)) {
         if (fss_identify_signal_received(main)) {
           status = F_status_set_error(F_interrupt);
 
           break;
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       if (buffer->used + file.size_read > buffer->size) {
index 5f9ac54b0cea9fa640957453937517c3a208f811..b04032a6d7fcb22e274a27081c20889fd681263f 100644 (file)
@@ -371,21 +371,20 @@ extern "C" {
       if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_delimit_e].result == f_console_result_additional_e) {
         f_array_length_t index = 0;
         f_array_length_t length = 0;
-        uint16_t signal_check = 0;
 
         // Set the value to 0 to allow for detecting mode based on what is provided.
         data.delimit_mode = 0;
 
         for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_read_parameter_delimit_e].values.used; ++i) {
 
-          if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+          if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
             if (fss_payload_read_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           index = main->parameters.array[fss_payload_read_parameter_delimit_e].values.array[i];
@@ -591,18 +590,17 @@ extern "C" {
         f_file_t file = f_file_t_initialize;
         f_array_length_t size_file = 0;
         const f_array_length_t buffer_used = data.buffer.used;
-        uint16_t signal_check = 0;
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+          if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
             if (fss_payload_read_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           data.files.array[data.files.used].range.start = data.buffer.used;
index 7efc8a8c37fe1c00c0f618db1f713f59d720120e..c862b0295aef49277bef0c52d6122e0d470a2bc6 100644 (file)
@@ -83,16 +83,15 @@ extern "C" {
     f_array_length_t position_depth = 0;
     f_array_length_t position_at = 0;
     f_array_length_t position_name = 0;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
-      if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
         if (fss_payload_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       data->depths.array[i].depth = 0;
@@ -173,12 +172,12 @@ extern "C" {
 
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
-        if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+        if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
           if (fss_payload_read_signal_received(main)) {
             return F_status_set_error(F_interrupt);
           }
 
-          signal_check = 0;
+          main->signal_check = 0;
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
@@ -438,7 +437,6 @@ extern "C" {
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
     f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
     f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
-    uint16_t signal_check = 0;
     bool is_payload = F_false;
 
     if (data->option & fss_payload_read_data_option_raw_d) {
@@ -450,12 +448,12 @@ extern "C" {
 
       if (!names[i]) continue;
 
-      if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
         if (fss_payload_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       is_payload = fl_string_dynamic_partial_compare_string(f_fss_string_payload_s.string, data->buffer, f_fss_string_payload_s.used, data->objects.array[i]) == F_equal_to;
@@ -493,19 +491,18 @@ extern "C" {
 
     f_array_length_t at = 0;
     f_status_t status = F_none;
-    uint16_t signal_check = 0;
     bool is_payload = F_false;
 
     for (f_array_length_t i = 0; i < data->objects.used; ++i) {
 
       if (!names[i]) continue;
 
-      if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
         if (fss_payload_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       if (at == data->depths.array[0].value_at) {
@@ -690,7 +687,6 @@ extern "C" {
 
       f_string_range_t range = f_string_range_t_initialize;
       f_array_length_t i = 0;
-      uint16_t signal_check = 0;
 
       range.start = data->contents.array[at].array[0].start;
       range.stop = data->contents.array[at].array[0].stop;
@@ -702,12 +698,12 @@ extern "C" {
 
       for (i = range.start; i <= range.stop; ++i) {
 
-        if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+        if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
           if (fss_payload_read_signal_received(main)) {
             return F_status_set_error(F_interrupt);
           }
 
-          signal_check = 0;
+          main->signal_check = 0;
         }
 
         if (data->buffer.string[i] == f_string_eol_s.string[0]) {
@@ -778,18 +774,17 @@ extern "C" {
     }
 
     f_array_length_t max = 0;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t at = 0; at < data->contents.used; ++at) {
 
       if (!names[at]) continue;
 
-      if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
         if (fss_payload_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       if (data->contents.array[at].used > max) {
@@ -847,18 +842,17 @@ extern "C" {
 
     f_array_length_t line = 0;
     f_status_t status = F_none;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t i = 0; i < data->contents.used; ++i) {
 
       if (!names[i]) continue;
 
-      if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
         if (fss_payload_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       status = fss_payload_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
@@ -1051,18 +1045,17 @@ extern "C" {
     f_array_length_t total = 0;
     f_string_range_t range = f_string_range_t_initialize;
     f_array_length_t i = 0;
-    uint16_t signal_check = 0;
 
     for (f_array_length_t at = 0; at < data->contents.used; ++at) {
 
       if (!names[at]) continue;
 
-      if (!((++signal_check) % fss_payload_read_signal_check_d)) {
+      if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
         if (fss_payload_read_signal_received(main)) {
           return F_status_set_error(F_interrupt);
         }
 
-        signal_check = 0;
+        main->signal_check = 0;
       }
 
       if (data->option & fss_payload_read_data_option_object_d) {
index a4de8c99006ae97b3e12bf5ac381cbd89114d7fb..adee5288fe786c28d5149c4c91b3c261c610b233 100644 (file)
@@ -201,20 +201,18 @@ extern "C" {
       }
 
       if (main->parameters.remaining.used > 0) {
-        uint16_t signal_check = 0;
-
         flockfile(main->output.to.stream);
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % fss_status_code_signal_check_d)) {
+          if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
             if (fss_status_code_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           status2 = fss_status_code_process_check(main, argv[main->parameters.remaining.array[i]]);
@@ -233,20 +231,18 @@ extern "C" {
       }
 
       if (main->parameters.remaining.used > 0) {
-        uint16_t signal_check = 0;
-
         flockfile(main->output.to.stream);
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % fss_status_code_signal_check_d)) {
+          if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
             if (fss_status_code_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           status2 = fss_status_code_process_number(main, argv[main->parameters.remaining.array[i]]);
@@ -265,20 +261,18 @@ extern "C" {
       }
 
       if (main->parameters.remaining.used > 0) {
-        uint16_t signal_check = 0;
-
         flockfile(main->output.to.stream);
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % fss_status_code_signal_check_d)) {
+          if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
             if (fss_status_code_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           status2 = fss_status_code_process_normal(main, argv[main->parameters.remaining.array[i]]);
index b4e0a71947312d0301136aa2e9a43a16c563c1a4..78ca2d53fceedf1f19ceae8ca21b5132acfafc58 100644 (file)
@@ -251,6 +251,7 @@ extern "C" {
   typedef struct {
     f_console_parameters_t parameters;
 
+    uint16_t signal_check;
     bool process_pipe;
 
     fl_print_t output;
@@ -274,6 +275,7 @@ extern "C" {
   #define iki_read_main_t_initialize \
     { \
       f_console_parameters_t_initialize, \
+      0, \
       F_false, \
       fl_print_t_initialize, \
       macro_fl_print_t_initialize_error(), \
index 71c3b0295a7820a8d934b834e655460fbdcd0f5a..c3eafbe7c441c09b132842ff5dc6349438db097e 100644 (file)
@@ -434,19 +434,18 @@ extern "C" {
       }
 
       if (F_status_is_fine(status) && main->parameters.remaining.used > 0) {
-        uint16_t signal_check = 0;
         f_file_t file = f_file_t_initialize;
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % iki_read_signal_check_d)) {
+          if (!((++main->signal_check) % iki_read_signal_check_d)) {
             if (iki_read_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           macro_f_file_t_reset(file);
index 40874db8fa8dfd97485be6c4d9028a42b9347820..ff470a5fa37e61ec9733027610f31062cc1a5879 100644 (file)
@@ -498,16 +498,16 @@ extern "C" {
 
       range.start = 0;
 
-      for (uint16_t signal_check = 0; i < main->parameters.array[iki_read_parameter_name_e].values.used; ++i) {
+      for (; i < main->parameters.array[iki_read_parameter_name_e].values.used; ++i) {
 
-        if (!((++signal_check) % iki_read_signal_check_d)) {
+        if (!((++main->signal_check) % iki_read_signal_check_d)) {
           if (iki_read_signal_received(main)) {
             f_string_dynamic_resize(0, &name);
 
             return F_status_set_error(F_interrupt);
           }
 
-          signal_check = 0;
+          main->signal_check = 0;
         }
 
         index = main->parameters.array[iki_read_parameter_name_e].values.array[i];
index f942d3563a713d39f759fb72d4e34c2ca1311ddb..7d10eb102229db73d047339dc26cc86b7f81d8a1 100644 (file)
@@ -155,13 +155,12 @@ extern "C" {
  * warning:      The output file for warning printing.
  * signal:       The process signal management structure.
  * context:      The color context.
- *
- * @todo
  */
 #ifndef _di_iki_write_main_t_
   typedef struct {
     f_console_parameters_t parameters;
 
+    uint16_t signal_check;
     bool process_pipe;
 
     fl_print_t output;
@@ -179,6 +178,7 @@ extern "C" {
   #define iki_write_main_t_initialize \
     { \
       f_console_parameters_t_initialize, \
+      0, \
       F_false, \
       fl_print_t_initialize, \
       macro_fl_print_t_initialize_error(), \
index 334ec73be773928605fa0d98eb56dd80eda8cc23..39e4719e166cbcf2615dc496ac97b9f2d7192743 100644 (file)
@@ -295,20 +295,19 @@ extern "C" {
 
         f_array_length_t previous = 0;
         f_string_range_t range = f_string_range_t_initialize;
-        uint16_t signal_check = 0;
 
         range.start = 0;
 
         for (f_status_t status_pipe = F_none; ; ) {
 
-          if (!((++signal_check) % iki_write_signal_check_d)) {
+          if (!((++main->signal_check) % iki_write_signal_check_d)) {
             if (iki_write_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           if (status_pipe != F_none_eof) {
@@ -426,17 +425,15 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        uint16_t signal_check = 0;
-
         for (f_array_length_t i = 0; i < main->parameters.array[iki_write_parameter_object_e].values.used; ++i) {
 
-          if (!((++signal_check) % iki_write_signal_check_d)) {
+          if (!((++main->signal_check) % iki_write_signal_check_d)) {
             if (iki_write_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           status = iki_write_process(main, file, argv[main->parameters.array[iki_write_parameter_object_e].values.array[i]], argv[main->parameters.array[iki_write_parameter_content_e].values.array[i]], &escaped);
index a9643f27b15122b52bd604181ea9ab4757f0c5f3..229024292fb6886bdc333e1ddeadacbc029bf570 100644 (file)
@@ -201,20 +201,18 @@ extern "C" {
       }
 
       if (main->parameters.remaining.used > 0) {
-        uint16_t signal_check = 0;
-
         flockfile(main->output.to.stream);
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % status_code_signal_check_d)) {
+          if (!((++main->signal_check) % status_code_signal_check_d)) {
             if (status_code_signal_received(main)) {
               status = F_status_set_error(F_signal);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           status2 = status_code_process_check(main, argv[main->parameters.remaining.array[i]]);
@@ -233,20 +231,18 @@ extern "C" {
       }
 
       if (main->parameters.remaining.used > 0) {
-        uint16_t signal_check = 0;
-
         flockfile(main->output.to.stream);
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % status_code_signal_check_d)) {
+          if (!((++main->signal_check) % status_code_signal_check_d)) {
             if (status_code_signal_received(main)) {
               status = F_status_set_error(F_signal);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           status2 = status_code_process_number(main, argv[main->parameters.remaining.array[i]]);
@@ -265,20 +261,18 @@ extern "C" {
       }
 
       if (main->parameters.remaining.used > 0) {
-        uint16_t signal_check = 0;
-
         flockfile(main->output.to.stream);
 
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % status_code_signal_check_d)) {
+          if (!((++main->signal_check) % status_code_signal_check_d)) {
             if (status_code_signal_received(main)) {
               status = F_status_set_error(F_signal);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           status2 = status_code_process_normal(main, argv[main->parameters.remaining.array[i]]);
index 2f588472b3aebed6d3244f3603425115f900d0e0..ec3249029feba39562d357bb87b345f555997ba8 100644 (file)
@@ -36,9 +36,9 @@ extern "C" {
 
     flockfile(data->file.stream);
 
-    for (uint16_t signal_check = 0; text.string[0] && F_status_is_error_not(status); ) {
+    for (; text.string[0] && F_status_is_error_not(status); ) {
 
-      if (!((++signal_check) % utf8_signal_check_d)) {
+      if (!((++data->main->signal_check) % utf8_signal_check_d)) {
         if (utf8_signal_received(data)) {
           utf8_print_signal_received(data, status);
 
@@ -46,6 +46,8 @@ extern "C" {
 
           break;
         }
+
+        data->main->signal_check = 0;
       }
 
       status = F_none;
index b78c777405199ecb48ed0ce9b8dd606ce2b0c5ec..5c1d94d6293c2d35341bcb8547044cdecccd5d96 100644 (file)
@@ -68,7 +68,6 @@ extern "C" {
     bool valid = F_true;
     bool next = F_true;
     uint8_t mode_codepoint = utf8_codepoint_mode_ready_e;
-    uint16_t signal_check = 0;
 
     f_array_length_t i = 0;
     f_array_length_t j = 0;
@@ -83,7 +82,7 @@ extern "C" {
 
       for (i = 0; F_status_is_fine(status) && i < data->buffer.used; ) {
 
-        if (!((++signal_check) % utf8_signal_check_d)) {
+        if (!((++data->main->signal_check) % utf8_signal_check_d)) {
           if (utf8_signal_received(data)) {
             utf8_print_signal_received(data, status);
 
@@ -91,6 +90,8 @@ extern "C" {
 
             break;
           }
+
+          data->main->signal_check = 0;
         }
 
         status = F_none;
index fa391ea85b31dae53fae3555f2d55a8cb8f2ba9b..64f5201195ef6ef5ff6c73946882036d17176247 100644 (file)
@@ -204,7 +204,6 @@ extern "C" {
     bool valid = F_true;
     bool next = F_true;
     uint8_t mode_codepoint = utf8_codepoint_mode_ready_e;
-    uint16_t signal_check = 0;
 
     f_array_length_t i = 0;
     f_array_length_t j = 0;
@@ -219,13 +218,16 @@ extern "C" {
 
       for (i = 0; F_status_is_fine(status) && i < data->buffer.used; ) {
 
-        if (!((++signal_check) % utf8_signal_check_d)) {
+        if (!((++data->main->signal_check) % utf8_signal_check_d)) {
           if (utf8_signal_received(data)) {
             utf8_print_signal_received(data, status);
 
             status = F_signal;
+
             break;
           }
+
+          data->main->signal_check = 0;
         }
 
         status = F_none;
index 4799c04436d1e78abadcba6b31cd52246bff8dce..5a36fbdc8d8ec536bf6e29061d64bd251ed988eb 100644 (file)
@@ -406,16 +406,16 @@ extern "C" {
 
         f_file_t file = macro_f_file_t_initialize(0, -1, F_file_flag_read_only_d, 32768, F_file_default_write_size_d);
 
-        for (uint16_t signal_check = 0; i < main->parameters.array[utf8_parameter_from_file_e].values.used && status != F_signal; ++i) {
+        for (; i < main->parameters.array[utf8_parameter_from_file_e].values.used && status != F_signal; ++i) {
 
-          if (!((++signal_check) % utf8_signal_check_d)) {
+          if (!((++main->signal_check) % utf8_signal_check_d)) {
             if (utf8_signal_received(&data)) {
               status = F_status_set_error(F_signal);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           index = main->parameters.array[utf8_parameter_from_file_e].values.array[i];
@@ -454,18 +454,16 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && status != F_signal && main->parameters.remaining.used) {
-        uint16_t signal_check = 0;
-
         for (f_array_length_t i = 0; F_status_is_error_not(status) && i < main->parameters.remaining.used; ++i) {
 
-          if (!((++signal_check) % utf8_signal_check_d)) {
+          if (!((++main->signal_check) % utf8_signal_check_d)) {
             if (utf8_signal_received(&data)) {
               status = F_status_set_error(F_signal);
 
               break;
             }
 
-            signal_check = 0;
+            main->signal_check = 0;
           }
 
           utf8_print_section_header_parameter(&data, main->parameters.remaining.array[i]);