]> Kevux Git Server - fll/commitdiff
Progress: Continue program related work, addressing f_state_t, recursion, and Feature...
authorKevin Day <kevin@kevux.org>
Thu, 6 Apr 2023 04:09:52 +0000 (23:09 -0500)
committerKevin Day <kevin@kevux.org>
Thu, 6 Apr 2023 04:09:52 +0000 (23:09 -0500)
Add missing f_directory_statuss_resize() implemetnation.

Add code property to f_state_t to provide custom flags for the caller to control.

Create fake_local_t to pass custom information to the recursion functions.

Begin setting up and populating the failures structure.

Take care more cases where the interrupt needs to be handled.
This now sets the interrupt function globally and so the interrupt should be checked more often (such as in FSS Basic List read functions).
Make sure the interrupt is not checked twice once a signal is received.
This can happen after a program returns due to an interrupt.

22 files changed:
level_0/f_directory/c/directory/type.c
level_0/f_directory/c/directory/type.h
level_0/f_type/c/type.h
level_3/control/c/private-control.c
level_3/controller/c/entry/private-entry.c
level_3/controller/c/rule/private-rule.c
level_3/fake/c/main/build.c
level_3/fake/c/main/build/load.c
level_3/fake/c/main/common/enumeration.h
level_3/fake/c/main/common/type.h
level_3/fake/c/main/fake.c
level_3/fake/c/main/main.c
level_3/fake/c/main/make/load_fakefile.c
level_3/fake/c/main/print/verbose.c
level_3/fake/c/main/signal.c
level_3/fake/c/main/signal.h
level_3/fss_basic_list_read/c/private-read.c
level_3/fss_basic_read/c/private-read.c
level_3/fss_embedded_list_read/c/private-read.c
level_3/fss_extended_list_read/c/private-read.c
level_3/fss_extended_read/c/private-read.c
level_3/fss_payload_read/c/private-read.c

index 85e6f71264bd5c9fcaacc5de7d45795d5bbb5ce6..bd7c6b613f1bccc7d32c5e7a2a8d0e63780a2815 100644 (file)
@@ -173,6 +173,16 @@ extern "C" {
   }
 #endif // _di_f_directory_statuss_increase_by_
 
+#ifndef _di_f_directory_statuss_resize_
+  f_status_t f_directory_statuss_resize(const f_array_length_t length, f_directory_statuss_t * const statuss) {
+    #ifndef _di_level_0_parameter_checking_
+      if (!statuss) return F_status_set_error(F_parameter);
+    #endif // _di_level_0_parameter_checking_
+
+    return private_f_directory_statuss_resize(length, statuss);
+  }
+#endif // _di_f_directory_statuss_resize_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index c4b259e2aa53ad0b9a37381153bc5bc600df3088..1a18786efef2cd67c01cfcc02c4aa4a6538b2d48 100644 (file)
@@ -425,8 +425,11 @@ extern "C" {
  * @return
  *   F_none on success.
  *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ *   Errors (with error bit) from: f_memory_resize().
+ *   Errors (with error bit) from: f_string_dynamic_resize().
+ *
+ *   @see f_memory_resize()
+ *   @see f_string_dynamic_resize()
  */
 #ifndef _di_f_directory_statuss_adjust_
   extern f_status_t f_directory_statuss_adjust(const f_array_length_t length, f_directory_statuss_t * const statuss);
@@ -448,8 +451,11 @@ extern "C" {
  *   F_none on success.
  *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ *   Errors (with error bit) from: f_memory_resize().
+ *   Errors (with error bit) from: f_string_dynamic_resize().
+ *
+ *   @see f_memory_resize()
+ *   @see f_string_dynamic_resize()
  */
 #ifndef _di_f_directory_statuss_decimate_by_
   extern f_status_t f_directory_statuss_decimate_by(const f_array_length_t amount, f_directory_statuss_t * const statuss);
@@ -471,8 +477,11 @@ extern "C" {
  *   F_none on success.
  *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ *   Errors (with error bit) from: f_memory_resize().
+ *   Errors (with error bit) from: f_string_dynamic_resize().
+ *
+ *   @see f_memory_resize()
+ *   @see f_string_dynamic_resize()
  */
 #ifndef _di_f_directory_statuss_decrease_by_
   extern f_status_t f_directory_statuss_decrease_by(const f_array_length_t amount, f_directory_statuss_t * const statuss);
@@ -494,9 +503,11 @@ extern "C" {
  *   F_none on success.
  *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ *   Errors (with error bit) from: f_memory_resize().
+ *   Errors (with error bit) from: f_string_dynamic_resize().
+ *
+ *   @see f_memory_resize()
+ *   @see f_string_dynamic_resize()
  */
 #ifndef _di_f_directory_statuss_increase_
   extern f_status_t f_directory_statuss_increase(const f_array_length_t step, f_directory_statuss_t * const statuss);
@@ -518,9 +529,11 @@ extern "C" {
  *   F_none on success.
  *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- *   F_array_too_large (with error bit) if the new array length is too large.
+ *   Errors (with error bit) from: f_memory_resize().
+ *   Errors (with error bit) from: f_string_dynamic_resize().
+ *
+ *   @see f_memory_resize()
+ *   @see f_string_dynamic_resize()
  */
 #ifndef _di_f_directory_statuss_increase_by_
   extern f_status_t f_directory_statuss_increase_by(const f_array_length_t amount, f_directory_statuss_t * const statuss);
@@ -537,8 +550,11 @@ extern "C" {
  * @return
  *   F_none on success.
  *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ *   Errors (with error bit) from: f_memory_resize().
+ *   Errors (with error bit) from: f_string_dynamic_resize().
+ *
+ *   @see f_memory_resize()
+ *   @see f_string_dynamic_resize()
  */
 #ifndef _di_f_directory_statuss_resize_
   extern f_status_t f_directory_statuss_resize(const f_array_length_t length, f_directory_statuss_t * const statuss);
index 5c61c5ad8736596a239b70a6f8012c01d9b5c7d3..75fdb048fc59389b2d78b73512f85727e6d19e4b 100644 (file)
@@ -95,7 +95,8 @@ extern "C" {
  *
  * step_large: The allocation step to use for large buffers.
  * step_small: The allocation step to use for small buffers.
- * flag:       A 32-bit digit intended for provided flags that are defined by the function.
+ * flag:       A 64-bit digit intended for provided flags that are defined by the function.
+ * code:       A 64-bit digit intended for provided flags that are defined by the caller.
  * status:     The status used while processing (This should hold the error passed to the handle callback and should be updated as necessary).
  * handle:     A function to call on a specific error (allowing for the error to be handled before function returns). May be NULL.
  * interrupt:  A function to call for checking to see if an interrupt is to be called. May be NULL.
@@ -109,6 +110,7 @@ extern "C" {
     uint16_t step_small;
     f_status_t status;
     uint64_t flag;
+    uint64_t code;
 
     void (*handle)(void * const state, void * const internal);
     void (*interrupt)(void * const state, void * const internal);
@@ -128,13 +130,15 @@ extern "C" {
     0, \
     0, \
     0, \
+    0, \
   }
 
-  #define macro_f_state_t_initialize_1(step_large, step_small, status, flag, handle, interrupt, callbacks, custom, data) { \
+  #define macro_f_state_t_initialize_1(step_large, step_small, status, flag, code, handle, interrupt, callbacks, custom, data) { \
     step_large, \
     step_small, \
     status, \
     flag, \
+    code, \
     handle, \
     interrupt, \
     callbacks, \
@@ -147,6 +151,7 @@ extern "C" {
     state.step_small = 0; \
     state.status = F_none; \
     state.flag = 0; \
+    state.code = 0; \
     state.handle = 0; \
     state.interrupt = 0; \
     state.callbacks = 0; \
index ee72d497e3188a5350d6e6e18bd2f627496910be..1b3f1c05dd2ed5893ab3a2a1fc959bc769610204 100644 (file)
@@ -167,7 +167,7 @@ extern "C" {
       if (F_status_is_error(status)) return status;
     }
 
-    const f_state_t state = macro_f_state_t_initialize_1(control_allocation_large_d, control_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
+    const f_state_t state = macro_f_state_t_initialize_1(control_allocation_large_d, control_allocation_small_d, F_none, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
 
     f_string_static_t contents_array[main->parameters.remaining.used];
     f_string_statics_t contents = macro_f_string_statics_t_initialize(contents_array, 0, main->parameters.remaining.used);
@@ -318,7 +318,7 @@ extern "C" {
     }
 
     {
-      f_state_t state = macro_f_state_t_initialize_1(control_allocation_large_d, control_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
+      f_state_t state = macro_f_state_t_initialize_1(control_allocation_large_d, control_allocation_small_d, F_none, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
       f_string_range_t range_packet = macro_f_string_range_t_initialize2(data->cache.large.used);
 
       status = fll_fss_basic_list_read(data->cache.large, state, &range_packet, &data->cache.packet_objects, &data->cache.packet_contents, &data->cache.delimits, 0, 0);
index d0d470794fd361dfd8e4f0c6242686cc3d886f68..c314961a0ce172b4f062b60d970c4ca490dd2798 100644 (file)
@@ -95,7 +95,7 @@ extern "C" {
 
     {
       controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
-      f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+      f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
       f_string_range_t range = content_range;
 
       status = fll_fss_extended_read(cache->buffer_file, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
@@ -1577,7 +1577,7 @@ extern "C" {
     if (F_status_is_error_not(status)) {
       if (cache->buffer_file.used) {
         controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
-        f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+        f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
         f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_file.used);
 
         status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
@@ -1876,7 +1876,7 @@ extern "C" {
 
     {
       controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
-      f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+      f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
       f_string_range_t range = content_range;
 
       status = fll_fss_extended_read(cache->buffer_file, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
index cc2e2e9c6354984dd4b300d0a40365f02ae78e39..3e4ad2301563f431f5f6c2c95da738fd854aa788 100644 (file)
@@ -222,7 +222,7 @@ extern "C" {
     f_status_t status = F_none;
 
     controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
-    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
 
     f_array_length_t i = 0;
 
@@ -2360,7 +2360,7 @@ extern "C" {
 
     f_status_t status = F_none;
     controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
-    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
     f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_item.used);
     f_array_length_t last = 0;
 
@@ -3785,7 +3785,7 @@ extern "C" {
 
       if (cache->buffer_file.used) {
         controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
-        f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+        f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
         f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_file.used);
 
         status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
@@ -3951,7 +3951,7 @@ extern "C" {
     f_string_range_t range2 = f_string_range_t_initialize;
 
     controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
-    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
 
     status = fll_fss_extended_read(cache->buffer_item, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
 
index f09e682efe28c0dc61f6800e3bebf73d2e4b92de..8c3fee6fa4d2472896b4c3cab514af8423f1db5f 100644 (file)
@@ -172,6 +172,7 @@ extern "C" {
     f_string_dynamic_t destination_file = f_string_dynamic_t_initialize;
     f_string_dynamic_t destination_directory = f_string_dynamic_t_initialize;
     f_string_static_t buffer = f_string_static_t_initialize;
+    fake_local_t local = macro_fake_local_t_initialize_1(main, &failures, 0);
 
     if (main->program.message.verbosity != f_console_verbosity_quiet_e && main->program.message.verbosity != f_console_verbosity_error_e) {
       fll_print_format("%r%[Copying %Q.%]%r", main->program.message.to, f_string_eol_s, main->program.context.set.important, label, main->program.context.set.important, f_string_eol_s);
@@ -191,11 +192,12 @@ extern "C" {
 
     f_directory_recurse_copy_t recurse = f_directory_recurse_copy_t_initialize;
     recurse.verbose = &fake_print_verbose_recursive_copy;
-    recurse.state.custom = (void *) data;
-
-    //recurse.failures = &failures; // @fixme this now needs to be handled by a callback in recurse (recurse.state.handle)., maybe make this a callback on f_directory_recurse_copy_t?
+    recurse.state.custom = (void *) &local;
+    recurse.state.code = fake_state_code_local_e;
     recurse.mode = mode;
 
+    f_array_length_t j = 0;
+
     for (f_array_length_t i = 0; i < files.used; ++i) {
 
       if (fake_signal_check(main)) break;
@@ -232,16 +234,16 @@ extern "C" {
           break;
         }
 
+        // @todo replace fl_directory_copy() with fl_directory_do() because it has better error handling.
+        // @todo once this is done, then consider removing fl_directory_copy() entirely.
+        // @todo consider providing a copy/clone/move callback in FLL in place of fl_directory_copy() that can be passed to fl_directory_do().
         fl_directory_copy(path_source, destination_directory, &recurse);
 
         if (F_status_is_error(main->setting.state.status)) {
           if (main->program.error.verbosity >= f_console_verbosity_verbose_e) {
-            /* // @fixme
-            for (f_array_length_t j = 0; j < failures.used; ++j) {
-
+            for (j = 0; j < failures.used; ++j) {
               fake_print_error_build_operation_file(&main->program.error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
             } // for
-            */
 
             if (F_status_set_fine(main->setting.state.status) != F_failure) {
               fake_print_error(&main->program.error, macro_fake_f(fl_directory_copy));
@@ -337,6 +339,8 @@ extern "C" {
     f_string_dynamic_resize(0, &destination_file);
     f_string_dynamic_resize(0, &destination_directory);
 
+    f_directory_statuss_resize(0, &failures);
+
     fake_build_touch(data, file_stage);
   }
 #endif // _di_fake_build_copy_
index 38eb9560a7aee09cb2b1f6a72cd9c85afe06a881..4d17e0fb48c48ccd57b008fe9a6da02536dede2b 100644 (file)
@@ -136,7 +136,7 @@ extern "C" {
         f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
 
         // @todo make sure main->setting.state.custom = (void *) main->program;
-        //f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main->program, 0);
+        //f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main->program, 0);
 
         fll_fss_extended_read(buffer, &range, &objects, &contents, 0, 0, &delimits, 0, &main->setting.state);
 
index e59794a78b1575b5a31abe724067f3e2e0cd4ec4..d76cbc21b057c8fe495e02110bbb62a7f9958e9c 100644 (file)
@@ -381,6 +381,20 @@ extern "C" {
   }; // enum
 #endif // _di_fake_print_flag_e_
 
+/**
+ * Flags for the code property in the f_state_t structure.
+ *
+ * fake_state_code_*_e:
+ *   - none:  No flags set.
+ *   - local: A flag designating that the state.custom is in fake_local_t rather than fake_main_t.
+ */
+#ifndef _di_fake_state_code_e_
+  enum {
+    fake_state_code_none_e  = 0x0,
+    fake_state_code_local_e = 0x1,
+  }; // enum
+#endif // _di_fake_state_code_e_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index e155574fecd3abd40b5f3665dfdf1558434d6b5b..ce65a34453bd20343beb898f0a4b2f2a4e9625a7 100644 (file)
@@ -308,7 +308,36 @@ extern "C" {
       f_string_dynamic_t_initialize, \
       0, \
     }
-#endif // _di_fake_main_t_
+#endif // _di_fake_data_t_
+
+/**
+ * The program data for local operations so that custom data can be passed to functions.
+ *
+ * main:     The program and settings data.
+ * custom_1: Custom data that both the caller and the called function know to expect.
+ * custom_2: Custom data that both the caller and the called function know to expect.
+ */
+#ifndef _di_fake_local_t_
+  typedef struct {
+    fake_main_t *main;
+    void *custom_1;
+    void *custom_2;
+  } fake_local_t;
+
+  #define fake_local_t_initialize \
+    { \
+      0, \
+      0, \
+      0, \
+    }
+
+  #define macro_fake_local_t_initialize_1(main, custom_1, custom_2) \
+    { \
+      main, \
+      custom_1, \
+      custom_2, \
+    }
+#endif // _di_fake_local_t_
 
 /**
  * Build settings data.
index 631bf0e3db8c5895c4fe9407ae03a17cfe81b48c..917fad50c68230a3bbacb7d6548ff41b39365d0a 100644 (file)
@@ -195,7 +195,7 @@ extern "C" {
           }
 
           if (main->setting.state.status == F_child) break;
-          if (fake_signal_check(main)) break;
+          if (F_status_set_fine(main->setting.state.status) == F_interrupt || fake_signal_check(main)) break;
           if (F_status_is_error(main->setting.state.status)) break;
         } // for
       }
index f1eefe12762b3b45fd359f0cf13cd14579863b29..f9eba33232cb21036bec33a152f938c43f8e6d7b 100644 (file)
@@ -20,7 +20,9 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   data.setting.flag |= fake_main_flag_enable_static_e;
   data.setting.state.step_large = fake_allocation_large_d;
   data.setting.state.step_small = fake_allocation_small_d;
-  data.setting.state.custom = (void *) &data.program;
+  data.setting.state.custom = (void *) &data;
+  data.setting.state.code = fake_state_code_none_e;
+  data.setting.state.interrupt = &fake_signal_handler_callback;
 
   f_console_parameter_t parameters[] = fake_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
index c8c8f6ff3b3f30ff25d357ecee0e0961b8608b55..479edb7143526713ac0b1c9f4bf2baa408ee3699 100644 (file)
@@ -9,14 +9,7 @@ extern "C" {
 
     if (!data_make || !data_make->data || !data_make->main) return;
     if (F_status_is_error(data_make->main->setting.state.status)) return;
-
-    if (fll_program_standard_signal_received(&data_make->main->program)) {
-      fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received);
-
-      data_make->main->setting.state.status = F_status_set_error(F_interrupt);
-
-      return;
-    }
+    if (fake_signal_check(data_make->main)) return;
 
     data_make->fakefile.used = 0;
 
@@ -103,17 +96,7 @@ extern "C" {
 
         for (f_array_length_t i = 0; i < list_objects.used; ++i) {
 
-          if (!(i % fake_signal_check_short_d)) {
-            if (fll_program_standard_signal_received(&data_make->main->program)) {
-              fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received);
-
-              data_make->main->setting.state.status = F_status_set_error(F_interrupt);
-
-              break;
-            }
-
-            data_make->main->program.signal_check = 0;
-          }
+          if (fake_signal_check(data_make->main)) break;
 
           if (f_compare_dynamic_partial_string(fake_make_item_settings_s.string, data_make->main->buffer, fake_make_item_settings_s.used, list_objects.array[i]) == F_equal_to) {
             if (!missing_settings) {
index be49445e004346a00c4fdacb56c670c53a4f814f..363ac20084eaa756fb2076f1b2363905a8dd4d20 100644 (file)
@@ -91,7 +91,9 @@ extern "C" {
       return;
     }
 
-    fake_main_t * const main = (fake_main_t *) recurse->state.custom;
+    fake_main_t * const main = (recurse->state.code & fake_state_code_local_e)
+      ? ((fake_local_t *) recurse->state.custom)->main
+      : (fake_main_t *) recurse->state.custom;
 
     if (main->program.message.verbosity < f_console_verbosity_verbose_e) {
       recurse->state.status = F_output_not;
@@ -116,7 +118,9 @@ extern "C" {
       return;
     }
 
-    fake_main_t * const main = (fake_main_t *) recurse->state.custom;
+    fake_main_t * const main = (recurse->state.code & fake_state_code_local_e)
+      ? ((fake_local_t *) recurse->state.custom)->main
+      : (fake_main_t *) recurse->state.custom;
 
     if (main->program.message.verbosity < f_console_verbosity_verbose_e) {
       recurse->state.status = F_output_not;
@@ -141,7 +145,9 @@ extern "C" {
       return;
     }
 
-    fake_main_t * const main = (fake_main_t *) recurse->state.custom;
+    fake_main_t * const main = (recurse->state.code & fake_state_code_local_e)
+      ? ((fake_local_t *) recurse->state.custom)->main
+      : (fake_main_t *) recurse->state.custom;
 
     if (main->program.message.verbosity < f_console_verbosity_verbose_e) {
       recurse->state.status = F_output_not;
index a4011440a1d87f79d738ec00c08c47085cb006b4..57b4ddc99d202475d02e2f714de2b32aa2ee78e7 100644 (file)
@@ -108,6 +108,27 @@ extern "C" {
   }
 #endif // !defined(_di_fake_signal_handler_) && !defined(_di_thread_support_)
 
+#ifndef _di_fake_signal_handler_callback_
+  void fake_signal_handler_callback(void * const void_state, void * const void_internal) {
+
+    if (!void_state) return;
+
+    f_state_t * const state = (f_state_t *) void_state;
+
+    if (!state->custom) {
+      state->status = F_interrupt_not;
+
+      return;
+    }
+
+    fake_main_t * const main = (state->code & fake_state_code_local_e)
+      ? ((fake_local_t *) state->custom)->main
+      : (fake_main_t *) state->custom;
+
+    state->status = (fake_signal_check(main) == F_true) ? F_status_set_error(F_interrupt) : F_interrupt_not;
+  }
+#endif // _di_fake_signal_handler_callback_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a40c0dae058146604fc807abd4556c96d74d5ea7..21d9bea8b82d09dea447628ea1e9b2e308dd3afd 100644 (file)
@@ -79,6 +79,26 @@ extern "C" {
   extern void fake_signal_handler(fake_main_t * const main);
 #endif // !defined(_di_fake_signal_handler_) && !defined(_di_thread_support_)
 
+/**
+ * A callback intended to be assigned to the state.interrupt.
+ *
+ * @param state
+ *   The f_state_t data.
+ *
+ *   The state.custom must be fake_main_t, except for when the code has the bit fake_state_code_local_e.
+ *   When the fake_state_code_local_e bit is set, then the state.custum must be fake_local_t.
+ *
+ *   This alters state.status:
+ *     F_interrupt_not if not interrupted.
+ *
+ *     F_interrupt (with error bit) if interrupted.
+ * @param internal
+ *   Not used.
+ */
+#ifndef _di_fake_signal_handler_callback_
+  extern void fake_signal_handler_callback(void * const state, void * const internal);
+#endif // _di_fake_signal_handler_callback_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 204237f568ce301d343cf6ae1d948c7cf2802267..a3dce34a463ff4d74a9f6ac1687405846d2d1c82 100644 (file)
@@ -246,7 +246,7 @@ extern "C" {
 #ifndef _di_fss_basic_list_read_load_
   f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize_1(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, F_none, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index 2818718a126c73a8b669479e8745d0a1f4bcf7d2..475cd73469b71546f4c5499e4d88643dd345b25c 100644 (file)
@@ -223,7 +223,7 @@ extern "C" {
 #ifndef _di_fss_basic_read_load_
   f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize_1(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits.used = 0;
index 1929502e6e3084e4f70f11150d587c33352b1dc1..b09a6abd3381b4d63591a13d2a30a4ebd7a9fb9b 100644 (file)
@@ -245,7 +245,7 @@ extern "C" {
     f_status_t status = F_none;
 
     {
-      f_state_t state = macro_f_state_t_initialize_1(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0);
+      f_state_t state = macro_f_state_t_initialize_1(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0);
       f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
       objects_delimits->used = 0;
index b1866703e0fd4bd29da1ee0a0818f68b410d100b..bc458a9ef61c1d514a7b4cc4a956836874997b93 100644 (file)
@@ -245,7 +245,7 @@ extern "C" {
 #ifndef _di_fss_extended_list_read_load_
   f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize_1(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index 30a18a30d6cea9a7ef6da26daebeb79ab71973c0..1e2a2dae6450c0d569377462c778607c313aca67 100644 (file)
@@ -249,7 +249,7 @@ extern "C" {
 #ifndef _di_fss_extended_read_load_
   f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize_1(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index b7e6b63805b852779ac54dcba6e6e2abb4c70247..381a49bcff4dbac8da8d86b5291e6cbe7bccc4fe 100644 (file)
@@ -237,7 +237,7 @@ extern "C" {
 #ifndef _di_fss_payload_read_load_
   f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize_1(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;