]> Kevux Git Server - fll/commitdiff
Progress: Begin updating the programs again.
authorKevin Day <kevin@kevux.org>
Thu, 2 Mar 2023 03:59:51 +0000 (21:59 -0600)
committerKevin Day <kevin@kevux.org>
Thu, 2 Mar 2023 04:02:40 +0000 (22:02 -0600)
This focuses mostly on utf8.
Do some file restructuring.
Perform the new f_state_t and f_status_t related changes.

171 files changed:
build/stand_alone/utf8.settings
level_2/fll_execute/c/private-execute.c
level_2/fll_file/c/private-file.c
level_2/fll_fss/c/fss.c
level_3/byte_dump/c/byte_dump.c
level_3/byte_dump/c/byte_dump.h
level_3/byte_dump/c/common.c
level_3/byte_dump/c/common.h
level_3/byte_dump/c/main.c
level_3/byte_dump/c/print.c
level_3/byte_dump/c/print.h
level_3/control/c/common.c
level_3/control/c/common.h
level_3/control/c/control.c
level_3/control/c/main.c
level_3/control/c/print.c
level_3/control/c/print.h
level_3/controller/c/common.c
level_3/controller/c/common.h
level_3/controller/c/controller.c
level_3/controller/c/main.c
level_3/controller/c/print.c
level_3/controller/c/print.h
level_3/fake/c/main/build/print-error.h
level_3/fake/c/main/build/print-verbose.h
level_3/fake/c/main/build/print-warning.h
level_3/fake/c/main/build/print.h
level_3/fake/c/main/common.c
level_3/fake/c/main/common.h
level_3/fake/c/main/fake.c
level_3/fake/c/main/fake.h
level_3/fake/c/main/main.c
level_3/fake/c/main/make/print-error.h
level_3/fake/c/main/make/print-verbose.h
level_3/fake/c/main/make/print-warning.h
level_3/fake/c/main/make/print.h
level_3/fake/c/main/print-error.h
level_3/fake/c/main/print-verbose.h
level_3/fake/c/main/print-warning.h
level_3/fake/c/main/print.h
level_3/firewall/c/common.c
level_3/firewall/c/common.h
level_3/firewall/c/firewall.c
level_3/firewall/c/main.c
level_3/firewall/c/print.c
level_3/firewall/c/print.h
level_3/fss_basic_list_read/c/common.c
level_3/fss_basic_list_read/c/common.h
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_read/c/main.c
level_3/fss_basic_list_read/c/print.c
level_3/fss_basic_list_read/c/print.h
level_3/fss_basic_read/c/common.c
level_3/fss_basic_read/c/common.h
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/fss_basic_read.h
level_3/fss_basic_read/c/main.c
level_3/fss_basic_read/c/print.c
level_3/fss_basic_read/c/print.h
level_3/fss_embedded_list_read/c/common.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/fss_embedded_list_read.h
level_3/fss_embedded_list_read/c/main.c
level_3/fss_embedded_list_read/c/print.c
level_3/fss_embedded_list_read/c/print.h
level_3/fss_extended_list_read/c/common.c
level_3/fss_extended_list_read/c/common.h
level_3/fss_extended_list_read/c/fss_extended_list_read.c
level_3/fss_extended_list_read/c/fss_extended_list_read.h
level_3/fss_extended_list_read/c/main.c
level_3/fss_extended_list_read/c/print.c
level_3/fss_extended_list_read/c/print.h
level_3/fss_extended_read/c/common.c
level_3/fss_extended_read/c/common.h
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/main.c
level_3/fss_extended_read/c/print.c
level_3/fss_extended_read/c/print.h
level_3/fss_identify/c/common.c
level_3/fss_identify/c/common.h
level_3/fss_identify/c/fss_identify.c
level_3/fss_identify/c/fss_identify.h
level_3/fss_identify/c/main.c
level_3/fss_identify/c/print.c
level_3/fss_identify/c/print.h
level_3/fss_payload_read/c/common.c
level_3/fss_payload_read/c/common.h
level_3/fss_payload_read/c/fss_payload_read.c
level_3/fss_payload_read/c/main.c
level_3/fss_payload_read/c/print.c
level_3/fss_payload_read/c/print.h
level_3/fss_write/c/basic/fss_write.c
level_3/fss_write/c/basic/fss_write.h
level_3/fss_write/c/basic/print.h
level_3/fss_write/c/basic_list/fss_write.c
level_3/fss_write/c/basic_list/fss_write.h
level_3/fss_write/c/basic_list/main.c
level_3/fss_write/c/basic_list/print.h
level_3/fss_write/c/embedded_list/fss_write.c
level_3/fss_write/c/embedded_list/fss_write.h
level_3/fss_write/c/embedded_list/main.c
level_3/fss_write/c/embedded_list/print.h
level_3/fss_write/c/extended/fss_write.c
level_3/fss_write/c/extended/fss_write.h
level_3/fss_write/c/extended/main.c
level_3/fss_write/c/extended/print.h
level_3/fss_write/c/extended_list/fss_write.c
level_3/fss_write/c/extended_list/fss_write.h
level_3/fss_write/c/extended_list/main.c
level_3/fss_write/c/extended_list/print.h
level_3/fss_write/c/main/common.c
level_3/fss_write/c/main/common.h
level_3/fss_write/c/main/fss_write.c
level_3/fss_write/c/main/fss_write.h
level_3/fss_write/c/main/main-print.h
level_3/fss_write/c/main/main.c
level_3/fss_write/c/main/main.h
level_3/fss_write/c/main/print.c
level_3/fss_write/c/main/print.h
level_3/fss_write/c/payload/fss_write.c
level_3/fss_write/c/payload/fss_write.h
level_3/fss_write/c/payload/main.c
level_3/fss_write/c/payload/print.h
level_3/iki_read/c/main/common.c
level_3/iki_read/c/main/common.h
level_3/iki_read/c/main/iki_read.c
level_3/iki_read/c/main/iki_read.h
level_3/iki_read/c/main/main.c
level_3/iki_read/c/main/print.c
level_3/iki_read/c/main/print.h
level_3/iki_read/c/main/private-print.h
level_3/iki_read/c/main/private-read.c
level_3/iki_read/c/main/private-read.h
level_3/iki_write/c/main/common.c
level_3/iki_write/c/main/common.h
level_3/iki_write/c/main/iki_write.c
level_3/iki_write/c/main/iki_write.h
level_3/iki_write/c/main/main.c
level_3/iki_write/c/main/print.c
level_3/iki_write/c/main/print.h
level_3/iki_write/c/main/private-write.c
level_3/iki_write/c/main/private-write.h
level_3/status_code/c/fss/main.c
level_3/status_code/c/fss/print.h
level_3/status_code/c/main/common-type.h
level_3/status_code/c/main/common.c
level_3/status_code/c/main/common.h
level_3/status_code/c/main/main.c
level_3/status_code/c/main/print.c
level_3/status_code/c/main/print.h
level_3/status_code/c/main/private-status_code.h
level_3/status_code/c/main/status_code.c
level_3/status_code/c/main/status_code.h
level_3/utf8/c/main/bytesequence.c [new file with mode: 0644]
level_3/utf8/c/main/bytesequence.h [moved from level_3/utf8/c/main/private-utf8_bytesequence.h with 58% similarity]
level_3/utf8/c/main/codepoint.c [moved from level_3/utf8/c/main/private-utf8_codepoint.c with 60% similarity]
level_3/utf8/c/main/codepoint.h [moved from level_3/utf8/c/main/private-utf8_codepoint.h with 55% similarity]
level_3/utf8/c/main/common-type.h
level_3/utf8/c/main/common.c
level_3/utf8/c/main/common.h
level_3/utf8/c/main/main.c
level_3/utf8/c/main/print.c
level_3/utf8/c/main/print.h
level_3/utf8/c/main/private-common.h
level_3/utf8/c/main/private-utf8_bytesequence.c [deleted file]
level_3/utf8/c/main/process.c [moved from level_3/utf8/c/main/private-utf8.c with 66% similarity]
level_3/utf8/c/main/process.h [moved from level_3/utf8/c/main/private-utf8.h with 65% similarity]
level_3/utf8/c/main/utf8.c
level_3/utf8/c/main/utf8.h
level_3/utf8/data/build/settings

index 6cfabbb2a4051e6e02674d91c9857c37c2ad5e92..ebd860f64e6635e83e1023ce26df54d4724ffec6 100644 (file)
@@ -47,8 +47,7 @@ build_sources_program fll/level_2/error.c fll/level_2/error/common.c fll/level_2
 build_sources_program fll/level_2/print.c
 build_sources_program fll/level_2/program.c fll/level_2/program/common.c fll/level_2/program/print.c fll/level_2/private-program.c
 
-build_sources_program program/utf8/common.c program/utf8/print.c program/utf8/utf8.c
-build_sources_program program/utf8/private-common.c program/utf8/private-utf8.c program/utf8/private-utf8_bytesequence.c program/utf8/private-utf8_codepoint.c
+build_sources_program program/utf8/common.c program/utf8/bytesequence.c program/utf8/codepoint.c program/utf8/print.c program/utf8/process.c program/utf8/utf8.c
 
 build_sources_program program/utf8/main.c
 
index 50dbe65ffc1ed7ed17ce658b1769eedea8717c3b..58556d34961b88d9bf51f8a983c53616f6a87a51 100644 (file)
@@ -85,7 +85,6 @@ extern "C" {
 
     if (as.id_groups) {
       if (setgroups(as.id_groups->used, (const gid_t *) as.id_groups->array) == -1) {
-
         if (parameter && parameter->option & FL_execute_parameter_option_exit_d) {
           exit(F_execute_group);
         }
@@ -197,9 +196,7 @@ extern "C" {
     int descriptors[2] = { -1, -1 };
 
     if (as) {
-      if (pipe(descriptors) == -1) {
-        return F_status_set_error(F_pipe);
-      }
+      if (pipe(descriptors) == -1) return F_status_set_error(F_pipe);
     }
 
     const pid_t id_process = fork();
@@ -232,9 +229,7 @@ extern "C" {
           // Close the write pipe for the parent when finished writing.
           close(descriptors[1]);
 
-          if (F_status_is_error(status)) {
-            return status;
-          }
+          if (F_status_is_error(status)) return status;
         }
       }
 
@@ -253,9 +248,7 @@ extern "C" {
 
       // This must explicitly check for 0 (as opposed to checking (!result)).
       if (result != 0) {
-        if (WIFEXITED(*((int *) result))) {
-          return F_none;
-        }
+        if (WIFEXITED(*((int *) result))) return F_none;
 
         return F_status_set_error(F_failure);
       }
@@ -378,9 +371,7 @@ extern "C" {
 
     int descriptors[2] = { -1, -1 };
 
-    if (pipe(descriptors) == -1) {
-      return F_status_set_error(F_pipe);
-    }
+    if (pipe(descriptors) == -1) return F_status_set_error(F_pipe);
 
     const pid_t id_process = fork();
 
@@ -421,9 +412,7 @@ extern "C" {
         // Close the write pipe for the parent when finished writing.
         close(descriptors[1]);
 
-        if (F_status_is_error(status)) {
-          return status;
-        }
+        if (F_status_is_error(status)) return status;
       }
 
       if (parameter && parameter->option & FL_execute_parameter_option_return_d) {
@@ -441,9 +430,7 @@ extern "C" {
 
       // This must explicitly check for 0 (as opposed to checking (!result)).
       if (result != 0) {
-        if (WIFEXITED(*((int *) result))) {
-          return F_none;
-        }
+        if (WIFEXITED(*((int *) result))) return F_none;
 
         return F_status_set_error(F_failure);
       }
index f459d4fa42a43942788c627ae4e1913c31253fb7..06d7cb158fe59755d61f6630d5cadcce64a6fa64 100644 (file)
@@ -13,9 +13,7 @@ extern "C" {
     status = f_directory_is(path);
     if (F_status_is_error(status)) return status;
 
-    if (status == F_false) {
-      return f_file_mode_set(path, mode);
-    }
+    if (status == F_false) return f_file_mode_set(path, mode);
 
     f_directory_listing_t listing = f_directory_listing_t_initialize;
 
@@ -114,9 +112,7 @@ extern "C" {
     status = f_directory_is(path);
     if (F_status_is_error(status)) return status;
 
-    if (status == F_false) {
-      return f_file_role_change(path, uid, gid, dereference);
-    }
+    if (status == F_false) return f_file_role_change(path, uid, gid, dereference);
 
     f_directory_listing_t listing = f_directory_listing_t_initialize;
 
index d2f2b1f8cf74fadb401588e40aaff07637644d23..3d8727408cd6a0d217f600258c4ea83f828dc41c 100644 (file)
@@ -15,9 +15,7 @@ extern "C" {
       if (buffer.string[range->start]) break;
     }
 
-    if (range->start > range->stop) {
-      return F_data_not;
-    }
+    if (range->start > range->stop) return F_data_not;
 
     // The first character must be a '#'.
     if (buffer.string[range->start] != f_fss_pound_s.string[0]) {
@@ -78,13 +76,7 @@ extern "C" {
 
     f_status_t status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1, F_false);
 
-    if (F_status_is_error(status)) {
-      if (F_status_set_fine(status) == F_maybe) {
-        return F_status_set_error(F_complete_not_utf);
-      }
-
-      return status;
-    }
+    if (F_status_is_error(status)) return (F_status_set_fine(status) == F_maybe) ? F_status_set_error(F_complete_not_utf) : status;
 
     if (status == F_false) {
 
@@ -164,21 +156,9 @@ extern "C" {
     } while (range->start <= range->stop);
 
     if (ids) {
-      if (ids->used) {
-        if (found_fss) {
-          return F_found;
-        }
-
-        return F_maybe;
-      }
-    }
-    else if (id.used) {
-      if (found_fss) {
-        return F_found;
-      }
-
-      return F_maybe;
+      if (ids->used) return found_fss ? F_found : F_maybe;
     }
+    else if (id.used) return found_fss ? F_found : F_maybe;
 
     return F_found_not;
   }
@@ -649,6 +629,7 @@ extern "C" {
 
           if (status == F_equal_to) {
             matched = F_true;
+
             break;
           }
         } // for
index 5470f4a48a05fbbb6bdf627710c8003af7b97bb3..e0cdc1caa228fe396f0f80591edb96e528732df1 100644 (file)
@@ -11,8 +11,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index 336abe7ee37db8f4c1dfe70abf47b158f7a978d5..8dc9794f9bdd3e549fad6ea3808512c09c226824 100644 (file)
@@ -88,7 +88,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -113,19 +113,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_byte_dump_setting_load_
-  extern void byte_dump_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, byte_dump_setting_t * const setting, f_state_t * const state);
+  extern void byte_dump_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, byte_dump_setting_t * const setting);
 #endif // _di_byte_dump_setting_load_
 
 /**
@@ -137,7 +135,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 3cdc82737f32d32abff9587094f02bd93060dc1e..bacafe1ae65179a1ba7e03d94e76d197b3ddc1cc 100644 (file)
@@ -77,18 +77,17 @@ extern "C" {
 #endif // _di_byte_dump_setting_delete_
 
 #ifndef _di_byte_dump_setting_load_
-  void byte_dump_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, byte_dump_setting_t * const setting) {
+  void byte_dump_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, byte_dump_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       byte_dump_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       byte_dump_print_line_last_locked(setting, main->error);
 
       return;
@@ -106,11 +105,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           byte_dump_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           byte_dump_print_line_last_locked(setting, main->error);
 
           return;
@@ -139,11 +138,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           byte_dump_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           byte_dump_print_line_last_locked(setting, main->error);
 
           return;
index 1bdc0a825cc2e801f4cee602f6364bf52ef6947a..2022ea0c8af1c01e9dd934fd83f35a38b9a09a36 100644 (file)
@@ -410,12 +410,47 @@ extern "C" {
   #define byte_dump_setting_t_initialize \
     { \
       byte_dump_main_flag_none_e, \
-      f_state_initialize_t, \
+      f_state_t_initialize, \
       f_string_static_t_initialize, \
       f_string_static_t_initialize, \
     }
 #endif // _di_byte_dump_setting_t_
 
+/**
+ * Perform the standard program setting load process.
+ *
+ * This prints error messages as appropriate.
+ *
+ * If either main or setting is NULL, then this immediately returns without doing anything.
+ *
+ * @param arguments
+ *   The parameters passed to the process (often referred to as command line arguments).
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *
+ *     Errors (with error bit) from: f_console_parameter_process().
+ *     Errors (with error bit) from: f_file_stream_open().
+ *     Errors (with error bit) from: f_string_dynamics_resize().
+ *     Errors (with error bit) from: fll_program_parameter_process_context().
+ *     Errors (with error bit) from: fll_program_parameter_process_verbosity().
+ * @param state
+ *   A state for providing flags and handling interrupts during long running operations.
+ *
+ * @see f_console_parameter_process()
+ * @see f_file_stream_open()
+ * @see f_string_dynamics_resize()
+ * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_verbosity()
+ */
+#ifndef _di_byte_dump_setting_load_
+  extern void byte_dump_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, byte_dump_setting_t * const setting);
+#endif // _di_byte_dump_setting_load_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 2106bbaf2ba266960dc4bffb1fd83fa5f31d695f..d32ca7f7f9787eb14c47dba4500c586c330a79d9 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    byte_dump_setting_load(arguments, state, &data, &setting);
+    byte_dump_setting_load(arguments, &data, &setting);
   }
 
   byte_dump_main(&data, &setting);
index 5fedf6ed133d922b95d28647c34fdf9f70232dfb..f4ea201015a12c7b0a0bedc928d9a276582f2a33 100644 (file)
@@ -81,7 +81,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & byte_dump_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & byte_dump_main_flag_file_to_e) return F_output_not;
     }
@@ -98,7 +98,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & byte_dump_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & byte_dump_main_flag_file_to_e) return F_output_not;
     }
@@ -115,7 +115,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & byte_dump_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & byte_dump_main_flag_file_to_e) return F_output_not;
     }
@@ -132,7 +132,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & byte_dump_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & byte_dump_main_flag_file_to_e) return F_output_not;
     }
index 444511506edf05f81902fda2b52abb49dfd1d48b..c62bd3ad18f4e276b6c21f5888f9760e47b2acc1 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param output
  *   The file to print to.
  * @param context
@@ -43,7 +43,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -65,7 +65,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -87,7 +87,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -109,7 +109,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index 0b50b0159c98de70b82cc1816855c583459a46b8..60fdcee7e35422271213b97c5cefaf15317b5d2d 100644 (file)
@@ -180,18 +180,17 @@ extern "C" {
 #endif // _di_control_setting_delete_
 
 #ifndef _di_control_setting_load_
-  void control_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, control_setting_t * const setting) {
+  void control_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, control_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       control_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       control_print_line_last_locked(setting, main->error);
 
       return;
@@ -209,11 +208,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           control_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           control_print_line_last_locked(setting, main->error);
 
           return;
@@ -242,11 +241,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           control_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           control_print_line_last_locked(setting, main->error);
 
           return;
index cc3fa400b6b0c5e2d3642cb5e1428c9947deabf9..4bd5d6422b93b378e567b18543d0ca0c197570fc 100644 (file)
@@ -313,7 +313,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -338,19 +338,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_control_setting_load_
-  extern void control_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, control_setting_t * const setting, f_state_t * const state);
+  extern void control_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, control_setting_t * const setting);
 #endif // _di_control_setting_load_
 
 /**
@@ -362,7 +360,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index dfd066ec1833f46e3ba4137e3f6a8b0d9365273b..2f30e3a5f7813b5326ef5de4108d83aeca2a3fe6 100644 (file)
@@ -12,8 +12,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index be3036332aa3338216d3a0aebb21b2fb45fd00a9..910a490b61b86143638acab8c571bc2f30a4a654 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    control_setting_load(arguments, state, &data, &setting);
+    control_setting_load(arguments, &data, &setting);
   }
 
   control_main(&data, &setting);
index a870f204e736070396b7a670f149853114f1b58b..ed9fac9c1652ee0d19e452c3e70e9a402738590a 100644 (file)
@@ -54,7 +54,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & control_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & control_main_flag_file_to_e) return F_output_not;
     }
@@ -71,7 +71,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & control_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & control_main_flag_file_to_e) return F_output_not;
     }
@@ -88,7 +88,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & control_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & control_main_flag_file_to_e) return F_output_not;
     }
@@ -105,7 +105,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & control_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & control_main_flag_file_to_e) return F_output_not;
     }
index 0eafb809bcfabfc729de0c90421dc803a5b74f5b..1ddaab797c0e47111105f76d3579bac2e6960155 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -40,7 +40,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -62,7 +62,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -84,7 +84,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -106,7 +106,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index a73cf7b144e96c6c2f9dcbd83decb3d5a3801aea..3553ee1461e56c0afb44581ab86d3143d82e1825 100644 (file)
@@ -612,18 +612,17 @@ extern "C" {
 #endif // _di_controller_setting_delete_
 
 #ifndef _di_controller_setting_load_
-  void controller_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, controller_setting_t * const setting) {
+  void controller_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, controller_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       controller_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       controller_print_line_last_locked(setting, main->error);
 
       return;
@@ -641,11 +640,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           controller_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           controller_print_line_last_locked(setting, main->error);
 
           return;
@@ -674,11 +673,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           controller_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           controller_print_line_last_locked(setting, main->error);
 
           return;
index a194952209edbe780d495616d532ac4253ad7b18..86df47a14c1948b44975e6b9f3d42b75822d586b 100644 (file)
@@ -706,7 +706,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -731,19 +731,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_controller_setting_load_
-  extern void controller_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, controller_setting_t * const setting, f_state_t * const state);
+  extern void controller_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, controller_setting_t * const setting);
 #endif // _di_controller_setting_load_
 
 /**
@@ -755,7 +753,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index fe604eb5d73b184211ffdd4bb57ad7f22f344396..cf3db5ec73e28c61a604d736b6bca744f21c504b 100644 (file)
@@ -17,8 +17,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index 5451809b047821297faa64a9b1c08ad37824bddb..9a81235143bbd8383aecd5b5f4ed0daa8a95d1f5 100644 (file)
@@ -44,9 +44,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    controller_setting_load(arguments, state, &data, &setting);
+    controller_setting_load(arguments, &data, &setting);
   }
 
   controller_main(&data, &setting);
index 2c9f80a1ea69d13c66dca6aad74af53cff351722..fb5a7c5a5311d7a2bf562191602d93bbf46cbc40 100644 (file)
@@ -57,7 +57,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & controller_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & controller_main_flag_file_to_e) return F_output_not;
     }
@@ -74,7 +74,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & controller_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & controller_main_flag_file_to_e) return F_output_not;
     }
@@ -91,7 +91,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & controller_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & controller_main_flag_file_to_e) return F_output_not;
     }
@@ -108,7 +108,7 @@ extern "C" {
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & controller_main_flag_verify_e) return;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & controller_main_flag_file_to_e) return F_output_not;
     }
index 32a5be240b99228fd1bc1dc7aef5b8208759b884..07057341478949f17d4f2c36fd0c3b8e5aa08042 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -40,7 +40,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -62,7 +62,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -84,7 +84,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -106,7 +106,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index cebac956411cfe065f35ffafb936cdc16a650493..01627010791682e8b0034a5163474a992e4474c8 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -44,7 +44,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -66,7 +66,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param name
@@ -91,7 +91,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param mode
@@ -115,7 +115,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
index 377d947eea7e3583aa5c5623fe0181b5f9afdebe..da2266c5e4930832c5d8fc18e82294ee2c2cad4f 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param directory
index a879d950f466c9e0a173972157421905341d2346..18e06dadd1e30785106c0a17ceb978571a2ca623 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param symbol_1
@@ -54,7 +54,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param name
@@ -84,7 +84,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param name_1
@@ -110,7 +110,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param name
@@ -140,7 +140,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param name_1
@@ -166,7 +166,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param name
index 16b654d72ed4e552d2405da6c6b469670c6300f9..bb166dd1d1f6216ffa7bb8efba7268e10650a0c7 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -42,7 +42,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -62,7 +62,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -82,7 +82,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -102,7 +102,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -122,7 +122,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -142,7 +142,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -162,7 +162,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param from
@@ -186,7 +186,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index f6aa6d5543b2d1dcb041e790c258ef50555bb256..bb9a99f9ae81a4fff1ed0fea764e583f364b2b77 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #endif // _di_fake_setting_delete_
 
 #ifndef _di_fake_setting_load_
-  void fake_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fake_setting_t * const setting) {
+  void fake_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fake_setting_t * const setting) {
 
     if (!main || !setting) return;
 
@@ -42,12 +42,11 @@ extern "C" {
       data.main = main;
       data.setting = setting;
 
-      // Load parameters.
-      setting->status = f_console_parameter_process(arguments, &main->parameters, state, (void *) &data);
+      f_console_parameter_process(arguments, &main->parameters, &setting->state, (void *) &data);
     }
 
-    if (F_status_is_error(setting->status)) {
-      fake_print_error(setting, main->error, setting->status, macro_fake_f(f_console_parameter_process));
+    if (F_status_is_error(setting->state.status)) {
+      fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_console_parameter_process));
 
       return;
     }
@@ -64,10 +63,10 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
-          fake_print_error(setting, main->error, setting->status, macro_fake_f(fll_program_parameter_process_context));
+        if (F_status_is_error(setting->state.status)) {
+          fake_print_error(setting, main->error, setting->state.status, macro_fake_f(fll_program_parameter_process_context));
 
           return;
         }
@@ -95,10 +94,10 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
-          fake_print_error(setting, main->error, setting->status, macro_fake_f(fll_program_parameter_process_verbosity));
+        if (F_status_is_error(setting->state.status)) {
+          fake_print_error(setting, main->error, setting->state.status, macro_fake_f(fll_program_parameter_process_verbosity));
 
           return;
         }
@@ -243,7 +242,7 @@ extern "C" {
         for (i = 0; i < 9; ++i) {
 
           if ((main->parameters.array[parameters[i]].result & f_console_result_found_e) && !(main->parameters.array[parameters[i]].result & f_console_result_value_e)) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             if (main->error.verbosity > f_console_verbosity_quiet_e) {
               fake_print_line_first_locked(setting, main->error);
@@ -261,20 +260,20 @@ extern "C" {
               if (parameters[i] == fake_parameter_process_e) {
                 for (j = 0; j < main->parameters.arguments.array[index].used; ++j) {
 
-                  setting->status = f_utf_is_word_dash_plus(main->parameters.arguments.array[index].string + j, main->parameters.arguments.array[index].used - j, F_false);
+                  setting->state.status = f_utf_is_word_dash_plus(main->parameters.arguments.array[index].string + j, main->parameters.arguments.array[index].used - j, F_false);
 
                   // @todo fix this to print an error about the actual invalid character so that it can be investigated.
 
-                  if (F_status_is_error(setting->status)) {
-                    if (fake_print_error_fallback(setting, main->error, setting->status, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
+                  if (F_status_is_error(setting->state.status)) {
+                    if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
                       fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]);
                     }
 
                     return;
                   }
 
-                  if (setting->status == F_false) {
-                    setting->status = F_status_set_error(F_parameter);
+                  if (setting->state.status == F_false) {
+                    setting->state.status = F_status_set_error(F_parameter);
 
                     fake_print_error_parameter_not_word(setting, main->error, f_console_symbol_long_normal_s, names[i], main->parameters.arguments.array[index]);
 
@@ -284,13 +283,13 @@ extern "C" {
               }
 
               if (cleanups[i]) {
-                setting->status = f_path_directory_cleanup(main->parameters.arguments.array[index], variable[i]);
+                setting->state.status = f_path_directory_cleanup(main->parameters.arguments.array[index], variable[i]);
 
-                if (F_status_is_error(setting->status)) {
+                if (F_status_is_error(setting->state.status)) {
                   if (main->error.verbosity > f_console_verbosity_quiet_e) {
                     fake_print_line_first_locked(setting, main->error);
 
-                    if (fake_print_error_fallback(setting, main->error, setting->status, macro_fake_f(f_path_directory_cleanup)) == F_false) {
+                    if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(f_path_directory_cleanup)) == F_false) {
                       fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]);
                     }
                   }
@@ -302,10 +301,10 @@ extern "C" {
 
                 // De-allocate memory before replacing it with a statically allocated string.
                 if (variable[i]->size) {
-                  setting->status = f_string_dynamic_resize(0, variable[i]);
+                  setting->state.status = f_string_dynamic_resize(0, variable[i]);
 
-                  if (F_status_is_error(setting->status)) {
-                    fake_print_error(setting, main->error, setting->status, macro_fake_f(f_string_dynamic_resize));
+                  if (F_status_is_error(setting->state.status)) {
+                    fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_resize));
 
                     return;
                   }
@@ -317,24 +316,24 @@ extern "C" {
               }
 
               if (!variable[i]->used) {
-                setting->status = F_status_set_error(F_parameter);
+                setting->state.status = F_status_set_error(F_parameter);
 
                 fake_print_error_parameter_not_empty(setting, main->error, f_console_symbol_long_normal_s, names[i], main->parameters.arguments.array[index]);
 
                 return;
               }
 
-              setting->status = F_none;
+              setting->state.status = F_none;
             }
           }
           else {
 
             // De-allocate memory before replacing it with a statically allocated string.
             if (variable[i]->size) {
-              setting->status = f_string_dynamic_resize(0, variable[i]);
+              setting->state.status = f_string_dynamic_resize(0, variable[i]);
 
-              if (F_status_is_error(setting->status)) {
-                fake_print_error(setting, main->error, setting->status, macro_fake_f(f_string_dynamic_resize));
+              if (F_status_is_error(setting->state.status)) {
+                fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_resize));
 
                 return;
               }
@@ -368,7 +367,7 @@ extern "C" {
         for (i = 0; i < 2; ++i) {
 
           if ((main->parameters.array[parameters[i]].result & f_console_result_found_e) && !(main->parameters.array[parameters[i]].result & f_console_result_value_e)) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             if (main->error.verbosity > f_console_verbosity_quiet_e) {
               fake_print_line_first_locked(setting, main->error);
@@ -380,13 +379,13 @@ extern "C" {
           }
 
           if (main->parameters.array[parameters[i]].result & f_console_result_value_e) {
-            setting->status = fll_program_parameter_additional_rip(main->parameters.arguments.array, main->parameters.array[parameters[i]].values, variable[i]);
+            setting->state.status = fll_program_parameter_additional_rip(main->parameters.arguments.array, main->parameters.array[parameters[i]].values, variable[i]);
 
-            if (F_status_is_error(setting->status)) {
+            if (F_status_is_error(setting->state.status)) {
               if (main->error.verbosity > f_console_verbosity_quiet_e) {
                 fake_print_line_first_locked(setting, main->error);
 
-                if (fake_print_error_fallback(setting, main->error, setting->status, macro_fake_f(fll_program_parameter_additional_rip)) == F_false) {
+                if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(fll_program_parameter_additional_rip)) == F_false) {
                   fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]);
                 }
               }
@@ -399,20 +398,20 @@ extern "C" {
 
                 width_max = main->parameters.arguments.array[i].used - j;
 
-                setting->status = f_utf_is_word_dash_plus(main->parameters.arguments.array[i].string + j, width_max, F_false);
+                setting->state.status = f_utf_is_word_dash_plus(main->parameters.arguments.array[i].string + j, width_max, F_false);
 
-                if (F_status_is_error(setting->status)) {
+                if (F_status_is_error(setting->state.status)) {
                   // @todo fix this to print an error about the actual invalid character so that it can be investigated.
 
-                  if (fake_print_error_fallback(setting, main->error, setting->status, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
+                  if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
                     fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]);
                   }
 
                   return;
                 }
 
-                if (setting->status == F_false) {
-                  setting->status = F_status_set_error(F_parameter);
+                if (setting->state.status == F_false) {
+                  setting->state.status = F_status_set_error(F_parameter);
 
                   fake_print_error_parameter_not_word(setting, main->error, f_console_symbol_long_normal_s, names[i], main->parameters.arguments.array[i]);
 
@@ -432,10 +431,10 @@ extern "C" {
       setting->flag |= fake_main_flag_operation_make_e;
       setting->flag -= setting->flag & fake_main_flag_operation_e;
 
-      setting->status = f_uint8s_increase_by(1, &setting->operations);
+      setting->state.status = f_uint8s_increase_by(1, &setting->operations);
 
-      if (F_status_is_error(setting->status)) {
-        fake_print_error(setting, main->error, setting->status, macro_fake_f(f_uint8s_increase_by));
+      if (F_status_is_error(setting->state.status)) {
+        fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_uint8s_increase_by));
 
         return;
       }
index 20470d727764086aa952f3ed3e79fad840e8f5de..10da11dd4de2c7e2923072da83706f225b922b2d 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -47,19 +47,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_fake_setting_load_
-  extern void fake_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fake_setting_t * const setting, f_state_t * const state);
+  extern void fake_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fake_setting_t * const setting);
 #endif // _di_fake_setting_load_
 
 /**
@@ -95,7 +93,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 8bc3e6659036e33137f5c0514773a5cf911a27f2..eebab5c768d4d2f49604da8e5e6448147ce15dc1 100644 (file)
@@ -16,13 +16,13 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fake_print_line_last_locked(setting, main->error);
 
       return;
     }
 
-    setting->status = F_none;
+    setting->state.status = F_none;
 
     if (setting->flag & fake_main_flag_help_e) {
       fake_print_help(setting, main->message);
@@ -43,7 +43,7 @@ extern "C" {
     }
 
     if ((setting->flag & fake_main_flag_operation_build_e) && (setting->flag & fake_main_flag_operation_make_e)) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       fake_print_error_parameter_operation_not_with(setting, main->error, fake_other_operation_build_s, fake_other_operation_make_s);
 
@@ -54,9 +54,9 @@ extern "C" {
     data.main = main;
     data.setting = setting;
 
-    setting->status = fake_path_generate(&data);
+    setting->state.status = fake_path_generate(&data);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fake_data_delete(&data);
 
       return;
@@ -65,15 +65,15 @@ extern "C" {
     if ((main->pipe & fll_program_data_pipe_input_e) && !(data.setting->flag & fake_main_flag_operation_e)) {
       data.file_data_build_fakefile.used = 0;
 
-      setting->status = f_string_dynamic_append(f_string_ascii_minus_s, &data.file_data_build_fakefile);
+      setting->state.status = f_string_dynamic_append(f_string_ascii_minus_s, &data.file_data_build_fakefile);
 
-      if (F_status_is_error(setting->status)) {
-        fake_print_error(setting, main->error, setting->status, macro_fake_f(f_string_dynamic_append));
+      if (F_status_is_error(setting->state.status)) {
+        fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_append));
       }
       else {
         setting->fakefile.used = 0;
 
-        setting->status = f_string_dynamic_append(f_string_ascii_minus_s, &setting->fakefile);
+        setting->state.status = f_string_dynamic_append(f_string_ascii_minus_s, &setting->fakefile);
       }
     }
 
@@ -95,25 +95,25 @@ extern "C" {
             if (has_clean) {
               data.operation = setting->operations.array[i];
 
-              setting->status = fake_validate_parameter_paths(&data);
+              setting->state.status = fake_validate_parameter_paths(&data);
 
-              if (F_status_is_error_not(setting->status) && !(main->pipe & fll_program_data_pipe_input_e)) {
-                setting->status = f_file_is(
+              if (F_status_is_error_not(setting->state.status) && !(main->pipe & fll_program_data_pipe_input_e)) {
+                setting->state.status = f_file_is(
                   setting->operations.array[i] == fake_operation_build_e
                     ? data.file_data_build_settings
                     : data.file_data_build_fakefile,
                   F_file_type_regular_d, F_false
                 );
 
-                if (setting->status == F_false) {
-                  setting->status = F_status_set_error(F_file_not);
+                if (setting->state.status == F_false) {
+                  setting->state.status = F_status_set_error(F_file_not);
                 }
 
-                if (F_status_is_error(setting->status)) {
+                if (F_status_is_error(setting->state.status)) {
                   fake_print_error_file(
                     setting,
                     main->error,
-                    F_status_set_fine(setting->status),
+                    F_status_set_fine(setting->state.status),
                     macro_fake_f(f_file_is),
                     setting->operations.array[i] == fake_operation_build_e
                       ? data.file_data_build_settings
@@ -132,7 +132,7 @@ extern "C" {
             if (fll_program_standard_signal_received(main)) {
               fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-              setting->status = F_status_set_error(F_interrupt);
+              setting->state.status = F_status_set_error(F_interrupt);
 
               break;
             }
@@ -151,45 +151,45 @@ extern "C" {
 
           if (data.operation == fake_operation_build_e) {
             if (check_paths) {
-              setting->status = fake_validate_parameter_paths(&data);
+              setting->state.status = fake_validate_parameter_paths(&data);
               check_paths = F_false;
             }
 
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = fake_build_operate(&data, 0, main->pipe & fll_program_data_pipe_input_e);
+            if (F_status_is_error_not(setting->state.status)) {
+              setting->state.status = fake_build_operate(&data, 0, main->pipe & fll_program_data_pipe_input_e);
             }
           }
           else if (data.operation == fake_operation_clean_e) {
-            setting->status = fake_clean_operate(&data);
+            setting->state.status = fake_clean_operate(&data);
 
             // Reset in case next operation needs files.
             check_paths = F_true;
           }
           else if (data.operation == fake_operation_make_e) {
             if (check_paths) {
-              setting->status = fake_validate_parameter_paths(&data);
+              setting->state.status = fake_validate_parameter_paths(&data);
               check_paths = F_false;
             }
 
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = fake_make_operate(&data);
-              if (setting->status == F_child) break;
+            if (F_status_is_error_not(setting->state.status)) {
+              setting->state.status = fake_make_operate(&data);
+              if (setting->state.status == F_child) break;
             }
           }
           else if (data.operation == fake_operation_skeleton_e) {
-            setting->status = fake_skeleton_operate(&data);
+            setting->state.status = fake_skeleton_operate(&data);
 
             // Skeleton is supposed to guarantee these.
             check_paths = F_false;
           }
 
-          if (setting->status == F_child) break;
+          if (setting->state.status == F_child) break;
 
           if (!((++main->signal_check) % fake_signal_check_short_d)) {
             if (fll_program_standard_signal_received(main)) {
               fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-              setting->status = F_status_set_error(F_interrupt);
+              setting->state.status = F_status_set_error(F_interrupt);
 
               break;
             }
@@ -197,13 +197,13 @@ extern "C" {
             main->signal_check = 0;
           }
 
-          if (F_status_is_error(setting->status)) break;
+          if (F_status_is_error(setting->state.status)) break;
         } // for
       }
     }
 
-    if (F_status_is_error(setting->status)) {
-      if (F_status_set_fine(setting->status) == F_interrupt) {
+    if (F_status_is_error(setting->state.status)) {
+      if (F_status_set_fine(setting->state.status) == F_interrupt) {
         fake_print_operation_cancelled(setting, main->message, data.operation);
       }
       else {
@@ -212,12 +212,12 @@ extern "C" {
 
       fake_print_line_last_locked(setting, main->error);
     }
-    else if (setting->status != F_child) {
-      if (F_status_is_error_not(setting->status)) {
+    else if (setting->state.status != F_child) {
+      if (F_status_is_error_not(setting->state.status)) {
         fake_print_operation_all_complete(setting, main->message);
       }
 
-      if (setting->status != F_interrupt) {
+      if (setting->state.status != F_interrupt) {
         fake_print_line_last_locked(setting, main->message);
       }
     }
index a14503e5343073e1432dce335b69c4c9355f67be..fe70009eda59b6e0b7fea5a36687f7889b09f212 100644 (file)
@@ -130,7 +130,7 @@ extern "C" {
  *
  *   This is used by the main thread and should not be modified within individual threads.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_child if this is a child process returning.
  *
index f7070c0bba9ed556c627114547dc0de6f1b4c117..358c1bdf10de4c1a5412a91f452ce531129deb7e 100644 (file)
@@ -24,9 +24,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    fake_setting_load(arguments, state, &data, &setting);
+    fake_setting_load(arguments, &data, &setting);
   }
 
   fake_main(&data, &setting);
index dc16a6331ca0dac158d1e6b56177cfd6bb97d7b0..f80ac6cf1b93a3b07a99272af90b525918c45d26 100644 (file)
@@ -25,7 +25,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param name
@@ -46,7 +46,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param action
@@ -69,7 +69,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param name
@@ -90,7 +90,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param fakefile
@@ -113,7 +113,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -132,7 +132,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param content
@@ -155,7 +155,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -174,7 +174,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param type
@@ -197,7 +197,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param action
@@ -218,7 +218,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param message
@@ -239,7 +239,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -258,7 +258,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -277,7 +277,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -296,7 +296,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param operation
@@ -317,7 +317,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param buffer
  *   The buffer containing the range to use.
  * @param range
@@ -338,7 +338,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param name
@@ -359,7 +359,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param number
@@ -384,7 +384,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -403,7 +403,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param return_code
@@ -424,7 +424,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param program
@@ -445,7 +445,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param name
@@ -466,7 +466,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -485,7 +485,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param number
@@ -506,7 +506,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param type
index e79cfcd782fa293e99cb271b814f8f1a6b430fd3..80d2e02861abcdc37ea59eb9414582eeb69520ce 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param arguments
@@ -45,7 +45,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param clone
@@ -71,7 +71,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param variable
@@ -92,7 +92,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param path
@@ -113,7 +113,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param arguments
@@ -135,7 +135,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param is_directory
@@ -159,7 +159,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param program
@@ -182,7 +182,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param fail
@@ -203,7 +203,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param path
@@ -226,7 +226,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param path
@@ -247,7 +247,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param what
@@ -274,7 +274,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param source
@@ -297,7 +297,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param path
index b46b7e56e18b313e779ee1e9ce7876a6c3671709..f14299c2fb50735e620a0b77abe916801fa9655e 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param path
@@ -46,7 +46,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param name
@@ -67,7 +67,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param name
@@ -88,7 +88,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param fakefile
@@ -109,7 +109,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param file
@@ -130,7 +130,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param fakefile
@@ -157,7 +157,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param fakefile
@@ -186,7 +186,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param fakefile
@@ -209,7 +209,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param fakefile
index e1c1389af81250895d9eef5ddb5a7fed76417394..c89ad5ff2e2cb9e245207ec26773d2cf42553be9 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param fakefile
@@ -44,7 +44,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param buffer
index 9de04aa215d77e0a713e91964be6a4b5ace7c002..fdd22e8c80bd7b902d5c00545b0c4133e5290d7b 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param status
@@ -51,7 +51,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param index
@@ -73,7 +73,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param status
@@ -115,7 +115,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param before
@@ -153,7 +153,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param operation
@@ -180,7 +180,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -202,7 +202,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param operation
@@ -228,7 +228,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param script
@@ -250,7 +250,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param status
@@ -278,7 +278,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param status
  *   The status to use.
  *   This is provided, ignoring setting.status, for thread-safety reasons.
@@ -309,7 +309,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -331,7 +331,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param status
@@ -365,7 +365,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param status
  *   The status to use.
  *   This is provided, ignoring setting.status, for thread-safety reasons.
@@ -396,7 +396,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param status
@@ -434,7 +434,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param status
@@ -468,7 +468,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param group
@@ -490,7 +490,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param mode
@@ -512,7 +512,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param number
@@ -737,7 +737,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param symbol
@@ -763,7 +763,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param symbol
@@ -793,7 +793,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param operation_1
@@ -867,7 +867,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param user
index e838d707a0dc655177613f99eb073d99a5631dbc..44d7d66d382d91c3f172368630d90fe1034398d4 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param source
@@ -46,7 +46,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param source
@@ -70,7 +70,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -92,7 +92,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -114,7 +114,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -136,7 +136,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -158,7 +158,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -180,7 +180,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -202,7 +202,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
@@ -224,7 +224,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param source
index b2d6a9fb9bb9c0349e0d0bda75a460e61667d536..459b3b8b00c4e87de035b1dd88bf47d854d59c99 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param path
index 25f452a2fe04daae42dcfa0a91fc624168b35e4a..c82cb5de71374b46b4494949926a5d3cd327d8b0 100644 (file)
@@ -26,7 +26,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param message
@@ -52,7 +52,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param before
@@ -86,7 +86,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param before
@@ -120,7 +120,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param before
@@ -157,7 +157,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param before
@@ -212,7 +212,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param before
@@ -246,7 +246,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param before
@@ -280,7 +280,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -300,7 +300,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -322,7 +322,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param message
@@ -346,7 +346,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -370,7 +370,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -392,7 +392,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -414,7 +414,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -432,7 +432,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -450,7 +450,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param operation
@@ -474,7 +474,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param message
@@ -494,7 +494,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param message
@@ -516,7 +516,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param before
@@ -544,7 +544,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type fake_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  * @param before
index aff8ddb1ff9116e398960e11b8df570ce78bd173..cb02aae81d5a67b1c0a3318e4e4dad0ccc460717 100644 (file)
@@ -119,12 +119,11 @@ extern "C" {
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(state, arguments, &main->parameters, 0);
+    setting->state.status = f_console_parameter_process(state, arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       firewall_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       firewall_print_line_last_locked(setting, main->error);
 
       return;
@@ -142,11 +141,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           firewall_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           firewall_print_line_last_locked(setting, main->error);
 
           return;
@@ -175,11 +174,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           firewall_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           firewall_print_line_last_locked(setting, main->error);
 
           return;
index cc7dfdd5fb04c65dfc79a2fe7a21a030676a4f74..e7e351b47a64ed5ce0c1602d0eac402f3c89cfdf 100644 (file)
@@ -475,7 +475,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -500,19 +500,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_firewall_setting_load_
-  extern void firewall_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, firewall_setting_t * const setting, f_state_t * const state);
+  extern void firewall_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, firewall_setting_t * const setting);
 #endif // _di_firewall_setting_load_
 
 /**
@@ -524,7 +522,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index a7e9c4487c137a7e43107495c9addb486895f1c0..916da214e95b8f7c22ef130b0293fa0be5071e98 100644 (file)
@@ -19,8 +19,7 @@ extern "C" {
 
     main->child = 0;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index 2d41d0d16ec7fe92865c0cc3ccaadc18909154e4..09a0c725bfe0472bdc86c2e246c429f13bc33625 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    firewall_setting_load(arguments, state, &data, &setting);
+    firewall_setting_load(arguments, &data, &setting);
   }
 
   firewall_main(&data, &setting);
index e8c6ac77ab510873c2a31ea7b1ae45a491f87caa..cce2c5a090ab89a8dd8dbd4ed81cbf2d04fb5f5e 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -57,7 +57,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -72,7 +72,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -87,7 +87,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
index 042b5d294da6fdd7748046c1ef6bc7377ff4134b..10b85d8c9e198a73ccb9aa8f1d203833e89cbc6a 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -39,7 +39,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -61,7 +61,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -83,7 +83,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index b5fa042194a45a19d5f2e2a743766b2b33b66afd..fbb4899699ada6370b27a7f3a1ddba86b5d85a81 100644 (file)
@@ -71,18 +71,17 @@ extern "C" {
 #endif // _di_fss_basic_list_read_setting_delete_
 
 #ifndef _di_fss_basic_list_read_setting_load_
-  void fss_basic_list_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_basic_list_read_setting_t * const setting) {
+  void fss_basic_list_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_basic_list_read_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_basic_list_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       fss_basic_list_read_print_line_last_locked(setting, main->error);
 
       return;
@@ -100,11 +99,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_basic_list_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           fss_basic_list_read_print_line_last_locked(setting, main->error);
 
           return;
@@ -133,11 +132,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_basic_list_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           fss_basic_list_read_print_line_last_locked(setting, main->error);
 
           return;
index 11761f34b1c12297b8f34ff5088a82ecc924eee5..dfb9ade7a7989daf9c360b4a68f509d330010f6e 100644 (file)
@@ -375,7 +375,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -400,19 +400,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_fss_basic_list_read_setting_load_
-  extern void fss_basic_list_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_basic_list_read_setting_t * const setting, f_state_t * const state);
+  extern void fss_basic_list_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_basic_list_read_setting_t * const setting);
 #endif // _di_fss_basic_list_read_setting_load_
 
 /**
@@ -424,7 +422,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 6e59419861562d6b04f62e38d99f34616004d4fe..901ae71db41832863de7e04b23615cb1ba1aeb26 100644 (file)
@@ -12,8 +12,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index 342a8a1ffc8a0040e7ab5a10a2aa083315e6103e..f4f6dbcf582af6570efda7904d4f073b55fbb41d 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    fss_basic_list_read_setting_load(arguments, state, &data, &setting);
+    fss_basic_list_read_setting_load(arguments, &data, &setting);
   }
 
   fss_basic_list_read_main(&data, &setting);
index 636c9d350cbc8d2d20e59b96d46e639be5559f3f..3058f512ede43b31692db09dd403d5cb002b0cd0 100644 (file)
@@ -120,7 +120,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -135,7 +135,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -150,7 +150,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -165,7 +165,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
index f9c92fd131560322df2f65fc9072756bba72ae94..391d06c4e11e59a143b2b19a28aabcf83bb8cdf7 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -39,7 +39,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -61,7 +61,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -83,7 +83,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index b48b7c66ef8f012c4c4a89b6bd4c40860b2b27bb..aacee2841b6d6f735500090875091990401464ea 100644 (file)
@@ -70,18 +70,17 @@ extern "C" {
 #endif // _di_fss_basic_read_setting_delete_
 
 #ifndef _di_fss_basic_read_setting_load_
-  void fss_basic_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_basic_read_setting_t * const setting) {
+  void fss_basic_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_basic_read_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_basic_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       fss_basic_read_print_line_last_locked(setting, main->error);
 
       return;
@@ -99,11 +98,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_basic_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           fss_basic_read_print_line_last_locked(setting, main->error);
 
           return;
@@ -132,11 +131,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_basic_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           fss_basic_read_print_line_last_locked(setting, main->error);
 
           return;
index 7002d4febf7604fc46c09f68af7f70d91a0dbbce..f74d5ecbf855df7ffff4c0c5b8e0bf41f3d65709 100644 (file)
@@ -373,7 +373,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -398,19 +398,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_fss_basic_read_setting_load_
-  extern void fss_basic_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_basic_read_setting_t * const setting, f_state_t * const state);
+  extern void fss_basic_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_basic_read_setting_t * const setting);
 #endif // _di_fss_basic_read_setting_load_
 
 /**
@@ -422,7 +420,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 648b439722bc9b729468c1494e0ef6ea18626960..ce5c2224160e89b1b81f53ceb322ca8db73c6daf 100644 (file)
@@ -12,8 +12,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index eb30e3ece852780604a2689429afc9c4ce8404db..7ce305da72b608b5de85e923e34f00801f2878ab 100644 (file)
@@ -71,7 +71,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
index 829bea2d9315c7258c0cf7ac6e2c1f27156aa039..33b3e5880efa98791ffd17d5423fc9b4b50366e9 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    fss_basic_read_setting_load(arguments, state, &data, &setting);
+    fss_basic_read_setting_load(arguments, &data, &setting);
   }
 
   fss_basic_read_main(&data, &setting);
index 08105c4317e5472b1fed5d33c9d79639c34cff4d..706cd36eceacc1875e90d85af79aa6063d445322 100644 (file)
@@ -120,7 +120,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -135,7 +135,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -150,7 +150,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -165,7 +165,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
index 10014679dfec294765b4ad8c088c3d74ab60412c..eb2920e9aa2ae0367b811610471efb273251de82 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -39,7 +39,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -61,7 +61,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -83,7 +83,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index 0e254f6a2d8f5f89289dd484be39a75a7c4d1ead..0fc4351052f5da20420b150dc22669cdea81717a 100644 (file)
@@ -69,18 +69,17 @@ extern "C" {
 #endif // _di_fss_embedded_list_read_setting_delete_
 
 #ifndef _di_fss_embedded_list_read_setting_load_
-  void fss_embedded_list_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_embedded_list_read_setting_t * const setting) {
+  void fss_embedded_list_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_embedded_list_read_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_embedded_list_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       fss_embedded_list_read_print_line_last_locked(setting, main->error);
 
       return;
@@ -98,11 +97,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_embedded_list_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           fss_embedded_list_read_print_line_last_locked(setting, main->error);
 
           return;
@@ -131,11 +130,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_embedded_list_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           fss_embedded_list_read_print_line_last_locked(setting, main->error);
 
           return;
index 2b767ee95fb7920ae2392bc0a8a3a87702b31ed8..4784a6e31c004fa47884e6ba250dab480e297e4b 100644 (file)
@@ -356,7 +356,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -381,19 +381,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_fss_embedded_list_read_setting_load_
-  extern void fss_embedded_list_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_embedded_list_read_setting_t * const setting, f_state_t * const state);
+  extern void fss_embedded_list_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_embedded_list_read_setting_t * const setting);
 #endif // _di_fss_embedded_list_read_setting_load_
 
 /**
@@ -405,7 +403,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 78235591af78062cfaee4bd3c2d629ce0c452c1f..f7015aa2f0dee5df001ea3ff554316444c6a10ca 100644 (file)
@@ -12,8 +12,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index d203715c2a9e6c45f7bf39a193fb262898a8db14..8d59c0cec1be163a915d00634889b9a095ddf82c 100644 (file)
@@ -71,7 +71,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
index a35b5aab079800542cd539dffece7c02778bad34..db1288bc6c72a006de3ad58aaafa2ef6934962d5 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    fss_embedded_list_read_setting_load(arguments, state, &data, &setting);
+    fss_embedded_list_read_setting_load(arguments, &data, &setting);
   }
 
   fss_embedded_list_read_main(&data, &setting);
index 4ecb7e34f85db981e262ea7ef75f50b36bdb9b8f..d8d3f4d8ecc0c3aed6bb3670ac8112fa6abc133f 100644 (file)
@@ -119,7 +119,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -134,7 +134,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -149,7 +149,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -164,7 +164,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
index cc6a0add4412a0b6951e1dc828932c6886278024..88280b5b4f11244cad0a7a42147478b06f24b04c 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -39,7 +39,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -61,7 +61,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -83,7 +83,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index a0245985930fe6ee8a9d9e9161684cd1fd1c72e8..1daf721ca7bcaefa4ecc305605acff830a0c1611 100644 (file)
@@ -77,18 +77,17 @@ extern "C" {
 #endif // _di_fss_extended_list_read_setting_delete_
 
 #ifndef _di_fss_extended_list_read_setting_load_
-  void fss_extended_list_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_extended_list_read_setting_t * const setting) {
+  void fss_extended_list_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_extended_list_read_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_extended_list_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       fss_extended_list_read_print_line_last_locked(setting, main->error);
 
       return;
@@ -106,11 +105,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_extended_list_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           fss_extended_list_read_print_line_last_locked(setting, main->error);
 
           return;
@@ -139,11 +138,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_extended_list_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           fss_extended_list_read_print_line_last_locked(setting, main->error);
 
           return;
index 4cf95d3c2feb89957f4c748b904d5707558a24dd..2a237d959c7de518538047af65ef80a94f891e0e 100644 (file)
@@ -390,7 +390,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -410,14 +410,12 @@ extern "C" {
  *
  * @param arguments
  *   The parameters passed to the process (often referred to as command line arguments).
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  * @param main
  *   The main program data.
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
@@ -427,7 +425,7 @@ extern "C" {
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_fss_extended_list_read_setting_load_
-  extern void fss_extended_list_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_extended_list_read_setting_t * const setting);
+  extern void fss_extended_list_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_extended_list_read_setting_t * const setting);
 #endif // _di_fss_extended_list_read_setting_load_
 
 /**
@@ -439,7 +437,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index e570dd7965e4142bcba8ee590c1aad7921b37ae6..777871f9764c8473cb44e6aebe225091c8408322 100644 (file)
@@ -12,8 +12,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index e77afb930dd30d52c8aaa2f8ff65f45640121ccd..b0fb05eed4c424283183a69cea345bf52dab6900 100644 (file)
@@ -71,7 +71,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
index 1c384e7edccdf10a31aefd6b6eec624b3574a098..aff8ca90eabba275e3f91963768e55b5b95dd727 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    fss_extended_list_read_setting_load(arguments, state, &data, &setting);
+    fss_extended_list_read_setting_load(arguments, &data, &setting);
   }
 
   fss_extended_list_read_main(&data, &setting);
index f50a50cf54afacc1c5ae21c2f856f57987aa5aee..4e0f81ca3ea2b1a3412685c18a717e1709493bad 100644 (file)
@@ -120,7 +120,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -135,7 +135,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -150,7 +150,7 @@ extern "C" {
 
     if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
-    if (!F_status_is_error(setting->status)) {
+    if (!F_status_is_error(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
       if (setting->flag & (fss_extended_list_read_main_flag_verify_e | fss_extended_list_read_main_flag_file_to_e)) return F_output_not;
     }
@@ -166,7 +166,7 @@ extern "C" {
 
     if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
-    if (!F_status_is_error(setting->status)) {
+    if (!F_status_is_error(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
       if (setting->flag & (fss_extended_list_read_main_flag_verify_e | fss_extended_list_read_main_flag_file_to_e)) return F_output_not;
     }
index 8293e4b264df0d9e846fc2b7404263772f9c532f..3fdc8a5315a4e523c3547a2b20fa3c87128da80a 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -39,7 +39,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -61,7 +61,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -83,7 +83,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index e8ad3440d920f1df6c633a9da92b19d022e8586c..82679db033961b1f86258c4f15b946ff103ed010 100644 (file)
@@ -70,18 +70,17 @@ extern "C" {
 #endif // _di_fss_extended_read_setting_delete_
 
 #ifndef _di_fss_extended_read_setting_load_
-  void fss_extended_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_extended_read_setting_t * const setting) {
+  void fss_extended_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_extended_read_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_extended_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       fss_extended_read_print_line_last_locked(setting, main->error);
 
       return;
@@ -99,11 +98,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_extended_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           fss_extended_read_print_line_last_locked(setting, main->error);
 
           return;
@@ -132,11 +131,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_extended_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           fss_extended_read_print_line_last_locked(setting, main->error);
 
           return;
index 633d64d4a16a18130af336c859ef5d328311c2d6..7ed7d3513d89ea865c5b27a9e620fcd90e7bada3 100644 (file)
@@ -372,7 +372,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -392,14 +392,12 @@ extern "C" {
  *
  * @param arguments
  *   The parameters passed to the process (often referred to as command line arguments).
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  * @param main
  *   The main program data.
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
@@ -409,7 +407,7 @@ extern "C" {
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_fss_extended_read_setting_load_
-  extern void fss_extended_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_extended_read_setting_t * const setting);
+  extern void fss_extended_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_extended_read_setting_t * const setting);
 #endif // _di_fss_extended_read_setting_load_
 
 /**
@@ -421,7 +419,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index c670eb01373a79e228ec234b0bdeb9b9c1c32e76..356e26f0c46f18a12f7841c0ff4f6e542e4d560c 100644 (file)
@@ -12,8 +12,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index 50d567974888c3262e46da9f28b61cec220f3b21..5998ee6159a304f8cdb61297632ea1268a656083 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    fss_extended_read_setting_load(arguments, state, &data, &setting);
+    fss_extended_read_setting_load(arguments, &data, &setting);
   }
 
   fss_extended_read_main(&data, &setting);
index f998c49b9f80da2b1be6aaf3d3b1f81fe64960a0..3e2b9718f7b47b479dc7c232c96af1e6abf1e363 100644 (file)
@@ -120,7 +120,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -135,7 +135,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -150,7 +150,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (fss_extended_read_main_flag_verify_e | fss_extended_read_main_flag_file_to_e)) return F_output_not;
     }
@@ -166,7 +166,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (fss_extended_read_main_flag_verify_e | fss_extended_read_main_flag_file_to_e)) return F_output_not;
     }
index e325aa33050c84753abb723ce518dfe298dc7cae..e63322822d2af9fa78aa0897d473745f2575b4d6 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -39,7 +39,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -61,7 +61,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -83,7 +83,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index f133f1ba724a0614e093c052e56fa56fa050c50f..6578bb8c4bdfc4bac720a7890a51a444aad9e4f7 100644 (file)
@@ -37,18 +37,17 @@ extern "C" {
 #endif // _di_fss_identify_setting_delete_
 
 #ifndef _di_fss_identify_setting_load_
-  void fss_identify_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_identify_setting_t * const setting, f_state_t * const state) {
+  void fss_identify_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_identify_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_identify_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       fss_identify_print_line_last_locked(setting, main->error);
 
       return;
@@ -66,11 +65,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_identify_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           fss_identify_print_line_last_locked(setting, main->error);
 
           return;
@@ -99,11 +98,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_identify_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           fss_identify_print_line_last_locked(setting, main->error);
 
           return;
index 3badc662bbb694cb4d7f2c2921cc51f54c03523c..599739a28811c2ba2fc05b190a03655636213512 100644 (file)
@@ -222,7 +222,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -242,14 +242,12 @@ extern "C" {
  *
  * @param arguments
  *   The parameters passed to the process (often referred to as command line arguments).
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  * @param main
  *   The main program data.
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
@@ -259,7 +257,7 @@ extern "C" {
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_fss_identify_setting_load_
-  extern void fss_identify_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_identify_setting_t * const setting);
+  extern void fss_identify_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_identify_setting_t * const setting);
 #endif // _di_fss_identify_setting_load_
 
 /**
@@ -271,7 +269,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 868aaf9e3628b644e2aeece477ac65d07ed7d5ff..051b14a734993048256bc0635bd9577372d85930 100644 (file)
@@ -11,8 +11,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index a30d43c06c73d6193edbecf9f0d4f980039e9f6b..1d846bcacc782028b539e4943d1e683d1227281d 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
index 2017cd2fcd96c98e98bfce89d7d3cdb1223696df..5ef29a147a6da842ee4adc02355a4cfdcf986b4a 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    fss_identify_setting_load(arguments, state, &data, &setting);
+    fss_identify_setting_load(arguments, &data, &setting);
   }
 
   fss_identify_main(&data, &setting);
index c3c062e3d46791c9ac9f99ad3e98058a34bd8b1c..f98abc19c62ca7df81d4381bb186bdff0834e0aa 100644 (file)
@@ -61,7 +61,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -76,7 +76,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -91,7 +91,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (fss_identify_main_flag_verify_e | fss_identify_main_flag_file_to_e)) return F_output_not;
     }
@@ -107,7 +107,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (fss_identify_main_flag_verify_e | fss_identify_main_flag_file_to_e)) return F_output_not;
     }
index aa748e14839915423ad45a97318b233b97ea79b6..34be83b002767e225e2d2ecd1022ffb4271d857c 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -39,7 +39,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -61,7 +61,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -83,7 +83,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index a94cb20f146d138a3914ecd3f500a6b9328387c6..753d519b57681eda0555c0b4b6a9a5ad7f38e124 100644 (file)
@@ -71,18 +71,17 @@ extern "C" {
 #endif // _di_fss_payload_read_setting_delete_
 
 #ifndef _di_fss_payload_read_setting_load_
-  void fss_payload_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, fss_payload_read_setting_t * const setting) {
+  void fss_payload_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_payload_read_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(state, arguments, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_payload_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
+      fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
       fss_payload_read_print_line_last_locked(setting, main->error);
 
       return;
@@ -100,11 +99,11 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_payload_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
           fss_payload_read_print_line_last_locked(setting, main->error);
 
           return;
@@ -133,11 +132,11 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_payload_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
           fss_payload_read_print_line_last_locked(setting, main->error);
 
           return;
index 8aefedbe277afe398611214d2729fe13bb00eb71..6aa5de45e0b5beeee214c2d091f9a0b4e069110f 100644 (file)
@@ -379,7 +379,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -404,19 +404,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_fss_payload_read_setting_load_
-  extern void fss_payload_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_payload_read_setting_t * const setting, f_state_t * const state);
+  extern void fss_payload_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_payload_read_setting_t * const setting);
 #endif // _di_fss_payload_read_setting_load_
 
 /**
@@ -428,7 +426,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 2bd62d112209f49f05115682f33b93327251d9c8..9fac94122223a80b737241dcf09d3beec12fd50f 100644 (file)
@@ -12,8 +12,7 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters, 0);
+    status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
     if (F_status_is_error(status)) return;
 
     {
index ee2685c7d39273192e9fcc4567b458e1d765bafe..1fa6db4cd899c20704e45bc64c25782b48989863 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    fss_payload_read_setting_load(arguments, state, &data, &setting);
+    fss_payload_read_setting_load(arguments, &data, &setting);
   }
 
   fss_payload_read_main(&data, &setting);
index c1b482829159a0fa06a383e05813ba5b3712d5b0..37766fbab2c4946ba4cc52127ef034f6eec18543 100644 (file)
@@ -130,7 +130,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -145,7 +145,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -160,7 +160,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (fss_payload_read_main_flag_verify_e | fss_payload_read_main_flag_file_to_e)) return F_output_not;
     }
@@ -176,7 +176,7 @@ extern "C" {
 
     if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (fss_payload_read_main_flag_verify_e | fss_payload_read_main_flag_file_to_e)) return F_output_not;
     }
index a0d81015ba848c6a8d3fc7d4ab4175f2a752d148..d98cdae6e769f3e88e129b4c23a94f6b591f7ded 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -39,7 +39,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -61,7 +61,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -83,7 +83,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index 270e2e0798d21a19da3d5b848323714c33722e34..e60e6275bad445d11d27f01a6450077975d92c86 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
-      setting->status = fl_fss_basic_content_write(
+      setting->state.status = fl_fss_basic_content_write(
         *setting->content,
         (setting->flag & fss_write_flag_partial_e)
           ? f_fss_complete_partial_e
@@ -23,8 +23,8 @@ extern "C" {
         setting->state
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -32,7 +32,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_basic_content_write));
 
         return;
@@ -41,9 +41,9 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_content_end_e) {
-        setting->status = f_string_dynamic_append(f_fss_basic_close_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_basic_close_s, &setting->buffer);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
@@ -68,7 +68,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->status = fl_fss_basic_object_write(
+      setting->state.status = fl_fss_basic_object_write(
         *setting->object,
         setting->quote.used
           ? setting->quote.string[0]
@@ -85,8 +85,8 @@ extern "C" {
         &setting->buffer
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -94,7 +94,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_basic_object_write));
 
         return;
@@ -103,9 +103,9 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_object_open_e) {
-        setting->status = f_string_dynamic_append(f_fss_basic_open_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_basic_open_s, &setting->buffer);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
index afcffa5b00223bb09b66b88e15a2276f92c9d968..baa2cdc83f6c6802321dd30ee2883d20ec5f514f 100644 (file)
@@ -83,7 +83,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 491dc415d9e18cb24f4a34243481566d7f3bfa63..cd80df2fc5475fbc779a8c0a192de2469656b349 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
index 3ef6b0054159701d7db634de7f76b4a712b46148..44fb4155fb98d9a1a0b9339e3d28ef06c94289bd 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
-      setting->status = fl_fss_basic_list_content_write(
+      setting->state.status = fl_fss_basic_list_content_write(
         *setting->content,
         (setting->flag & fss_write_flag_partial_e)
           ? f_fss_complete_partial_e
@@ -26,8 +26,8 @@ extern "C" {
         &setting->buffer
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -35,7 +35,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_basic_list_content_write));
 
         return;
@@ -44,9 +44,9 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_content_end_e) {
-        setting->status = f_string_dynamic_append(f_fss_basic_list_close_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &setting->buffer);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
@@ -71,7 +71,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->status = fl_fss_basic_list_object_write(
+      setting->state.status = fl_fss_basic_list_object_write(
         *setting->object,
         (setting->flag & fss_write_flag_partial_e)
           ? (setting->flag & fss_write_flag_trim_e)
@@ -85,8 +85,8 @@ extern "C" {
         &setting->buffer
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -94,7 +94,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_basic_list_object_write));
 
         return;
@@ -103,13 +103,13 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_object_open_e) {
-        setting->status = f_string_dynamic_append(f_fss_basic_list_open_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_basic_list_open_s, &setting->buffer);
 
-        if (F_status_is_error_not(setting->status)) {
-          setting->status = f_string_dynamic_append(f_fss_basic_list_open_end_s, &setting->buffer);
+        if (F_status_is_error_not(setting->state.status)) {
+          setting->state.status = f_string_dynamic_append(f_fss_basic_list_open_end_s, &setting->buffer);
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
index 5279d07ae84b482ffa9328e91955b0bbb8d780c6..0776a1bec424a1cc471318377a2112d88353e02f 100644 (file)
@@ -84,7 +84,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index e8c38b710911b6ed42f97cb034effefddf75336d..9b44e607b54ff67e74575ac3a8b9b5c038357e4a 100644 (file)
@@ -28,7 +28,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
     fss_write_setting_load(arguments, state, &data, &setting, 0);
   }
index 6c939795ea9c69907bad337b6217035f52e76760..7d7c5d3b05a0199be948b71f101c962c3ad6ec5e 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
index ea90288e919e44387ef6e9399db00c25088aef9c..81dc2baae72166de992b985e607ba9acf615b3b2 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
-      setting->status = fl_fss_embedded_list_content_write(
+      setting->state.status = fl_fss_embedded_list_content_write(
         *setting->content,
         (setting->flag & fss_write_flag_partial_e)
           ? f_fss_complete_partial_e
@@ -27,8 +27,8 @@ extern "C" {
         &setting->buffer
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -36,7 +36,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_embedded_list_content_write));
 
         return;
@@ -45,13 +45,13 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_content_end_e) {
-        setting->status = f_string_dynamic_append(f_fss_embedded_list_close_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_embedded_list_close_s, &setting->buffer);
 
-        if (F_status_is_error_not(setting->status)) {
-          setting->status = f_string_dynamic_append(f_fss_embedded_list_close_end_s, &setting->buffer);
+        if (F_status_is_error_not(setting->state.status)) {
+          setting->state.status = f_string_dynamic_append(f_fss_embedded_list_close_end_s, &setting->buffer);
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
@@ -76,7 +76,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->status = fl_fss_embedded_list_object_write(
+      setting->state.status = fl_fss_embedded_list_object_write(
         *setting->object,
         (setting->flag & fss_write_flag_partial_e)
           ? (setting->flag & fss_write_flag_trim_e)
@@ -90,8 +90,8 @@ extern "C" {
         &setting->buffer
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -99,7 +99,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_embedded_list_object_write));
 
         return;
@@ -108,13 +108,13 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_object_open_e) {
-        setting->status = f_string_dynamic_append(f_fss_embedded_list_open_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_embedded_list_open_s, &setting->buffer);
 
-        if (F_status_is_error_not(setting->status)) {
-          setting->status = f_string_dynamic_append(f_fss_embedded_list_open_end_s, &setting->buffer);
+        if (F_status_is_error_not(setting->state.status)) {
+          setting->state.status = f_string_dynamic_append(f_fss_embedded_list_open_end_s, &setting->buffer);
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
index f4cd0e3bb0fdcaae3d46edad797dd6c7c4f6ca9c..aa08fe9d8465d8f251799281a7966b10ca6b8dad 100644 (file)
@@ -83,7 +83,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index e956aaa7ad973ae36034b910d09bf0171e8a96f4..7e5733bdabec2c722eef7903c1e3566a9b67a459 100644 (file)
@@ -30,7 +30,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
     fss_write_setting_load(arguments, state, &data, &setting, 0);
   }
index 41a14eff14c87b9ca411e86b37d69fdac23d6a36..955e24e53c8f7c731f5472fc4422a52ab7a14267 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
index ddb6e3431c3a312fece4cab3e127c2a16c84b1d8..3ef64f77de1e767d10aceeb0c2fc5badb785068e 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
-      setting->status = fl_fss_extended_content_write(
+      setting->state.status = fl_fss_extended_content_write(
         *setting->content,
         setting->quote.used
           ? setting->quote.string[0]
@@ -28,8 +28,8 @@ extern "C" {
         &setting->buffer
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -37,7 +37,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_extended_content_write));
 
         return;
@@ -46,16 +46,16 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_content_end_e) {
-        setting->status = f_string_dynamic_append(f_fss_extended_close_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_extended_close_s, &setting->buffer);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
       else if (setting->flag & fss_write_flag_content_next_e) {
-        setting->status = f_string_dynamic_append(f_fss_extended_next_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_extended_next_s, &setting->buffer);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
@@ -80,7 +80,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->status = fl_fss_extended_object_write(
+      setting->state.status = fl_fss_extended_object_write(
         *setting->object,
         setting->quote.used
           ? setting->quote.string[0]
@@ -97,8 +97,8 @@ extern "C" {
         &setting->buffer
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -106,7 +106,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_extended_object_write));
 
         return;
@@ -115,8 +115,8 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_object_open_e) {
-        setting->status = f_string_dynamic_append(f_fss_extended_open_s, &setting->buffer);
-        if (F_status_is_error(setting->status)) {
+        setting->state.status = f_string_dynamic_append(f_fss_extended_open_s, &setting->buffer);
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
index f828d593c8e419e767418630d337d875f7a3cefa..a30b6e599ab1895d17ccf1db103d056ec2ad67c7 100644 (file)
@@ -83,7 +83,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 479dcac93db2370cf10638bccde1444faf7d26ce..34ded57ce1f435c056cd4cd9f104524149e56237 100644 (file)
@@ -29,7 +29,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
     fss_write_setting_load(arguments, state, &data, &setting, 0);
   }
index 9b2977d98614d042b9099f8e2dfb2252802c9c9c..5af54d90e73d09f2a7f422aed39e28850852edeb 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
index 28c6f1b47dd376bc010c6473de923cae317dab3d..983f42aca9c47898b643a2192c2f98d174174053 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
-      setting->status = fl_fss_extended_list_content_write(
+      setting->state.status = fl_fss_extended_list_content_write(
         *setting->content,
         (setting->flag & fss_write_flag_partial_e)
           ? last
@@ -27,8 +27,8 @@ extern "C" {
         &setting->buffer
       );
 
-      if (F_status_set_fine(setting->status) == F_none_eol) {
-        setting->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(setting->state.status) == F_none_eol) {
+        setting->state.status = F_status_set_error(F_support_not);
 
         fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
@@ -36,7 +36,7 @@ extern "C" {
         return;
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_extended_list_content_write));
 
         return;
@@ -45,13 +45,13 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_content_end_e) {
-        setting->status = f_string_dynamic_append(f_fss_extended_list_close_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_extended_list_close_s, &setting->buffer);
 
-        if (F_status_is_error_not(setting->status)) {
-          setting->status = f_string_dynamic_append(f_fss_extended_list_close_end_s, &setting->buffer);
+        if (F_status_is_error_not(setting->state.status)) {
+          setting->state.status = f_string_dynamic_append(f_fss_extended_list_close_end_s, &setting->buffer);
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
@@ -76,7 +76,7 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->status = fl_fss_extended_list_object_write(
+      setting->state.status = fl_fss_extended_list_object_write(
         *setting->object,
         (setting->flag & fss_write_flag_partial_e)
           ? (setting->flag & fss_write_flag_trim_e)
@@ -108,13 +108,13 @@ extern "C" {
 
     if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
       if (setting->flag & fss_write_flag_object_open_e) {
-        setting->status = f_string_dynamic_append(f_fss_extended_list_open_s, &setting->buffer);
+        setting->state.status = f_string_dynamic_append(f_fss_extended_list_open_s, &setting->buffer);
 
-        if (F_status_is_error_not(setting->status)) {
-          setting->status = f_string_dynamic_append(f_fss_extended_list_open_end_s, &setting->buffer);
+        if (F_status_is_error_not(setting->state.status)) {
+          setting->state.status = f_string_dynamic_append(f_fss_extended_list_open_end_s, &setting->buffer);
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
index 6b180232430137de90c7a2da3673e4485f7283d4..9974e2ee6716fab16fcc1186935d779202ded9fa 100644 (file)
@@ -83,7 +83,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index b6571bee1eeb8b10c94361632d71ad2f7f7203cb..a88557d3596b68bdbe459322c46e323e915a7ebd 100644 (file)
@@ -29,7 +29,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
     fss_write_setting_load(arguments, state, &data, &setting, 0);
   }
index dc81d38e55f3c227d0e1b710edcd690afd983da4..824636f3d4d0660eed0784c759e9d9f276f52356 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
index 607a4ad9ec00e2fde9e886647fb8d588669caa92..21316a86b25771e3321dd4eac991f5c374db67b3 100644 (file)
@@ -27,10 +27,9 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(state, arguments, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_console_parameter_process));
 
       return;
@@ -47,9 +46,9 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(fll_program_parameter_process_context));
 
           return;
@@ -78,9 +77,9 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(fll_program_parameter_process_verbosity));
 
           return;
@@ -106,10 +105,10 @@ extern "C" {
 
     if (callback) {
       callback(arguments, main, setting);
-      if (F_status_is_error(setting->status)) return;
+      if (F_status_is_error(setting->state.status)) return;
 
-      if (setting->status == F_done) {
-        setting->status = F_none;
+      if (setting->state.status == F_done) {
+        setting->state.status = F_none;
 
         return;
       }
@@ -120,7 +119,7 @@ extern "C" {
 
     if ((main->parameters.array[fss_write_parameter_file_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_file_e].values.used) {
       if (main->parameters.array[fss_write_parameter_file_e].values.used > 1) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         fss_write_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
@@ -133,9 +132,9 @@ extern "C" {
       main->output.to.id = -1;
       main->output.to.stream = 0;
 
-      setting->status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
+      setting->state.status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error_file(setting, main->error, macro_fss_write_f(f_file_stream_open), main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
 
         return;
@@ -144,7 +143,7 @@ extern "C" {
       setting->flag |= fss_write_flag_file_to_e;
     }
     else if (main->parameters.array[fss_write_parameter_file_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       fss_write_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
@@ -157,9 +156,9 @@ extern "C" {
 
       setting->objects.used = 0;
 
-      setting->status = f_string_dynamics_resize(values->used, &setting->objects);
+      setting->state.status = f_string_dynamics_resize(values->used, &setting->objects);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_resize));
 
         return;
@@ -178,7 +177,7 @@ extern "C" {
       setting->flag |= fss_write_flag_object_e;
     }
     else if (main->parameters.array[fss_write_parameter_object_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       fss_write_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_object_s);
@@ -191,7 +190,7 @@ extern "C" {
       if (setting->flag & fss_write_flag_object_e) {
         if (!(setting->flag & fss_write_flag_content_multiple_e)) {
           if (main->parameters.array[fss_write_parameter_content_e].values.used > main->parameters.array[fss_write_parameter_object_e].values.used) {
-            setting->status = F_status_set_error(F_support_not);
+            setting->state.status = F_status_set_error(F_support_not);
 
             fss_write_print_error_one_content_only(setting, main->error);
 
@@ -210,9 +209,9 @@ extern "C" {
 
       setting->contentss.used = 0;
 
-      setting->status = f_string_dynamicss_increase_by(values_object->used, &setting->contentss);
+      setting->state.status = f_string_dynamicss_increase_by(values_object->used, &setting->contentss);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamicss_increase_by));
 
         return;
@@ -241,9 +240,9 @@ extern "C" {
           break;
         }
 
-        setting->status = f_string_dynamics_increase_by(total, &setting->contentss.array[j]);
+        setting->state.status = f_string_dynamics_increase_by(total, &setting->contentss.array[j]);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_increase_by));
 
           return;
@@ -266,7 +265,7 @@ extern "C" {
       setting->flag |= fss_write_flag_content_e;
     }
     else if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       fss_write_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_content_s);
@@ -279,9 +278,9 @@ extern "C" {
 
       setting->prepend.used = 0;
 
-      setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->prepend);
+      setting->state.status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->prepend);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append_nulless));
 
         return;
@@ -293,16 +292,16 @@ extern "C" {
 
         for (; range.start < main->parameters.arguments.array[index].used; range.start++) {
 
-          setting->status = f_fss_is_space(main->parameters.arguments.array[index], range, state);
+          setting->state.status = f_fss_is_space(main->parameters.arguments.array[index], range, state);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(f_fss_is_space));
 
             return;
           }
 
-          if (setting->status == F_false) {
-            setting->status = F_status_set_error(F_parameter);
+          if (setting->state.status == F_false) {
+            setting->state.status = F_status_set_error(F_parameter);
 
             fss_write_print_error_prepend_only_whitespace(setting, main->error);
 
@@ -314,7 +313,7 @@ extern "C" {
       setting->flag |= fss_write_flag_prepend_e;
     }
     else if (main->parameters.array[fss_write_parameter_prepend_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       fss_write_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_prepend_s);
@@ -324,7 +323,7 @@ extern "C" {
 
     if ((main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_ignore_e].values.used) {
       if (main->parameters.array[fss_write_parameter_ignore_e].values.used % 2 != 0) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         fss_write_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, fss_write_string_two_s);
@@ -346,9 +345,9 @@ extern "C" {
 
         setting->ignoress.used = 0;
 
-        setting->status = f_string_rangess_increase_by(values_data->used, &setting->ignoress);
+        setting->state.status = f_string_rangess_increase_by(values_data->used, &setting->ignoress);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_rangess_increase_by));
 
           return;
@@ -376,9 +375,9 @@ extern "C" {
             break;
           }
 
-          setting->status = f_string_ranges_increase_by(total, &setting->ignoress.array[j]);
+          setting->state.status = f_string_ranges_increase_by(total, &setting->ignoress.array[j]);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_ranges_increase_by));
 
             return;
@@ -388,9 +387,9 @@ extern "C" {
 
             index = values_ignore->array[i++];
 
-            setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].start);
+            setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].start);
 
-            if (F_status_is_error(setting->status)) {
+            if (F_status_is_error(setting->state.status)) {
               fss_write_print_line_first_locked(setting, main->error);
               fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
 
@@ -399,9 +398,9 @@ extern "C" {
 
             index = values_ignore->array[i++];
 
-            setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop);
+            setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop);
 
-            if (F_status_is_error(setting->status)) {
+            if (F_status_is_error(setting->state.status)) {
               fss_write_print_line_first_locked(setting, main->error);
               fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
 
@@ -409,7 +408,7 @@ extern "C" {
             }
 
             if (setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop > setting->ignoress.array[j].array[setting->ignoress.array[j].used].start) {
-              setting->status = F_status_set_error(F_parameter);
+              setting->state.status = F_status_set_error(F_parameter);
 
               fss_write_print_line_first_locked(setting, main->error);
               fll_program_print_error_parameter_range_start_before_stop(
@@ -442,9 +441,9 @@ extern "C" {
 
           index = main->parameters.array[fss_write_parameter_ignore_e].values.array[i++];
 
-          setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.start);
+          setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.start);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_line_first_locked(setting, main->error);
             fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
 
@@ -453,9 +452,9 @@ extern "C" {
 
           index = main->parameters.array[fss_write_parameter_ignore_e].values.array[i++];
 
-          setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.stop);
+          setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.stop);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_line_first_locked(setting, main->error);
             fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
 
@@ -463,7 +462,7 @@ extern "C" {
           }
 
           if (number.start > number.stop) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             fss_write_print_line_first_locked(setting, main->error);
             fll_program_print_error_parameter_range_start_before_stop(
@@ -480,7 +479,7 @@ extern "C" {
       }
     }
     else if (main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       fss_write_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s);
@@ -535,7 +534,7 @@ extern "C" {
         if (main->parameters.array[has[i]].result & f_console_result_found_e) {
           if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e)) {
             if (!(setting->flag & fss_write_flag_partial_e)) {
-              setting->status = F_status_set_error(F_parameter);
+              setting->state.status = F_status_set_error(F_parameter);
 
               fss_write_print_line_first_locked(setting, main->error);
 
@@ -556,7 +555,7 @@ extern "C" {
           }
 
           if (main->parameters.array[has_cannots[i][0]].result & f_console_result_found_e) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             fss_write_print_line_first_locked(setting, main->error);
             fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][0]);
@@ -565,7 +564,7 @@ extern "C" {
           }
 
           if (main->parameters.array[has_cannots[i][1]].result & f_console_result_found_e) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             fss_write_print_line_first_locked(setting, main->error);
             fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][1]);
@@ -582,7 +581,7 @@ extern "C" {
       if (setting->flag & fss_write_flag_object_e) {
         if (setting->flag & fss_write_flag_content_multiple_e) {
           if (main->parameters.array[fss_write_parameter_object_e].locations_sub.used > main->parameters.array[fss_write_parameter_content_e].locations_sub.used && !(setting->flag & fss_write_flag_partial_e)) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             fss_write_print_error_parameter_same_times_at_least(setting, main->error);
 
@@ -592,7 +591,7 @@ extern "C" {
 
         if ((setting->flag & fss_write_flag_content_e) && (setting->flag & fss_write_flag_partial_e)) {
           if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             fss_write_print_line_first_locked(setting, main->error);
             fll_program_print_error_parameter_cannot_use_with_xor(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_write_long_partial_s, fss_write_long_object_s, fss_write_long_content_s);
@@ -646,7 +645,7 @@ extern "C" {
     }
 
     if (!(setting->flag & (fll_program_data_pipe_input_e | fss_write_flag_content_e | fss_write_parameter_object_e))) {
-      setting->status = F_data_not;
+      setting->state.status = F_data_not;
     }
   }
 #endif // _di_fss_write_setting_load_
index dd0990de0fdf4135bb91c680fb5388c24bda793b..021d5b8c344bba6a69085862899848de9f2d50ba 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -47,7 +47,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_data_not on success but nothing was provided to operate with.
  *
@@ -82,7 +82,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 48917a366e0f3a1f6c832ec1eedeb7089d7e1c6e..7188d295b7aee9b38c74f6e7f8af2dfe9dc71ebd 100644 (file)
@@ -9,13 +9,13 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_line_last_locked(setting, main->error);
 
       return;
     }
 
-    setting->status = F_none;
+    setting->state.status = F_none;
 
     if (setting->flag & fss_write_flag_help_e) {
       if (setting->process_help) {
@@ -45,7 +45,7 @@ extern "C" {
       }
     }
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e | fss_write_flag_object_open_e | fss_write_flag_content_next_e | fss_write_flag_content_end_e)) {
         if (setting->process_normal) {
           setting->process_normal(main, (void *) setting);
@@ -53,11 +53,8 @@ extern "C" {
       }
     }
 
-    if (F_status_is_error(setting->status)) {
-      fss_write_print_line_last_locked(setting, main->error);
-    }
-    else if (setting->status != F_interrupt) {
-      fss_write_print_line_last_locked(setting, main->message);
+    if (F_status_is_error(setting->state.status)) {
+      fss_write_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
     }
   }
 #endif // _di_fss_write_main_
@@ -91,7 +88,7 @@ extern "C" {
         // @todo replace all signal checks with forked main process that independently checks and assigns main->signal_received.
         if (!((++main->signal_check) % fss_write_signal_check_d)) {
           if (fll_program_standard_signal_received(main)) {
-            setting->status = F_status_set_error(F_interrupt);
+            setting->state.status = F_status_set_error(F_interrupt);
 
             return;
           }
@@ -112,7 +109,7 @@ extern "C" {
         }
 
         setting->process_set(main, setting);
-        if (F_status_is_error(setting->status)) break;
+        if (F_status_is_error(setting->state.status)) break;
       } // for
     }
     else {
@@ -158,35 +155,35 @@ extern "C" {
     uint8_t state = 0;
 
     // This is processed in a single set, so there is only ever one Object added.
-    setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->objects);
+    setting->state.status = f_string_dynamics_increase(setting->state.step_small, &setting->objects);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_increase));
 
       return;
     }
 
     // This is processed in a single set, so there is only ever one Content added.
-    setting->status = f_string_dynamicss_increase(setting->state.step_small, &setting->contentss);
+    setting->state.status = f_string_dynamicss_increase(setting->state.step_small, &setting->contentss);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamicss_increase));
 
       return;
     }
 
-    setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
+    setting->state.status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_increase));
 
       return;
     }
 
     // This is processed in a single set, so there is only ever one Ignores added.
-    setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
+    setting->state.status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_rangess_increase));
 
       return;
@@ -203,7 +200,7 @@ extern "C" {
         if (fll_program_standard_signal_received(main)) {
           fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-          setting->status = F_status_set_error(F_interrupt);
+          setting->state.status = F_status_set_error(F_interrupt);
 
           break;
         }
@@ -244,9 +241,9 @@ extern "C" {
         flag -= flag | 0x4;
         setting->contents->used = 0;
 
-        setting->status = f_string_dynamic_increase_by(setting->block.used, setting->object);
+        setting->state.status = f_string_dynamic_increase_by(setting->block.used, setting->object);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_increase_by));
 
           break;
@@ -288,7 +285,7 @@ extern "C" {
           setting->object->string[setting->object->used++] = setting->block.string[range.start];
         } // for
 
-        if (F_status_is_error(setting->status)) break;
+        if (F_status_is_error(setting->state.status)) break;
 
         // If the start of Content is not found, then fetch the next block.
         if (state == 0x1) continue;
@@ -303,16 +300,16 @@ extern "C" {
         // Check to see if the Content supports multiple Content per Object.
         if (flag & 0x4) {
           if (!(setting->flag & fss_write_flag_content_multiple_e)) {
-            setting->status = F_status_set_error(F_support_not);
+            setting->state.status = F_status_set_error(F_support_not);
 
             fss_write_print_error_one_content_only(setting, main->error);
 
             break;
           }
 
-          setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
+          setting->state.status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_increase));
 
             break;
@@ -327,9 +324,9 @@ extern "C" {
         }
 
         if (total) {
-          setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
+          setting->state.status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_increase_by));
 
             break;
@@ -341,7 +338,7 @@ extern "C" {
             if (!(flag & 0x2)) {
               if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
                 if (!(setting->flag & fss_write_flag_content_multiple_e)) {
-                  setting->status = F_status_set_error(F_support_not);
+                  setting->state.status = F_status_set_error(F_support_not);
 
                   fss_write_print_error_one_content_only(setting, main->error);
 
@@ -361,9 +358,9 @@ extern "C" {
 
               // Ignore is enabled.
               if (flag & 0x2) {
-                setting->status = f_string_ranges_increase(setting->state.step_small, setting->ignores);
+                setting->state.status = f_string_ranges_increase(setting->state.step_small, setting->ignores);
 
-                if (F_status_is_error(setting->status)) {
+                if (F_status_is_error(setting->state.status)) {
                   fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_ranges_increase));
 
                   break;
@@ -386,7 +383,7 @@ extern "C" {
             setting->contents->array[setting->contents->used].string[setting->contents->array[setting->contents->used].used++] = setting->block.string[range.start];
           } // for
 
-          if (F_status_is_error(setting->status)) break;
+          if (F_status_is_error(setting->state.status)) break;
 
           ++setting->contents->used;
           flag |= 0x4;
@@ -399,7 +396,7 @@ extern "C" {
       // End Object or Content set.
       if (state == 0x3) {
         setting->process_set(main, void_setting);
-        if (F_status_is_error(setting->status)) break;
+        if (F_status_is_error(setting->state.status)) break;
 
         state = 0;
         flag |= 0x1;
@@ -414,7 +411,7 @@ extern "C" {
     } // for
 
     // If the pipe ended before finishing, then attempt to wrap up.
-    if (F_status_is_error_not(setting->status) && status_pipe == F_none_eof && state) {
+    if (F_status_is_error_not(setting->state.status) && status_pipe == F_none_eof && state) {
       setting->process_set(main, void_setting);
 
       flag |= 0x1;
@@ -429,8 +426,8 @@ extern "C" {
     setting->objects.used = used_objects;
     setting->contentss.used = used_contentss;
 
-    if (F_status_is_error_not(setting->status)) {
-      setting->status = (flag & 0x1) ? F_none : F_data_not;
+    if (F_status_is_error_not(setting->state.status)) {
+      setting->state.status = (flag & 0x1) ? F_none : F_data_not;
     }
   }
 #endif // _di_fss_write_process_pipe_
@@ -457,7 +454,7 @@ extern "C" {
 
       if (setting->process_object) {
         setting->process_object(main, void_setting);
-        if (F_status_is_error(setting->status)) return;
+        if (F_status_is_error(setting->state.status)) return;
       }
     }
 
@@ -479,14 +476,14 @@ extern "C" {
             setting->content = &setting->contents->array[i];
 
             setting->process_content(main, void_setting, i + 1 == setting->contents->used);
-            if (F_status_is_error(setting->status)) return;
+            if (F_status_is_error(setting->state.status)) return;
           } // for
         }
         else {
           setting->content = 0;
 
           setting->process_content(main, void_setting, F_true);
-          if (F_status_is_error(setting->status)) return;
+          if (F_status_is_error(setting->state.status)) return;
         }
       }
     }
index 12b89e3b839980c5b6dcd5f0bdc01b109d1f37e4..604f60cfafa580ca96ae1ae08bb55d26baf4a194 100644 (file)
@@ -68,7 +68,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
@@ -89,7 +89,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     status from fss_write_process_normal_data().
  *
  *     Errors (with error bit) from fss_write_process_normal_data().
@@ -109,7 +109,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_interrupt on (exit) signal received.
  *
@@ -128,7 +128,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_data_not on success but pipe contained no relevant data.
  *     F_basic on success and the basic has been printed.
@@ -149,7 +149,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_interrupt on (exit) signal received.
  *
index e052608167b5628da1a226f96c7c2bbf05f9da75..73e9f4940f836e5349ae75ccb1ba5dc4edc1ede9 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param value
@@ -38,7 +38,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
index 1f281e4ae42fb1dc7ed911a51def6108e3f7d142..bc4cad8a166e4ad9f33ab2d69fef012081311031 100644 (file)
@@ -27,7 +27,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
     fss_write_setting_load(arguments, state, &data, &setting, &fss_write_main_setting_load_as);
   }
@@ -55,7 +54,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 #ifndef _di_fss_write_main_setting_load_as_
   void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, f_state_t * const state) {
 
-    if (!main || !setting || F_status_is_error(setting->status) || (setting->flag & fss_write_flag_version_e)) return;
+    if (!main || !setting || F_status_is_error(setting->state.status) || (setting->flag & fss_write_flag_version_e)) return;
 
     setting->standard = fss_write_basic_standard_s;
     setting->process_content = &fss_write_basic_process_content;
@@ -160,22 +159,22 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         }
         else {
           if (setting->flag & fss_write_flag_help_e) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             break;
           }
 
-          if (setting->status != F_status_set_error(F_parameter)) {
+          if (setting->state.status != F_status_set_error(F_parameter)) {
             fss_write_print_line_first_locked(setting, main->error);
           }
 
-          setting->status = F_status_set_error(F_parameter);
+          setting->state.status = F_status_set_error(F_parameter);
 
           fss_write_main_print_error_format_unknown(main->error, argv[index]);
         }
       } // for
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         if (setting->flag & fss_write_flag_help_e) {
           fss_write_main_process_help(main, setting);
         }
@@ -184,7 +183,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
       }
     }
     else if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       if (setting->flag & fss_write_flag_help_e) {
         fss_write_main_process_help(main, setting);
index b291120758dfce1a738a968db0a1db396825d411..7c230ae162263bf761ff4df2c279286c8d7c357d 100644 (file)
@@ -40,7 +40,7 @@ extern int main(const int argc, const f_string_t *argv, const f_string_t *envp);
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -66,13 +66,13 @@ extern int main(const int argc, const f_string_t *argv, const f_string_t *envp);
  *
  *   This alters setting.process_help, setting.process_normal, and setting.process_pipe.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_interrupt on (exit) signal received.
  *
  *     F_parameter (with error bit) if main is NULL or setting is NULL.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_data_not on success but nothing was provided to operate with.
  *
@@ -81,8 +81,6 @@ extern int main(const int argc, const f_string_t *argv, const f_string_t *envp);
  *     Errors (with error bit) from: f_string_dynamics_resize().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
  *     Errors (with error bit) from: fll_program_parameter_process_verbosity().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see f_file_stream_open()
@@ -93,7 +91,7 @@ extern int main(const int argc, const f_string_t *argv, const f_string_t *envp);
  * @see fss_write_setting_load()
  */
 #ifndef _di_fss_write_main_setting_load_as_
-  extern void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, f_state_t * const state);
+  extern void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting);
 #endif // _di_fss_write_main_setting_load_as_
 
 #ifdef __cplusplus
index e31b9d562696eeba841ae109998e3919c8bbb6a8..48958224859beba5962484268514c19d65c9cf7e 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
     if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     fss_write_print_line_first_locked(setting, print);
-    fll_error_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e);
+    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
 
     return F_none;
   }
@@ -22,7 +22,7 @@ extern "C" {
     if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     fss_write_print_line_first_locked(setting, print);
-    fll_error_file_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e, name, operation, type);
+    fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
 
     return F_none;
   }
@@ -162,7 +162,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
     }
@@ -178,7 +178,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
     }
@@ -194,7 +194,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
     }
@@ -210,7 +210,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
     }
index e8f67c4e57fb5629ecb2870136ecc18c594d586e..3ab0bd19b2d194c6ef5fb46929166c3822688951 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -38,7 +38,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param function
@@ -67,7 +67,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -87,7 +87,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -123,7 +123,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -143,7 +143,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  */
@@ -159,7 +159,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  */
@@ -175,7 +175,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  */
@@ -193,7 +193,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -215,7 +215,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -237,7 +237,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -259,7 +259,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index ca5b3f960c3f40487cbe6206e1e6d62e6a4e661d..4f93986d2f655d0d2a8b00cba656b207ab278968 100644 (file)
@@ -45,35 +45,35 @@ extern "C" {
     uint8_t state = 0;
 
     // This is processed in a single set, so there is only ever one Object added.
-    setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->objects);
+    setting->state.status = f_string_dynamics_increase(setting->state.step_small, &setting->objects);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_increase));
 
       return;
     }
 
     // This is processed in a single set, so there is only ever one Content added.
-    setting->status = f_string_dynamicss_increase(setting->state.step_small, &setting->contentss);
+    setting->state.status = f_string_dynamicss_increase(setting->state.step_small, &setting->contentss);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamicss_increase));
 
       return;
     }
 
-    setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
+    setting->state.status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_increase));
 
       return;
     }
 
     // This is processed in a single set, so there is only ever one Ignores added.
-    setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
+    setting->state.status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_rangess_increase));
 
       return;
@@ -90,7 +90,7 @@ extern "C" {
         if (fll_program_standard_signal_received(main)) {
           fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-          setting->status = F_status_set_error(F_interrupt);
+          setting->state.status = F_status_set_error(F_interrupt);
 
           break;
         }
@@ -132,9 +132,9 @@ extern "C" {
         flag -= flag | 0x4;
         setting->contents->used = 0;
 
-        setting->status = f_string_dynamic_increase_by(setting->block.used, setting->object);
+        setting->state.status = f_string_dynamic_increase_by(setting->block.used, setting->object);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_increase_by));
 
           break;
@@ -176,7 +176,7 @@ extern "C" {
           setting->object->string[setting->object->used++] = setting->block.string[range.start];
         } // for
 
-        if (F_status_is_error(setting->status)) break;
+        if (F_status_is_error(setting->state.status)) break;
 
         // If the start of Content was not found, then fetch the next block.
         if (state == 0x1) continue;
@@ -191,16 +191,16 @@ extern "C" {
         // Check to see if the Content supports multiple Content per Object.
         if (flag & 0x4) {
           if (!(setting->flag & fss_write_flag_content_multiple_e)) {
-            setting->status = F_status_set_error(F_support_not);
+            setting->state.status = F_status_set_error(F_support_not);
 
             fss_write_print_error_one_content_only(setting, main->error);
 
             break;
           }
 
-          setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
+          setting->state.status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_increase));
 
             break;
@@ -217,9 +217,9 @@ extern "C" {
         // When payload is provided, all data at this point is part of the payload until the end of the pipe.
         if (fl_string_dynamic_compare(f_fss_payload_s, *setting->object) == F_equal_to) {
           if (total > 1) {
-            setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
+            setting->state.status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
 
-            if (F_status_is_error(setting->status)) {
+            if (F_status_is_error(setting->state.status)) {
               fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_increase_by));
 
               break;
@@ -241,9 +241,9 @@ extern "C" {
         }
 
         if (total) {
-          setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
+          setting->state.status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_increase_by));
 
             break;
@@ -254,7 +254,7 @@ extern "C" {
             // Do not handle start/end while inside an ignore set.
             if (!(flag & 0x2)) {
               if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
-                setting->status = F_status_set_error(F_support_not);
+                setting->state.status = F_status_set_error(F_support_not);
 
                 fss_write_print_error_one_content_only(setting, main->error);
 
@@ -286,7 +286,7 @@ extern "C" {
             setting->contents->array[setting->contents->used].string[setting->contents->array[setting->contents->used].used++] = setting->block.string[range.start];
           } // for
 
-          if (F_status_is_error(setting->status)) break;
+          if (F_status_is_error(setting->state.status)) break;
 
           ++setting->contents->used;
           flag |= 0x4;
@@ -299,7 +299,7 @@ extern "C" {
       // End Object or Content set.
       if (state == 0x3) {
         fss_write_payload_process_set(main, void_setting);
-        if (F_status_is_error(setting->status)) break;
+        if (F_status_is_error(setting->state.status)) break;
 
         state = 0;
         flag |= 0x1;
@@ -317,9 +317,9 @@ extern "C" {
         if (setting->block.used && range.start <= range.stop) {
           length = (range.stop - range.start) + 1;
 
-          setting->status = f_string_dynamic_increase_by(length + 1, &setting->contents->array[setting->contents->used]);
+          setting->state.status = f_string_dynamic_increase_by(length + 1, &setting->contents->array[setting->contents->used]);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_increase_by));
 
             break;
@@ -342,7 +342,7 @@ extern "C" {
     } // for
 
     // If the pipe ended before finishing, then attempt to wrap up.
-    if (F_status_is_error_not(setting->status) && status_pipe == F_none_eof && state) {
+    if (F_status_is_error_not(setting->state.status) && status_pipe == F_none_eof && state) {
       fss_write_payload_process_set(main, void_setting);
 
       flag |= 0x1;
@@ -357,17 +357,17 @@ extern "C" {
     setting->contentss.used = used_contentss;
     setting->ignoress.used = used_ignoress;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (flag & 0x1) {
         if (flag & 0x8) {
-          setting->status = F_payload;
+          setting->state.status = F_payload;
         }
         else {
-          setting->status = F_none;
+          setting->state.status = F_none;
         }
       }
       else {
-        setting->status = F_data_not;
+        setting->state.status = F_data_not;
       }
 
       // Payload.
@@ -396,7 +396,7 @@ extern "C" {
           setting->range.stop = 0;
         }
 
-        setting->status = fll_fss_payload_write(
+        setting->state.status = fll_fss_payload_write(
           *setting->object,
           setting->contents->array[0],
           (setting->flag & fss_write_flag_trim_e),
@@ -407,8 +407,8 @@ extern "C" {
           &setting->buffer
         );
 
-        if (F_status_set_fine(setting->status) == F_none_eol) {
-          setting->status = F_status_set_error(F_support_not);
+        if (F_status_set_fine(setting->state.status) == F_none_eol) {
+          setting->state.status = F_status_set_error(F_support_not);
 
           fss_write_print_line_first_locked(setting, main->error);
           fss_write_print_error_unsupported_eol(setting, main->error);
@@ -416,7 +416,7 @@ extern "C" {
           return;
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(fll_fss_payload_write));
 
           return;
@@ -433,7 +433,7 @@ extern "C" {
             setting->range.stop = 0;
           }
 
-          setting->status = fl_fss_basic_list_object_write(
+          setting->state.status = fl_fss_basic_list_object_write(
             *setting->object,
             (setting->flag & fss_write_flag_partial_e)
               ? (setting->flag & fss_write_flag_trim_e)
@@ -447,8 +447,8 @@ extern "C" {
             &setting->buffer
           );
 
-          if (F_status_set_fine(setting->status) == F_none_eol) {
-            setting->status = F_status_set_error(F_support_not);
+          if (F_status_set_fine(setting->state.status) == F_none_eol) {
+            setting->state.status = F_status_set_error(F_support_not);
 
             fss_write_print_line_first_locked(setting, main->error);
             fss_write_print_error_unsupported_eol(setting, main->error);
@@ -456,7 +456,7 @@ extern "C" {
             return;
           }
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_basic_list_object_write));
 
             return;
@@ -465,13 +465,13 @@ extern "C" {
 
         if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
           if (setting->flag & fss_write_flag_object_open_e) {
-            setting->status = f_string_dynamic_append(f_fss_basic_list_open_s, &setting->buffer);
+            setting->state.status = f_string_dynamic_append(f_fss_basic_list_open_s, &setting->buffer);
 
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = f_string_dynamic_append(f_fss_basic_list_open_end_s, &setting->buffer);
+            if (F_status_is_error_not(setting->state.status)) {
+              setting->state.status = f_string_dynamic_append(f_fss_basic_list_open_end_s, &setting->buffer);
             }
 
-            if (F_status_is_error(setting->status)) {
+            if (F_status_is_error(setting->state.status)) {
               fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
 
               return;
@@ -493,7 +493,7 @@ extern "C" {
           prepend = &main->parameters.arguments.array[index];
         }
 
-        setting->status = fl_fss_basic_list_content_write(
+        setting->state.status = fl_fss_basic_list_content_write(
           setting->contents->array[0],
           setting->object
             ? f_fss_complete_full_e
@@ -504,7 +504,7 @@ extern "C" {
           &setting->buffer
         );
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(fl_fss_payload_content_write));
 
           return;
@@ -513,9 +513,9 @@ extern "C" {
 
       if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
         if (setting->flag & fss_write_flag_content_end_e) {
-          setting->status = f_string_dynamic_append(f_fss_basic_list_close_s, &setting->buffer);
+          setting->state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &setting->buffer);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
 
             return;
@@ -525,9 +525,9 @@ extern "C" {
     }
 
     if (!setting->object || !(setting->contents && setting->contents->used)) {
-      setting->status = f_string_dynamic_append(f_string_eol_s, &setting->buffer);
+      setting->state.status = f_string_dynamic_append(f_string_eol_s, &setting->buffer);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
 
         return;
@@ -537,7 +537,7 @@ extern "C" {
     fll_print_dynamic(setting->buffer, main->output.to);
 
     setting->buffer.used = 0;
-    setting->status = F_none;
+    setting->state.status = F_none;
   }
 #endif // _di_fss_write_payload_process_set_
 
@@ -554,7 +554,7 @@ extern "C" {
       for (f_array_length_t i = 0; i < values->used; ++i) {
 
         if (fl_string_dynamic_compare(argv[values->array[i]], fss_write_payload_s) == F_equal_to && i + 1 < values->used) {
-          setting->status = F_status_set_error(F_parameter);
+          setting->state.status = F_status_set_error(F_parameter);
 
           fss_write_payload_print_error_payload_not_last(setting, main->error);
 
index 33677115afd0c8153b3de90fabfa78e8897cf0a1..7882c3452315a329ba9d590506e5f0ffb0b8a813 100644 (file)
@@ -65,7 +65,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -84,7 +84,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_data_not on success but pipe contained no relevant data.
  *     F_payload on success and the payload has been printed.
@@ -105,7 +105,7 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_interrupt on (exit) signal received.
  *
@@ -131,23 +131,21 @@ extern "C" {
  *
  *   This alters setting.process_help, setting.process_normal, and setting.process_pipe.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_interrupt on (exit) signal received.
  *
  *     F_parameter (with error bit) if main is NULL or setting is NULL.
  *     F_parameter (with error bit) on parameter error.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_data_not on success but nothing was provided to operate with.
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see fss_write_setting_load()
  */
 #ifndef _di_fss_write_payload_setting_load_
-  extern void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, f_state_t * const state);
+  extern void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting);
 #endif // _di_fss_write_payload_setting_load_
 
 #ifdef __cplusplus
index e8bf57b8c2038fdab7131d83f65aab0ffb0e2634..153ddb7975f4f9576d18b572bcdb9566c36d1eba 100644 (file)
@@ -28,7 +28,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
     fss_write_setting_load(arguments, state, &data, &setting, &fss_write_payload_setting_load);
   }
index c65bc54dbbfedaf9d6fb305fdd8bc90254668b0c..a54ab96056a2f1b31330dca7778511b138208e71 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -38,7 +38,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
index 603da3150ec84938349082b802cf5a351278332b..9bc426e426358cba03e21db7fc8b3e581be67739 100644 (file)
@@ -25,16 +25,15 @@ extern "C" {
 #endif // _di_iki_read_setting_delete_
 
 #ifndef _di_iki_read_setting_load_
-  void iki_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, iki_read_setting_t * const setting) {
+  void iki_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, iki_read_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(f_console_parameter_process));
 
       return;
@@ -51,9 +50,9 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error(setting, main->error, macro_iki_read_f(fll_program_parameter_process_context));
 
           return;
@@ -82,9 +81,9 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error(setting, main->error, macro_iki_read_f(fll_program_parameter_process_verbosity));
 
           return;
@@ -111,7 +110,7 @@ extern "C" {
     }
 
     if (!(main->parameters.remaining.used || (main->pipe & fll_program_data_pipe_input_e))) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_read_print_line_first_locked(setting, main->error);
       fll_program_print_error_missing_file(main->error);
@@ -121,7 +120,7 @@ extern "C" {
 
     if (main->parameters.array[iki_read_parameter_at_e].result & f_console_result_value_e) {
       if (main->parameters.array[iki_read_parameter_whole_e].result & f_console_result_found_e) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_at_s, iki_read_long_whole_s);
@@ -133,10 +132,10 @@ extern "C" {
 
       setting->at = 0;
 
-      setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->at);
+      setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->at);
 
-      if (F_status_is_error(setting->status)) {
-        setting->status = F_status_set_error(F_parameter);
+      if (F_status_is_error(setting->state.status)) {
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, iki_read_long_at_s, main->parameters.arguments.array[index]);
@@ -147,7 +146,7 @@ extern "C" {
       setting->flag |= iki_read_main_flag_at_e;
     }
     else if (main->parameters.array[iki_read_parameter_at_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_read_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_at_s);
@@ -160,10 +159,10 @@ extern "C" {
 
       setting->line = 0;
 
-      setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->line);
+      setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->line);
 
-      if (F_status_is_error(setting->status)) {
-        setting->status = F_status_set_error(F_parameter);
+      if (F_status_is_error(setting->state.status)) {
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, iki_read_long_line_s, main->parameters.arguments.array[index]);
@@ -174,7 +173,7 @@ extern "C" {
       setting->flag |= iki_read_main_flag_line_e;
     }
     else if (main->parameters.array[iki_read_parameter_line_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_read_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_line_s);
@@ -185,9 +184,9 @@ extern "C" {
     if (main->parameters.array[iki_read_parameter_name_e].result & f_console_result_value_e) {
       setting->names.used = 0;
 
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[iki_read_parameter_name_e].values.used, &setting->names);
+      setting->state.status = f_string_dynamics_increase_by(main->parameters.array[iki_read_parameter_name_e].values.used, &setting->names);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_increase_by));
 
         return;
@@ -209,16 +208,16 @@ extern "C" {
         setting->names.array[setting->names.used].used = 0;
 
         if (main->parameters.arguments.array[values->array[i]].used) {
-          setting->status = f_string_dynamics_append(main->parameters.arguments.array[values->array[i]], &setting->names);
-          if (F_status_is_error(setting->status)) break;
+          setting->state.status = f_string_dynamics_append(main->parameters.arguments.array[values->array[i]], &setting->names);
+          if (F_status_is_error(setting->state.status)) break;
         }
         else {
-          setting->status = f_string_dynamics_append(f_string_empty_s, &setting->names);
-          if (F_status_is_error(setting->status)) break;
+          setting->state.status = f_string_dynamics_append(f_string_empty_s, &setting->names);
+          if (F_status_is_error(setting->state.status)) break;
         }
       } // for
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_append));
 
         return;
@@ -227,7 +226,7 @@ extern "C" {
       setting->flag |= iki_read_main_flag_name_e;
     }
     else if (main->parameters.array[iki_read_parameter_name_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_read_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_name_s);
@@ -237,7 +236,7 @@ extern "C" {
 
     if (main->parameters.array[iki_read_parameter_replace_e].result != f_console_result_none_e) {
       if ((main->parameters.array[iki_read_parameter_replace_e].result & f_console_result_found_e) || main->parameters.array[iki_read_parameter_replace_e].values.used % 2 != 0) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, iki_read_long_replace_s, iki_read_string_two_s);
@@ -247,9 +246,9 @@ extern "C" {
 
       setting->replace.used = 0;
 
-      setting->status = f_string_maps_increase_by(main->parameters.array[iki_read_parameter_replace_e].values.used / 2, &setting->replace);
+      setting->state.status = f_string_maps_increase_by(main->parameters.array[iki_read_parameter_replace_e].values.used / 2, &setting->replace);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_maps_increase_by));
 
         return;
@@ -276,14 +275,14 @@ extern "C" {
 
         // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it.
         if (setting->replace.array[at].name.size) {
-          setting->status = f_string_dynamic_resize(0, &setting->replace.array[at].name);
+          setting->state.status = f_string_dynamic_resize(0, &setting->replace.array[at].name);
         }
 
-        if (F_status_is_error_not(setting->status) && setting->replace.array[at].value.size) {
-          setting->status = f_string_dynamic_resize(0, &setting->replace.array[at].value);
+        if (F_status_is_error_not(setting->state.status) && setting->replace.array[at].value.size) {
+          setting->state.status = f_string_dynamic_resize(0, &setting->replace.array[at].value);
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize));
 
           return;
@@ -311,17 +310,17 @@ extern "C" {
       setting->flag |= iki_read_main_flag_reassign_e;
     }
 
-    if (F_status_is_error(setting->status)) return;
+    if (F_status_is_error(setting->state.status)) return;
 
     if (iki_read_setting_load_parameter_substitution(main, setting, main->parameters.array[iki_read_parameter_substitute_e], iki_read_long_substitute_s, &setting->substitute)) {
       setting->flag |= iki_read_main_flag_substitute_e;
     }
 
-    if (F_status_is_error(setting->status)) return;
+    if (F_status_is_error(setting->state.status)) return;
 
     if (main->parameters.array[iki_read_parameter_wrap_e].result != f_console_result_none_e) {
       if ((main->parameters.array[iki_read_parameter_wrap_e].result & f_console_result_found_e) || main->parameters.array[iki_read_parameter_wrap_e].values.used % 3 != 0) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, iki_read_long_wrap_s, iki_read_string_three_s);
@@ -331,9 +330,9 @@ extern "C" {
 
       setting->wrap.used = 0;
 
-      setting->status = f_string_triples_increase_by(main->parameters.array[iki_read_parameter_wrap_e].values.used / 3, &setting->wrap);
+      setting->state.status = f_string_triples_increase_by(main->parameters.array[iki_read_parameter_wrap_e].values.used / 3, &setting->wrap);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_triples_increase_by));
 
         return;
@@ -360,18 +359,18 @@ extern "C" {
 
         // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it.
         if (setting->wrap.array[at].a.size) {
-          setting->status = f_string_dynamic_resize(0, &setting->wrap.array[at].a);
+          setting->state.status = f_string_dynamic_resize(0, &setting->wrap.array[at].a);
         }
 
-        if (F_status_is_error_not(setting->status) && setting->wrap.array[at].b.size) {
-          setting->status = f_string_dynamic_resize(0, &setting->wrap.array[at].b);
+        if (F_status_is_error_not(setting->state.status) && setting->wrap.array[at].b.size) {
+          setting->state.status = f_string_dynamic_resize(0, &setting->wrap.array[at].b);
         }
 
-        if (F_status_is_error_not(setting->status) && setting->wrap.array[at].c.size) {
-          setting->status = f_string_dynamic_resize(0, &setting->wrap.array[at].c);
+        if (F_status_is_error_not(setting->state.status) && setting->wrap.array[at].c.size) {
+          setting->state.status = f_string_dynamic_resize(0, &setting->wrap.array[at].c);
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize));
 
           return;
@@ -417,7 +416,7 @@ extern "C" {
       for (uint8_t i = 0; i < 3; ++i) {
 
         if (main->parameters.array[ids[i]].result & f_console_result_found_e) {
-          setting->status = F_status_set_error(F_parameter);
+          setting->state.status = F_status_set_error(F_parameter);
 
           iki_read_print_line_first_locked(setting, main->error);
           fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_literal_s, names[i]);
@@ -442,7 +441,7 @@ extern "C" {
       for (uint8_t i = 0; i < 2; ++i) {
 
         if (main->parameters.array[ids[i]].result & f_console_result_found_e) {
-          setting->status = F_status_set_error(F_parameter);
+          setting->state.status = F_status_set_error(F_parameter);
 
           iki_read_print_line_first_locked(setting, main->error);
           fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_object_s, names[i]);
@@ -455,7 +454,7 @@ extern "C" {
     }
     else if (main->parameters.array[iki_read_parameter_content_e].result & f_console_result_found_e) {
       if (main->parameters.array[iki_read_parameter_total_e].result & f_console_result_found_e) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_content_s, iki_read_long_total_s);
@@ -467,7 +466,7 @@ extern "C" {
     }
     else if (main->parameters.array[iki_read_parameter_total_e].result & f_console_result_found_e) {
       if (main->parameters.array[iki_read_parameter_whole_e].result & f_console_result_found_e) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_total_s, iki_read_long_wrap_s);
@@ -490,9 +489,9 @@ extern "C" {
     if (main->parameters.remaining.used) {
       setting->files.used = 0;
 
-      setting->status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->files);
+      setting->state.status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->files);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_resize));
 
         return;
@@ -504,9 +503,9 @@ extern "C" {
 
         // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it.
         if (setting->files.array[setting->files.used].size) {
-          setting->status = f_string_dynamic_resize(0, &setting->files.array[setting->files.used]);
+          setting->state.status = f_string_dynamic_resize(0, &setting->files.array[setting->files.used]);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize));
 
             return;
@@ -519,11 +518,11 @@ extern "C" {
         setting->files.array[setting->files.used].used = main->parameters.arguments.array[index].used;
         setting->files.array[setting->files.used].size = 0;
 
-        setting->status = f_file_exists(setting->files.array[setting->files.used], F_true);
+        setting->state.status = f_file_exists(setting->files.array[setting->files.used], F_true);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_line_first_locked(setting, main->error);
-          fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_exists", fll_error_file_flag_fallback_e, setting->files.array[setting->files.used], f_file_operation_verify_s, fll_error_file_type_file_e);
+          fll_error_file_print(main->error, F_status_set_fine(setting->state.status), "f_file_exists", fll_error_file_flag_fallback_e, setting->files.array[setting->files.used], f_file_operation_verify_s, fll_error_file_type_file_e);
 
           return;
         }
@@ -538,7 +537,7 @@ extern "C" {
     if (!(parameter.result & f_console_result_found_e)) return F_false;
 
     if ((parameter.result & f_console_result_found_e) || parameter.values.used % 3 != 0) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_read_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, name, iki_read_string_three_s);
@@ -548,9 +547,9 @@ extern "C" {
 
     triple->used = 0;
 
-    setting->status = f_string_triples_increase_by(parameter.values.used / 3, triple);
+    setting->state.status = f_string_triples_increase_by(parameter.values.used / 3, triple);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_triples_increase_by));
 
       return F_false;
@@ -579,18 +578,18 @@ extern "C" {
 
       // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it.
       if (triple->array[at].a.size) {
-        setting->status = f_string_dynamic_resize(0, &triple->array[at].a);
+        setting->state.status = f_string_dynamic_resize(0, &triple->array[at].a);
       }
 
-      if (F_status_is_error_not(setting->status) && triple->array[at].b.size) {
-        setting->status = f_string_dynamic_resize(0, &triple->array[at].b);
+      if (F_status_is_error_not(setting->state.status) && triple->array[at].b.size) {
+        setting->state.status = f_string_dynamic_resize(0, &triple->array[at].b);
       }
 
-      if (F_status_is_error_not(setting->status) && triple->array[at].c.size) {
-        setting->status = f_string_dynamic_resize(0, &triple->array[at].c);
+      if (F_status_is_error_not(setting->state.status) && triple->array[at].c.size) {
+        setting->state.status = f_string_dynamic_resize(0, &triple->array[at].c);
       }
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize));
 
         return F_false;
index a42d0b6af6725a8ffe02d937a70aa52848040da7..e08e35d0e86504aa73270dc298464410d9da7005 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -42,14 +42,12 @@ extern "C" {
  *
  * @param arguments
  *   The parameters passed to the process (often referred to as command line arguments).
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  * @param main
  *   The main program data.
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
@@ -71,7 +69,7 @@ extern "C" {
  * @see fll_program_parameter_process_verbosity()
  */
 #ifndef _di_iki_read_setting_load_
-  extern void iki_read_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, iki_read_setting_t * const setting);
+  extern void iki_read_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, iki_read_setting_t * const setting);
 #endif // _di_iki_read_setting_load_
 
 /**
@@ -84,7 +82,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_string_dynamic_resize().
@@ -115,7 +113,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index 771f8643b36dc1a2cb559c756d9340c8ce06c557..78d92e7550105bb2dfc962cc87cf79a488e31699 100644 (file)
@@ -11,13 +11,13 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_read_print_line_last_locked(setting, main->error);
 
       return;
     }
 
-    setting->status = F_none;
+    setting->state.status = F_none;
 
     if (setting->flag & iki_read_main_flag_help_e) {
       iki_read_print_help(setting, main->message);
@@ -44,9 +44,9 @@ extern "C" {
 
       setting->buffer.used = 0;
 
-      setting->status = f_file_read(file, &setting->buffer);
+      setting->state.status = f_file_read(file, &setting->buffer);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_read_print_error_file(setting, main->error, macro_iki_read_f(f_file_read), f_string_ascii_minus_s, f_file_operation_process_s, fll_error_file_type_file_e);
       }
       else {
@@ -54,7 +54,7 @@ extern "C" {
       }
     }
 
-    if (F_status_is_error_not(setting->status) && setting->files.used) {
+    if (F_status_is_error_not(setting->state.status) && setting->files.used) {
       f_file_t file = f_file_t_initialize;
       off_t size_block = 0;
       off_t size_file = 0;
@@ -66,7 +66,7 @@ extern "C" {
           if (fll_program_standard_signal_received(main)) {
             fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-            setting->status = F_status_set_error(F_interrupt);
+            setting->state.status = F_status_set_error(F_interrupt);
 
             break;
           }
@@ -77,17 +77,17 @@ extern "C" {
         file.stream = 0;
         file.id = -1;
 
-        setting->status = f_file_stream_open(setting->files.array[i], f_string_empty_s, &file);
+        setting->state.status = f_file_stream_open(setting->files.array[i], f_string_empty_s, &file);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error_file(setting, main->error, macro_iki_read_f(f_file_stream_open), setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
 
           break;
         }
 
-        setting->status = f_file_descriptor(&file);
+        setting->state.status = f_file_descriptor(&file);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error_file(setting, main->error, macro_iki_read_f(f_file_descriptor), setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
 
           break;
@@ -95,9 +95,9 @@ extern "C" {
 
         size_file = 0;
 
-        setting->status = f_file_size_by_id(file, &size_file);
+        setting->state.status = f_file_size_by_id(file, &size_file);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error_file(setting, main->error, macro_iki_read_f(f_file_size_by_id), setting->files.array[i], f_file_operation_analyze_s, fll_error_file_type_file_e);
 
           break;
@@ -122,9 +122,9 @@ extern "C" {
         }
 
         // Pre-allocate entire file buffer plus space for the terminating NULL.
-        setting->status = f_string_dynamic_increase_by(size_file + 1, &setting->buffer);
+        setting->state.status = f_string_dynamic_increase_by(size_file + 1, &setting->buffer);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error_file(setting, main->error, macro_iki_read_f(f_string_dynamic_increase_by), setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
 
           break;
@@ -136,17 +136,17 @@ extern "C" {
           if (size_file > iki_read_block_max && fll_program_standard_signal_received(main)) {
             fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-            setting->status = F_status_set_error(F_interrupt);
+            setting->state.status = F_status_set_error(F_interrupt);
 
             break;
           }
 
-          setting->status = f_file_stream_read_until(file, size_block, &setting->buffer);
-          if (F_status_is_error(setting->status)) break;
+          setting->state.status = f_file_stream_read_until(file, size_block, &setting->buffer);
+          if (F_status_is_error(setting->state.status)) break;
         } // for
 
-        if (F_status_is_error(setting->status)) {
-          if (F_status_set_fine(setting->status) != F_interrupt) {
+        if (F_status_is_error(setting->state.status)) {
+          if (F_status_set_fine(setting->state.status) != F_interrupt) {
             iki_read_print_error_file(setting, main->error, macro_iki_read_f(f_file_stream_read_until), setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
           }
 
@@ -157,22 +157,19 @@ extern "C" {
         f_file_stream_close(&file);
 
         iki_read_process_buffer(main, setting);
-        if (F_status_is_error(setting->status)) break;
+        if (F_status_is_error(setting->state.status)) break;
 
         setting->buffer.used = 0;
       } // for
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         f_file_stream_flush(file);
         f_file_stream_close(&file);
       }
     }
 
-    if (F_status_is_error(setting->status)) {
-      iki_read_print_line_last_locked(setting, main->error);
-    }
-    else if (setting->status != F_interrupt) {
-      iki_read_print_line_last_locked(setting, main->message);
+    if (F_status_is_error(setting->state.status)) {
+      iki_read_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
     }
   }
 #endif // _di_iki_read_main_
index 350cbeffdca34fbaf297bc682e952365db7d0946..3848d5f6e473d3f7ec62b9d7433c876d69b53406 100644 (file)
@@ -77,7 +77,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
index 058f37d450f619e8dd6b36012ec99da928174e9d..36132a1dc78ed724d69842f8fadd9b39e31fa128 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    iki_read_setting_load(arguments, state, &data, &setting);
+    iki_read_setting_load(arguments, &data, &setting);
   }
 
   iki_read_main(&data, &setting);
index e667b4f0dfcb7bbf9862105f831c6dd28c0c7ee5..e062eca67f96f62b32d63f0e333194829bb2f4cb 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     iki_read_print_line_first_locked(setting, print);
-    fll_error_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e);
+    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
 
     return F_none;
   }
@@ -23,7 +23,7 @@ extern "C" {
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     iki_read_print_line_first_locked(setting, print);
-    fll_error_file_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e, name, operation, type);
+    fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
 
     return F_none;
   }
@@ -129,7 +129,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -144,7 +144,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -159,7 +159,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -174,7 +174,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
index 8883895217c3d2ee1eb68c1c5ce16e9f05e2db03..b651fd9db06bab97c675109a78b29de1f6a3de88 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -38,7 +38,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param function
@@ -67,7 +67,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -88,7 +88,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -110,7 +110,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -132,7 +132,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -154,7 +154,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index 4ac7eb3c0774b5ce800ceba2d3d2d85d51cd758d..8369be381e6612ac09b2c437f73f391e837e3aa1 100644 (file)
@@ -26,7 +26,7 @@ extern "C" {
  *   The setting.map_wraps is expected to be defined as a valid pointer to an array.
  *   The setting.map_replaces is expected to be defined as a valid pointer to an array.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param index
  *   The index used to identify the desired range in variable, content, and ranges.
  */
@@ -42,7 +42,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param index
  *   The index within the setting->map_wraps array to print.
  */
@@ -58,7 +58,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param index
  *   The index within the setting->map_wraps array to print.
  */
index 3d501c833822b00b26ba39e555142e541f3825de..29145c7cfc487bcc4bad93094672607bd0daac10 100644 (file)
@@ -87,7 +87,7 @@ extern "C" {
   void iki_read_process_line(fll_program_data_t * const main, iki_read_setting_t * const setting, f_string_range_t *range) {
 
     if (!(setting->flag & iki_read_main_flag_line_e)) {
-      setting->status = F_false;
+      setting->state.status = F_false;
 
       return;
     }
@@ -108,10 +108,10 @@ extern "C" {
         if (setting->buffer.string[range->stop] == f_string_eol_s.string[0]) break;
       } // for
 
-      setting->status = F_true;
+      setting->state.status = F_true;
     }
     else {
-      setting->status = F_data_not;
+      setting->state.status = F_data_not;
     }
   }
 #endif // _di_iki_read_process_line_
@@ -122,8 +122,8 @@ extern "C" {
     if (setting->flag & iki_read_main_flag_total_e) {
       iki_read_process_buffer_total(main, setting);
 
-      if (F_status_is_error_not(setting->status)) {
-        setting->status = F_none;
+      if (F_status_is_error_not(setting->state.status)) {
+        setting->state.status = F_none;
       }
 
       return;
@@ -133,15 +133,15 @@ extern "C" {
 
     iki_read_process_line(main, setting, &buffer_range);
 
-    if (setting->status == F_true) {
+    if (setting->state.status == F_true) {
       if (buffer_range.start > setting->buffer.used) {
-        setting->status = F_data_not;
+        setting->state.status = F_data_not;
 
         return;
       }
     }
-    else if (setting->status == F_data_not) {
-      setting->status = F_data_not;
+    else if (setting->state.status == F_data_not) {
+      setting->state.status = F_data_not;
 
       return;
     }
@@ -153,8 +153,8 @@ extern "C" {
       iki_read_process_buffer_ranges(main, setting, &buffer_range);
     }
 
-    if (F_status_is_error_not(setting->status)) {
-      setting->status = F_none;
+    if (F_status_is_error_not(setting->state.status)) {
+      setting->state.status = F_none;
     }
   }
 #endif // _di_iki_read_process_buffer_
@@ -165,10 +165,10 @@ extern "C" {
     {
       const f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
 
-      setting->status = fl_iki_read(&setting->buffer, buffer_range, &setting->data, state);
+      setting->state.status = fl_iki_read(&setting->buffer, buffer_range, &setting->data, state);
     }
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
 
       return;
@@ -224,10 +224,10 @@ extern "C" {
       f_file_stream_unlock(main->output.to);
 
       if (unmatched) {
-        setting->status = F_data_not;
+        setting->state.status = F_data_not;
       }
       else {
-        setting->status = F_none;
+        setting->state.status = F_none;
       }
     }
     else {
@@ -242,10 +242,10 @@ extern "C" {
 
             f_file_stream_unlock(main->output.to);
 
-            setting->status = F_none;
+            setting->state.status = F_none;
           }
           else {
-            setting->status = F_data_not;
+            setting->state.status = F_data_not;
           }
         }
         else {
@@ -260,11 +260,11 @@ extern "C" {
 
           f_file_stream_unlock(main->output.to);
 
-          setting->status = F_none;
+          setting->state.status = F_none;
         }
       }
       else {
-        setting->status = F_data_not;
+        setting->state.status = F_data_not;
       }
     }
   }
@@ -278,10 +278,10 @@ extern "C" {
     {
       const f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
 
-      setting->status = fl_iki_read(&setting->buffer, &range, &setting->data, state);
+      setting->state.status = fl_iki_read(&setting->buffer, &range, &setting->data, state);
     }
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
 
       return;
@@ -296,7 +296,7 @@ extern "C" {
     if (!setting->data.variable.used) {
       fll_print_dynamic_partial(setting->buffer, buffer_range, main->output.to);
 
-      setting->status = F_none;
+      setting->state.status = F_none;
 
       return;
     }
@@ -361,7 +361,7 @@ extern "C" {
       f_file_stream_unlock(main->output.to);
     }
 
-    setting->status = F_none;
+    setting->state.status = F_none;
   }
 #endif // _di_iki_read_process_buffer_ranges_whole_
 
@@ -372,19 +372,19 @@ extern "C" {
 
     iki_read_process_line(main, setting, &range);
 
-    if (setting->status == F_true) {
+    if (setting->state.status == F_true) {
       if (range.start > setting->buffer.used) {
         fll_print_format("%r%r", main->output.to, f_string_ascii_0_s, f_string_eol_s);
 
-        setting->status = F_none;
+        setting->state.status = F_none;
 
         return;
       }
     }
-    else if (setting->status == F_data_not) {
+    else if (setting->state.status == F_data_not) {
       fll_print_format("%r%r", main->output.to, f_string_ascii_0_s, f_string_eol_s);
 
-      setting->status = F_none;
+      setting->state.status = F_none;
 
       return;
     }
@@ -392,10 +392,10 @@ extern "C" {
     {
       f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
 
-      setting->status = fl_iki_read(&setting->buffer, &range, &setting->data, state);
+      setting->state.status = fl_iki_read(&setting->buffer, &range, &setting->data, state);
     }
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
 
       return;
@@ -424,7 +424,7 @@ extern "C" {
 
             f_string_dynamic_resize(0, &name);
 
-            setting->status = F_status_set_error(F_interrupt);
+            setting->state.status = F_status_set_error(F_interrupt);
 
             return;
           }
@@ -435,9 +435,9 @@ extern "C" {
         index = main->parameters.array[iki_read_parameter_name_e].values.array[i];
         name.used = 0;
 
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &name);
+        setting->state.status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &name);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_append_nulless));
 
           f_string_dynamic_resize(0, &name);
@@ -449,9 +449,9 @@ extern "C" {
 
         for (j = 0; j < setting->data.vocabulary.used; ++j) {
 
-          setting->status = fl_string_dynamic_partial_compare(name, setting->buffer, range, setting->data.vocabulary.array[j]);
+          setting->state.status = fl_string_dynamic_partial_compare(name, setting->buffer, range, setting->data.vocabulary.array[j]);
 
-          if (setting->status == F_equal_to) ++total;
+          if (setting->state.status == F_equal_to) ++total;
         } // for
       } // for
 
@@ -473,7 +473,7 @@ extern "C" {
 
     fll_print_format("%ul%r", main->output.to, total, f_string_eol_s);
 
-    setting->status = F_none;
+    setting->state.status = F_none;
   }
 #endif // _di_iki_read_process_buffer_total_
 
index 3d554b9d245da7a3e73dbc9e13ad594b223d4455..724fd377a3cc9e3f16982fb8385be93d598653f9 100644 (file)
@@ -67,7 +67,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_true is returned if the range is processed.
  *     F_false is returned if the range is not processed.
  *     F_data_not if the range is processed, but the requested line is out of range.
@@ -88,7 +88,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_data_not on success, but nothing done.
  *
index 4e7cbedc3beac474e0e770c915abb6bdc04fcf77..b3d9a4dd1dabd3783f06246c9fdd4fb41bd51926 100644 (file)
@@ -22,16 +22,15 @@ extern "C" {
 #endif // _di_iki_write_setting_delete_
 
 #ifndef _di_iki_write_setting_load_
-  void iki_write_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, iki_write_setting_t * const setting) {
+  void iki_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, iki_write_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_write_print_error(setting, main->error, macro_iki_write_f(f_console_parameter_process));
 
       return;
@@ -48,9 +47,9 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_write_print_error(setting, main->error, macro_iki_write_f(fll_program_parameter_process_context));
 
           return;
@@ -79,9 +78,9 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_write_print_error(setting, main->error, macro_iki_write_f(fll_program_parameter_process_verbosity));
 
           return;
@@ -113,7 +112,7 @@ extern "C" {
 
     if (main->parameters.array[iki_write_parameter_file_e].result & f_console_result_value_e && main->parameters.array[iki_write_parameter_file_e].values.used) {
       if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_write_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
@@ -126,11 +125,11 @@ extern "C" {
       main->output.to.id = -1;
       main->output.to.stream = 0;
 
-      setting->status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
+      setting->state.status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_write_print_line_first_locked(setting, main->error);
-        fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", fll_error_file_flag_fallback_e, main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
+        fll_error_file_print(main->error, F_status_set_fine(setting->state.status), "f_file_stream_open", fll_error_file_flag_fallback_e, main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
 
         return;
       }
@@ -138,7 +137,7 @@ extern "C" {
       setting->flag |= iki_write_main_flag_file_to_e;
     }
     else if (main->parameters.array[iki_write_parameter_file_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_write_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
@@ -151,9 +150,9 @@ extern "C" {
 
       setting->objects.used = 0;
 
-      setting->status = f_string_dynamics_resize(values->used, &setting->objects);
+      setting->state.status = f_string_dynamics_resize(values->used, &setting->objects);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamics_resize));
 
         return;
@@ -172,7 +171,7 @@ extern "C" {
       setting->flag |= iki_write_main_flag_object_e;
     }
     else if (main->parameters.array[iki_write_parameter_object_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_write_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_object_s);
@@ -185,9 +184,9 @@ extern "C" {
 
       setting->contents.used = 0;
 
-      setting->status = f_string_dynamics_resize(values->used, &setting->contents);
+      setting->state.status = f_string_dynamics_resize(values->used, &setting->contents);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamics_resize));
 
         return;
@@ -206,7 +205,7 @@ extern "C" {
       setting->flag |= iki_write_main_flag_content_e;
     }
     else if (main->parameters.array[iki_write_parameter_content_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_write_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_content_s);
@@ -215,7 +214,7 @@ extern "C" {
     }
 
     if (!(main->pipe & fll_program_data_pipe_input_e) && !(setting->flag & (iki_write_main_flag_content_e | iki_write_parameter_object_e))) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       iki_write_print_line_first_locked(setting, main->error);
       iki_write_print_error_main_missing(setting, main->error);
index 4378c8cf4789a0a8274ff5fbad003fa3bb9e6f54..0b2e49e5c97b2c61b3a69b737df14be039e5b7d1 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -47,7 +47,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
@@ -55,8 +55,6 @@ extern "C" {
  *     Errors (with error bit) from: f_string_dynamics_resize().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
  *     Errors (with error bit) from: fll_program_parameter_process_verbosity().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see f_file_stream_open()
@@ -65,7 +63,7 @@ extern "C" {
  * @see fll_program_parameter_process_verbosity()
  */
 #ifndef _di_iki_write_setting_load_
-  extern void iki_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, iki_write_setting_t * const setting, f_state_t * const state);
+  extern void iki_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, iki_write_setting_t * const setting);
 #endif // _di_iki_write_setting_load_
 
 /**
@@ -77,7 +75,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index bc4c8c4e3bc7c7f54187b0dd097c18877e642e7d..77fc5a4631c5d68a887b67eb7c6254310a02557e 100644 (file)
@@ -11,13 +11,13 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_write_print_line_last_locked(setting, main->error);
 
       return;
     }
 
-    setting->status = F_none;
+    setting->state.status = F_none;
 
     if (setting->flag & iki_write_main_flag_help_e) {
       iki_write_print_help(setting, main->message);
@@ -59,7 +59,7 @@ extern "C" {
       do {
         if (!((++main->signal_check) % iki_write_signal_check_d)) {
           if (fll_program_standard_signal_received(main)) {
-            setting->status = F_status_set_error(F_interrupt);
+            setting->state.status = F_status_set_error(F_interrupt);
 
             return;
           }
@@ -71,7 +71,7 @@ extern "C" {
           status = f_file_read(pipe, &setting->buffer);
 
           if (F_status_is_error(status)) {
-            setting->status = F_status_set_error(F_pipe);
+            setting->state.status = F_status_set_error(F_pipe);
 
             iki_write_print_error_file(setting, main->error, macro_iki_write_f(f_file_read), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
 
@@ -79,7 +79,7 @@ extern "C" {
           }
 
           if (!setting->buffer.used) {
-            setting->status = F_status_set_error(F_parameter);
+            setting->state.status = F_status_set_error(F_parameter);
 
             iki_write_print_line_first_locked(setting, main->error);
             fll_program_print_error_pipe_missing_content(main->error);
@@ -92,20 +92,20 @@ extern "C" {
         }
 
         previous = range.start;
-        setting->status = f_string_dynamic_seek_to(setting->buffer, f_string_ascii_feed_form_s.string[0], &range);
+        setting->state.status = f_string_dynamic_seek_to(setting->buffer, f_string_ascii_feed_form_s.string[0], &range);
 
-        if (setting->status == F_data_not_stop) {
-          setting->status = F_status_set_error(F_parameter);
+        if (setting->state.status == F_data_not_stop) {
+          setting->state.status = F_status_set_error(F_parameter);
         }
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamic_seek_to));
 
           return;
         }
 
         if (object_ended && previous == range.start) {
-          setting->status = F_status_set_error(F_parameter);
+          setting->state.status = F_status_set_error(F_parameter);
 
           iki_write_print_line_first_locked(setting, main->error);
           fll_program_print_error_pipe_invalid_form_feed(main->error);
@@ -121,9 +121,9 @@ extern "C" {
           setting->content.used = 0;
 
           if (setting->buffer.used) {
-            setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->content);
+            setting->state.status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->content);
 
-            if (F_status_is_error(setting->status)) {
+            if (F_status_is_error(setting->state.status)) {
               iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamic_partial_append_nulless));
 
               return;
@@ -131,7 +131,7 @@ extern "C" {
           }
 
           iki_write_process(main, setting, setting->object, setting->content);
-          if (F_status_is_error(setting->status)) return;
+          if (F_status_is_error(setting->state.status)) return;
 
           fll_print_dynamic_raw(f_string_eol_s, main->output.to);
 
@@ -140,9 +140,9 @@ extern "C" {
         else {
           setting->object.used = 0;
 
-          setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->object);
+          setting->state.status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->object);
 
-          if (F_status_is_error(setting->status)) {
+          if (F_status_is_error(setting->state.status)) {
             iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamic_partial_append_nulless));
 
             return;
@@ -164,7 +164,7 @@ extern "C" {
       } while (status != F_none_eof || setting->buffer.used || object_ended);
 
       if (object_ended) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         iki_write_print_line_first_locked(setting, main->error);
         fll_program_print_error_pipe_object_without_content(main->error);
@@ -178,7 +178,7 @@ extern "C" {
 
       if (!((++main->signal_check) % iki_write_signal_check_d)) {
         if (fll_program_standard_signal_received(main)) {
-          setting->status = F_status_set_error(F_interrupt);
+          setting->state.status = F_status_set_error(F_interrupt);
 
           break;
         }
@@ -187,16 +187,13 @@ extern "C" {
       }
 
       iki_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
-      if (F_status_is_error(setting->status)) break;
+      if (F_status_is_error(setting->state.status)) break;
 
       fll_print_dynamic_raw(f_string_eol_s, main->output.to);
     } // for
 
-    if (F_status_is_error(setting->status)) {
-      iki_write_print_line_last_locked(setting, main->error);
-    }
-    else if (setting->status != F_interrupt) {
-      iki_write_print_line_last_locked(setting, main->message);
+    if (F_status_is_error(setting->state.status)) {
+      iki_write_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
     }
   }
 #endif // _di_iki_write_main_
index 5c1151d79be4f0c34f1be9b74a393e50898aa4d8..68e4f63088f3edfae3dbf4a9f926ce86e16f9d36 100644 (file)
@@ -77,7 +77,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
index f6fca27f7c4383d9ca117727be3ef78ac848928a..b4dfcf8e85a0552dd3ee25beee8c3a87d0628b27 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    iki_write_setting_load(arguments, state, &data, &setting);
+    iki_write_setting_load(arguments, &data, &setting);
   }
 
   iki_write_main(&data, &setting);
index 2e16d3242f493abab4a79f513c842237b97eb1f9..6cfc8eaf0d443a1072e95316747542c6fefb488b 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     iki_write_print_line_first_locked(setting, print);
-    fll_error_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e);
+    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
 
     return F_none;
   }
@@ -23,7 +23,7 @@ extern "C" {
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     iki_write_print_line_first_locked(setting, print);
-    fll_error_file_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e, name, operation, type);
+    fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
 
     return F_none;
   }
@@ -125,7 +125,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -140,7 +140,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -155,7 +155,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -170,7 +170,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
index 88f9ff776aec54e65d384990d78e314b534373db..27937067909d00c5e6d25f610112945e0e081e39 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -38,7 +38,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param function
@@ -67,7 +67,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -85,7 +85,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param object
@@ -105,7 +105,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -127,7 +127,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -149,7 +149,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -171,7 +171,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -193,7 +193,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index f65dde35f59ac849fa68ac4143ff565adfa87734..9c77471d7e91629d267546d3755262eb19fcc5e3 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
   void iki_write_process(fll_program_data_t * const main, iki_write_setting_t * const setting, const f_string_static_t object, const f_string_static_t content) {
 
     if (!object.used) {
-      setting->status = F_status_set_error(F_failure);
+      setting->state.status = F_status_set_error(F_failure);
 
       if (main->error.verbosity != f_console_verbosity_quiet_e) {
         iki_write_print_line_first_locked(setting, main->error);
@@ -20,17 +20,17 @@ extern "C" {
       return;
     }
 
-    setting->status = f_iki_object_is(object);
+    setting->state.status = f_iki_object_is(object);
 
-    if (setting->status == F_false) {
-      setting->status = F_status_set_error(F_failure);
+    if (setting->state.status == F_false) {
+      setting->state.status = F_status_set_error(F_failure);
 
       iki_write_print_error_object_not_valid(setting, main->error, object);
 
       return;
     }
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_write_print_error(setting, main->error, macro_iki_write_f(f_iki_object_is));
 
       return;
@@ -38,9 +38,9 @@ extern "C" {
 
     setting->escaped.used = 0;
 
-    setting->status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
+    setting->state.status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       iki_write_print_error(setting, main->error, macro_iki_write_f(fll_iki_content_escape));
 
       return;
index 55051d41e6420207ee28ad1c4af6fd217a00f556..ee23ec1abd4348c3be8ca23f6c3c131bc2e10de9 100644 (file)
@@ -20,7 +20,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_iki_object_is().
index bbd1669a72e0c39235d9fa090530237456125017..59737c3f8c32a1aecbcc487f7dc58405a543af1e 100644 (file)
@@ -25,9 +25,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    status_code_setting_load(arguments, state, &data, &setting);
+    status_code_setting_load(arguments, &data, &setting);
   }
 
   status_code_main(&data, &setting);
@@ -38,5 +37,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return (F_status_is_error(setting.status) || setting.status == F_false) ? 1 : 0;
+  return (F_status_is_error(setting.state.status) || setting.state.status == F_false) ? 1 : 0;
 }
index 5cb2e92b26a089086ab1b7485eaa35032b286e70..7efd9a6cc17220cac96da051ba6d61a3fa4389f3 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type status_code_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
index 61c4aa95cc9b41f4baea9b4e4285dfa79b71289c..2e2758678d5ebc9e64dae0fd9d9ade2163608456 100644 (file)
@@ -145,7 +145,7 @@ extern "C" {
   #define status_code_setting_t_initialize \
     { \
       status_code_main_flag_none_e, \
-      f_state_initialize_t, \
+      f_state_t_initialize, \
       f_string_static_t_initialize, \
       f_string_static_t_initialize, \
       0, \
index 9eb9ad3bfefa80bd647072eb9a9184825a55afb2..6fcb6ee3de7b5c3212a9e3841d2249c7aef9b0d8 100644 (file)
@@ -14,14 +14,13 @@ extern "C" {
 #endif // _di_status_code_setting_delete_
 
 #ifndef _di_status_code_setting_load_
-  void status_code_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, status_code_setting_t * const setting) {
+  void status_code_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, status_code_setting_t * const setting) {
 
     if (!main || !setting) return;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       status_code_print_error(setting, main->error, macro_status_code_f(f_console_parameter_process));
 
       return;
@@ -38,9 +37,9 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           status_code_print_error(setting, main->error, macro_status_code_f(fll_program_parameter_process_context));
 
           return;
@@ -69,9 +68,9 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           status_code_print_error(setting, main->error, macro_status_code_f(fll_program_parameter_process_verbosity));
 
           return;
@@ -116,7 +115,7 @@ extern "C" {
     if (setting->flag & status_code_main_flag_error_e) {
       if (setting->flag & status_code_main_flag_warning_e) {
         if (!(setting->flag & status_code_main_flag_number_e)) {
-          setting->status = F_status_set_error(F_parameter);
+          setting->state.status = F_status_set_error(F_parameter);
 
           status_code_print_line_first_locked(setting, main->error);
           status_code_print_error_cannot_error_warning_number(setting, main->error);
@@ -126,7 +125,7 @@ extern "C" {
       }
 
       if (setting->flag & status_code_main_flag_fine_e) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         status_code_print_line_first_locked(setting, main->error);
         fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_error_s, status_code_long_fine_s);
@@ -135,7 +134,7 @@ extern "C" {
       }
     }
     else if (setting->flag & status_code_main_flag_warning_e && setting->flag & status_code_main_flag_fine_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       status_code_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_warning_s, status_code_long_fine_s);
@@ -144,7 +143,7 @@ extern "C" {
     }
 
     if (main->parameters.remaining.used == 0 && !(main->pipe & fll_program_data_pipe_input_e)) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       status_code_print_line_first_locked(setting, main->error);
       status_code_print_error_no_status_codes(setting, main->error);
index faf1365ac81c2acfc3318465a1504ab5777078a0..701ae3209ce8dbd096a556a591e7630fd39ecc9b 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -47,19 +47,17 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
- * @param state
- *   A state for providing flags and handling interrupts during long running operations.
  *
  * @see f_console_parameter_process()
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_status_code_setting_load_
-  extern void status_code_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, status_code_setting_t * const setting, f_state_t * const state);
+  extern void status_code_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, status_code_setting_t * const setting);
 #endif // _di_status_code_setting_load_
 
 /**
@@ -71,7 +69,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index ad08ffab4e737ca876f99271dba1f3ff18e8fbac..185ea771fe982b639ccfdd4824f7784353ffa142 100644 (file)
@@ -23,9 +23,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    status_code_setting_load(arguments, state, &data, &setting);
+    status_code_setting_load(arguments, &data, &setting);
   }
 
   status_code_main(&data, &setting);
@@ -36,5 +35,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return (F_status_is_error(setting.status) || setting.status == F_false) ? 1 : 0;
+  return (F_status_is_error(setting.state.status) || setting.state.status == F_false) ? 1 : 0;
 }
index 5e830271c24cef946748f7db91fce5a391064243..eab0e34af8acfba3d88647bb97ee15c08044869c 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     status_code_print_line_first_locked(setting, print);
-    fll_error_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e);
+    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
 
     return F_none;
   }
@@ -101,8 +101,8 @@ extern "C" {
       status_code_program_help_parameters_s
     );
 
-    if (setting->status_string_help_detail) {
-      setting->status_string_help_detail(setting, print);
+    if (setting->state.status_string_help_detail) {
+      setting->state.status_string_help_detail(setting, print);
     }
 
     f_print_dynamic_raw(setting->line_last, print.to);
@@ -138,7 +138,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -153,7 +153,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -168,7 +168,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
@@ -183,7 +183,7 @@ extern "C" {
 
     if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
index 9252fbecef43d9b84d452cff3005a373148f5219..b584240b3b7e0fd09753fafb2ab821acb240d329 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -38,7 +38,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -56,7 +56,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -74,7 +74,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param name
@@ -95,7 +95,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -117,7 +117,7 @@ extern "C" {
  *   The main program settings.
  *   (Must be of type status_code_setting_t.)
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
@@ -137,7 +137,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -159,7 +159,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -181,7 +181,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -202,7 +202,7 @@ extern "C" {
  *
  * @param setting
  *   The main program settings.
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
index 132cbc0f973615fe56b513631ad99ef912f98b0e..bfd3a185bcbd3fefeac1abbda7b33660d36f2cf2 100644 (file)
@@ -20,21 +20,21 @@ extern "C" {
  * @param value
  *   The parameter value to process.
  *
- * @return
- *   F_none on success.
- *   F_data_not if string starts wth a null (length is 0).
- *   F_parameter (with error bit) if a parameter is invalid.
- *   F_number (with error bit) if parameter is not a number.
- *   F_number_negative (with error bit) on negative value.
- *   F_number_overflow (with error bit) on integer overflow.
- *   F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment is found.
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *     F_data_not if string starts wth a null (length is 0).
+ *     F_parameter (with error bit) if a parameter is invalid.
+ *     F_number (with error bit) if parameter is not a number.
+ *     F_number_negative (with error bit) on negative value.
+ *     F_number_overflow (with error bit) on integer overflow.
+ *     F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment is found.
  *
- *   Errors (with error bit) from: fss_status_code_convert_number().
+ *     Errors (with error bit) from: fss_status_code_convert_number().
  *
  * @see fss_status_code_convert_number()
  */
 #ifndef _di_status_code_process_check_
-  extern f_status_t status_code_process_check(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) F_attribute_visibility_internal_d;
+  extern void status_code_process_check(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) F_attribute_visibility_internal_d;
 #endif // _di_status_code_process_check_
 
 /**
@@ -45,21 +45,20 @@ extern "C" {
  * @param value
  *   The parameter value to process.
  *
- * @return
- *   F_none on success.
- *   F_data_not if string is empty.
- *
- *   Errors (with error bit) from: fl_console_parameter_to_number_unsigned().
- *   Errors (with error bit) from: fll_fss_status_string_to().
- *   Errors (with error bit) from: fll_status_string_from().
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *     F_data_not if string is empty.
  *
+ *     Errors (with error bit) from: fl_console_parameter_to_number_unsigned().
+ *     Errors (with error bit) from: fll_fss_status_string_to().
+ *     Errors (with error bit) from: fll_status_string_from().
  *
  * @see fl_console_parameter_to_number_unsigned()
  * @see fll_fss_status_string_from()
  * @see fll_status_string_from()
  */
 #ifndef _di_status_code_process_number_
-  extern f_status_t status_code_process_number(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) F_attribute_visibility_internal_d;
+  extern void status_code_process_number(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) F_attribute_visibility_internal_d;
 #endif // _di_status_code_process_number_
 
 /**
@@ -70,25 +69,25 @@ extern "C" {
  * @param value
  *   The parameter value to process.
  *
- * @return
- *   F_none on success.
- *   F_data_not if string starts wth a null (length is 0).
- *   F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment is found.
- *   F_number (with error bit) if parameter is not a number.
- *   F_number_negative (with error bit) on negative value.
- *   F_number_overflow (with error bit) on integer overflow.
- *   F_parameter (with error bit) if a parameter is invalid.
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *     F_data_not if string starts wth a null (length is 0).
+ *     F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment is found.
+ *     F_number (with error bit) if parameter is not a number.
+ *     F_number_negative (with error bit) on negative value.
+ *     F_number_overflow (with error bit) on integer overflow.
+ *     F_parameter (with error bit) if a parameter is invalid.
  *
- *   Errors (with error bit) from: f_status_string_to().
- *   Errors (with error bit) from: fll_fss_status_string_to().
- *   Errors (with error bit) from: fss_status_code_convert_number().
+ *     Errors (with error bit) from: f_status_string_to().
+ *     Errors (with error bit) from: fll_fss_status_string_to().
+ *     Errors (with error bit) from: fss_status_code_convert_number().
  *
  * @see f_status_string_to()
  * @see fll_fss_status_string_to()
  * @see fss_status_code_convert_number()
  */
 #ifndef _di_status_code_process_normal_
-  extern f_status_t status_code_process_normal(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) F_attribute_visibility_internal_d;
+  extern void status_code_process_normal(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) F_attribute_visibility_internal_d;
 #endif // _di_status_code_process_normal_
 
 /**
@@ -102,21 +101,21 @@ extern "C" {
  *   The converted number.
  *   Will not be updated on error.
  *
- * @return
- *   F_none on success.
- *   F_data_not if string starts wth a null (length is 0).
- *   F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment is found.
- *   F_number (with error bit) if parameter is not a number.
- *   F_number_negative (with error bit) on negative value.
- *   F_number_overflow (with error bit) on integer overflow.
- *   F_parameter (with error bit) if a parameter is invalid.
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *     F_data_not if string starts wth a null (length is 0).
+ *     F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment is found.
+ *     F_number (with error bit) if parameter is not a number.
+ *     F_number_negative (with error bit) on negative value.
+ *     F_number_overflow (with error bit) on integer overflow.
+ *     F_parameter (with error bit) if a parameter is invalid.
  *
- *   Errors (with error bit) from: fl_console_parameter_to_number_unsigned().
+ *     Errors (with error bit) from: fl_console_parameter_to_number_unsigned().
  *
  * @see fl_console_parameter_to_number_unsigned()
  */
 #ifndef _di_status_code_convert_number_
-  extern f_status_t status_code_convert_number(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+  extern void status_code_convert_number(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
 #endif // _di_status_code_convert_number_
 
 #ifdef __cplusplus
index 2520a464cd1f4516973b588728921bde9e880b20..8d3e864871d5795533fe94d6cd84e9668e5e5ea0 100644 (file)
@@ -10,28 +10,28 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       status_code_print_line_last_locked(setting, main->error);
 
       return;
     }
 
-    if (!setting->status_string_from || !setting->status_string_to) {
+    if (!setting->state.status_string_from || !setting->state.status_string_to) {
 
-      if (!setting->status_string_from) {
+      if (!setting->state.status_string_from) {
         status_code_print_error_invalid_callback(setting, main->error, macro_status_code_f(status_string_from));
       }
 
-      if (!setting->status_string_to) {
+      if (!setting->state.status_string_to) {
         status_code_print_error_invalid_callback(setting, main->error, macro_status_code_f(status_string_to));
       }
 
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       return;
     }
 
-    setting->status = F_none;
+    setting->state.status = F_none;
 
     if (setting->flag & status_code_main_flag_help_e) {
       status_code_print_help(setting, main->message);
@@ -69,7 +69,7 @@ extern "C" {
 
               fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-              setting->status = F_status_set_error(F_interrupt);
+              setting->state.status = F_status_set_error(F_interrupt);
 
               return;
             }
@@ -79,8 +79,8 @@ extern "C" {
 
           status2 = status_code_process_number(main, setting, main->parameters.arguments.array[main->parameters.remaining.array[i]]);
 
-          if (F_status_is_error(status2) && setting->status == F_none) {
-            setting->status = status2;
+          if (F_status_is_error(status2) && setting->state.status == F_none) {
+            setting->state.status = status2;
           }
         } // for
 
@@ -103,7 +103,7 @@ extern "C" {
 
               fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-              setting->status = F_status_set_error(F_interrupt);
+              setting->state.status = F_status_set_error(F_interrupt);
 
               return;
             }
@@ -113,8 +113,8 @@ extern "C" {
 
           status2 = status_code_process_check(main, setting, main->parameters.arguments.array[main->parameters.remaining.array[i]]);
 
-          if (F_status_is_error(status2) && setting->status == F_none) {
-            setting->status = status2;
+          if (F_status_is_error(status2) && setting->state.status == F_none) {
+            setting->state.status = status2;
           }
         } // for
 
@@ -137,7 +137,7 @@ extern "C" {
 
               fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-              setting->status = F_status_set_error(F_interrupt);
+              setting->state.status = F_status_set_error(F_interrupt);
 
               return;
             }
@@ -147,8 +147,8 @@ extern "C" {
 
           status2 = status_code_process_normal(main, setting, main->parameters.arguments.array[main->parameters.remaining.array[i]]);
 
-          if (F_status_is_error(status2) && setting->status == F_none) {
-            setting->status = status2;
+          if (F_status_is_error(status2) && setting->state.status == F_none) {
+            setting->state.status = status2;
           }
         } // for
 
@@ -156,11 +156,8 @@ extern "C" {
       }
     }
 
-    if (F_status_is_error(setting->status)) {
-      status_code_print_line_last_locked(setting, main->error);
-    }
-    else if (setting->status != F_interrupt) {
-      status_code_print_line_last_locked(setting, main->message);
+    if (F_status_is_error(setting->state.status)) {
+      status_code_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
     }
   }
 #endif // _di_status_code_main_
index e60584cd3ab7f2cdf1efa14d269097c9b085da09..250c52273a78e096136dc3b861f0655383268693 100644 (file)
@@ -68,7 +68,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
diff --git a/level_3/utf8/c/main/bytesequence.c b/level_3/utf8/c/main/bytesequence.c
new file mode 100644 (file)
index 0000000..74e9d9b
--- /dev/null
@@ -0,0 +1,162 @@
+#include "utf8.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_utf8_convert_bytesequence_
+  void utf8_convert_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
+
+    if (!main || !setting) return;
+
+    bool valid_not = F_false;
+
+    uint32_t codepoint = 0;
+
+    if (sequence.used) {
+      setting->state.status = f_utf_unicode_to(sequence.string, sequence.used, &codepoint);
+    }
+    else {
+      setting->state.status = F_status_set_error(F_utf_not);
+    }
+
+    if (F_status_is_error(setting->state.status)) {
+      setting->state.status = F_status_set_fine(setting->state.status);
+
+      if (setting->state.status == F_failure || setting->state.status == F_utf_not || setting->state.status == F_complete_not_utf || setting->state.status == F_utf_fragment || setting->state.status == F_valid_not) {
+        valid_not = F_true;
+
+        utf8_print_character_invalid(setting, main->output, sequence);
+      }
+      else {
+        setting->state.status = F_status_set_error(setting->state.status);
+
+        utf8_print_error_decode(setting, main->error, sequence);
+
+        return;
+      }
+    }
+    else if (!(setting->flag & utf8_main_flag_verify_e)) {
+      if (setting->mode & utf8_mode_to_bytesequence_e) {
+        utf8_print_bytesequence(setting, main->output, sequence);
+      }
+      else if (setting->mode & utf8_mode_to_codepoint_e) {
+        utf8_print_codepoint(setting, main->output, codepoint);
+      }
+      else {
+        utf8_print_combining_or_width(setting, main->output, sequence);
+      }
+    }
+
+    if (valid_not || F_status_is_error(setting->state.status)) {
+      setting->state.status = F_utf_not;
+    }
+    else {
+      setting->state.status = F_none;
+    }
+  }
+#endif // _di_utf8_convert_bytesequence_
+
+#ifndef _di_utf8_process_file_bytesequence_
+  void utf8_process_file_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_file_t file) {
+
+    if (!main || !setting) return;
+
+    bool valid = F_true;
+    bool next = F_true;
+    uint8_t mode_codepoint = utf8_codepoint_mode_ready_e;
+
+    f_array_length_t i = 0;
+    f_array_length_t j = 0;
+
+    f_char_t block[4] = { 0, 0, 0, 0 };
+    f_string_static_t sequence = macro_f_string_static_t_initialize(block, 0, 4);
+
+    do {
+      setting->state.status = f_file_stream_read_block(file, &setting->buffer);
+
+      if (setting->state.status == F_none_eof && !setting->buffer.used) break;
+
+      for (i = 0; F_status_is_error_not(setting->state.status) && i < setting->buffer.used; ) {
+
+        if (!((++main->signal_check) % utf8_signal_check_d)) {
+          if (fll_program_standard_signal_received(main)) {
+            fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+
+            setting->state.status = F_interrupt;
+
+            break;
+          }
+
+          main->signal_check = 0;
+        }
+
+        setting->state.status = F_none;
+
+        // Get the current width only when processing a new block.
+        if (next) {
+          sequence.used = macro_f_utf_byte_width(setting->buffer.string[i]);
+          next = F_false;
+        }
+
+        for (; j < sequence.used && i < setting->buffer.used; ++j, ++i) {
+          sequence.string[j] = setting->buffer.string[i];
+        } // for
+
+        if (j == sequence.used) {
+          if (setting->mode & utf8_mode_from_bytesequence_e) {
+            utf8_convert_bytesequence(main, setting, sequence);
+          }
+          else {
+            utf8_detect_codepoint(main, setting, sequence, &mode_codepoint);
+
+            if (F_status_is_error_not(setting->state.status) && setting->state.status != F_next) {
+              utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
+            }
+          }
+
+          if (setting->state.status == F_utf_not) {
+            valid = F_false;
+          }
+
+          j = 0;
+          next = F_true;
+        }
+      } // for
+
+      i = 0;
+      setting->buffer.used = 0;
+
+    } while (F_status_is_error_not(setting->state.status) && setting->state.status != F_interrupt);
+
+    // Handle last (incomplete) sequence when the buffer ended before the sequence is supposed to end.
+    if (F_status_is_error_not(setting->state.status) && setting->state.status != F_interrupt && next == F_false) {
+      sequence.used = j;
+
+      if (setting->mode & utf8_mode_from_bytesequence_e) {
+        utf8_convert_bytesequence(main, setting, sequence);
+      }
+      else {
+        utf8_detect_codepoint(main, setting, sequence, &mode_codepoint);
+
+        if (F_status_is_error_not(setting->state.status) && setting->state.status != F_next) {
+          utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
+        }
+      }
+
+      if (setting->state.status == F_utf_not) {
+        valid = F_false;
+      }
+    }
+
+    setting->buffer.used = 0;
+
+    if (F_status_is_error(setting->state.status) || setting->state.status == F_interrupt) return;
+
+    setting->state.status = valid;
+  }
+#endif // _di_utf8_process_file_bytesequence_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
similarity index 58%
rename from level_3/utf8/c/main/private-utf8_bytesequence.h
rename to level_3/utf8/c/main/bytesequence.h
index cd2c07556723c6b3726fded7cd408ba2295e3efd..857187cb3fa87d62f3cfd71de6109413a118f45c 100644 (file)
@@ -25,16 +25,16 @@ extern "C" {
  *   A byte sequences representing a single character to convert.
  *   This does not stop on NULL and will process all text until sequence.used.
  *
- * @return
- *   F_none on success.
- *   F_utf_not on invalid UTF-8 (which is still "success" when verifying).
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *     F_utf_not on invalid UTF-8 (which is still "success" when verifying).
  *
- *   F_utf_not (with error bit) if not verifying and
+ *     F_utf_not (with error bit) if not verifying and
  *
- *   Errors (with error bit) from: f_utf_unicode_to()
+ *     Errors (with error bit) from: f_utf_unicode_to()
  */
 #ifndef _di_utf8_convert_bytesequence_
-  extern f_status_t utf8_convert_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) F_attribute_visibility_internal_d;
+  extern void utf8_convert_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) F_attribute_visibility_internal_d;
 #endif // _di_utf8_convert_bytesequence_
 
 /**
@@ -48,20 +48,20 @@ extern "C" {
  *   The file stream to process.
  *   This file may contain NULLs.
  *
- * @return
- *   F_true on success and is valid.
- *   F_false on success and contains invalid sequences.
- *   F_interrupt on (exit) signal received.
+ *   This alters setting.state.status:
+ *     F_true on success and is valid.
+ *     F_false on success and contains invalid sequences.
+ *     F_interrupt on (exit) signal received.
  *
- *   Errors (with error bit) from: utf8_convert_bytesequence()
- *   Errors (with error bit) from: utf8_detect_codepoint()
+ *     Errors (with error bit) from: utf8_convert_bytesequence()
+ *     Errors (with error bit) from: utf8_detect_codepoint()
  *
  * @see fll_program_standard_signal_received()
  * @see utf8_convert_bytesequence()
  * @see utf8_detect_codepoint()
  */
 #ifndef _di_utf8_process_file_bytesequence_
-  extern f_status_t utf8_process_file_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_file_t file) F_attribute_visibility_internal_d;
+  extern void utf8_process_file_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_file_t file) F_attribute_visibility_internal_d;
 #endif // _di_utf8_process_file_bytesequence_
 
 #ifdef __cplusplus
similarity index 60%
rename from level_3/utf8/c/main/private-utf8_codepoint.c
rename to level_3/utf8/c/main/codepoint.c
index d0fb38ed2e2ca35a7ffb16695f531dddb97341d1..97a6688f2af5caa78f79f2d3f36fa74cf95a01b7 100644 (file)
@@ -1,23 +1,22 @@
 #include "utf8.h"
-#include "private-common.h"
-#include "private-utf8.h"
-#include "private-utf8_bytesequence.h"
-#include "private-utf8_codepoint.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #ifndef _di_utf8_convert_codepoint_
-  f_status_t utf8_convert_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t unicode, uint8_t *mode) {
+  void utf8_convert_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t unicode, uint8_t *mode) {
+
+    if (!main || !setting) return;
+
+    setting->state.status = F_none;
 
-    f_status_t status = F_none;
     bool valid_not = F_false;
 
     if (*mode != utf8_codepoint_mode_end_e) {
       if (setting->text.used + unicode.used >= setting->text.size) {
-        status = f_string_dynamic_increase_by(utf8_default_allocation_step_d, &setting->text);
-        if (F_status_is_error(status)) return status;
+        setting->state.status = f_string_dynamic_increase_by(utf8_default_allocation_step_d, &setting->text);
+        if (F_status_is_error(setting->state.status)) return;
       }
 
       for (f_array_length_t i = 0; i < unicode.used; ++i) {
@@ -28,22 +27,22 @@ extern "C" {
     if (*mode == utf8_codepoint_mode_end_e) {
       uint32_t codepoint = 0;
 
-      status = f_utf_unicode_string_to(setting->text.string, setting->text.used, &codepoint);
+      setting->state.status = f_utf_unicode_string_to(setting->text.string, setting->text.used, &codepoint);
 
-      if (F_status_is_error(status)) {
-        status = F_status_set_fine(status);
+      if (F_status_is_error(setting->state.status)) {
+        setting->state.status = F_status_set_fine(setting->state.status);
 
-        if (status == F_failure || status == F_utf_not || status == F_complete_not_utf || status == F_utf_fragment || status == F_valid_not) {
+        if (setting->state.status == F_failure || setting->state.status == F_utf_not || setting->state.status == F_complete_not_utf || setting->state.status == F_utf_fragment || setting->state.status == F_valid_not) {
           valid_not = F_true;
 
           utf8_print_character_invalid(setting, main->output, unicode);
         }
         else {
-          status = F_status_set_error(status);
+          setting->state.status = F_status_set_error(setting->state.status);
 
-          utf8_print_error_decode(setting, main->error, status, unicode);
+          utf8_print_error_decode(setting, main->error, unicode);
 
-          return status;
+          return;
         }
       }
       else if (!(setting->flag & utf8_main_flag_verify_e)) {
@@ -54,24 +53,24 @@ extern "C" {
           f_char_t byte[4] = { 0, 0, 0, 0 };
           f_string_static_t unicode = macro_f_string_static_t_initialize(byte, 0, 4);
 
-          status = f_utf_unicode_from(codepoint, 4, &unicode.string);
+          setting->state.status = f_utf_unicode_from(codepoint, 4, &unicode.string);
 
-          if (F_status_is_error(status)) {
+          if (F_status_is_error(setting->state.status)) {
             if (setting->mode & utf8_mode_to_bytesequence_e) {
-              utf8_print_error_encode(setting, main->error, status, codepoint);
+              utf8_print_error_encode(setting, main->error, codepoint);
             }
             else {
               utf8_print_combining_or_width_invalid(setting, main->output);
             }
           }
           else if (setting->mode & utf8_mode_to_bytesequence_e) {
-            status = F_none;
+            setting->state.status = F_none;
             unicode.used = macro_f_utf_byte_width(unicode.string[0]);
 
             utf8_print_bytesequence(setting, main->output, unicode);
           }
           else {
-            status = F_none;
+            setting->state.status = F_none;
 
             utf8_print_combining_or_width(setting, main->output, unicode);
           }
@@ -79,35 +78,38 @@ extern "C" {
       }
     }
     else if (*mode == utf8_codepoint_mode_bad_end_e) {
-      status = F_none;
+      setting->state.status = F_none;
 
       utf8_print_character_invalid(setting, main->output, unicode);
     }
     else {
-      return F_none;
+      setting->state.status = F_none;
+
+      return;
     }
 
     *mode = utf8_codepoint_mode_ready_e;
     setting->text.used = 0;
 
-    if (valid_not || F_status_is_error(status)) {
-      return F_utf_not;
+    if (valid_not || F_status_is_error(setting->state.status)) {
+      setting->state.status = F_utf_not;
     }
-
-    return status;
   }
 #endif // _di_utf8_convert_codepoint_
 
 #ifndef _di_utf8_convert_raw_
-  f_status_t utf8_convert_raw(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t hex, uint8_t *mode) {
+  void utf8_convert_raw(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t hex, uint8_t *mode) {
+
+    if (!main || !setting) return;
+
+    setting->state.status = F_none;
 
-    f_status_t status = F_none;
     bool valid_not = F_false;
 
     if (*mode != utf8_codepoint_mode_raw_end_e) {
       if (setting->text.used + hex.used >= setting->text.size) {
-        status = f_string_dynamic_increase_by(utf8_default_allocation_step_d, &setting->text);
-        if (F_status_is_error(status)) return status;
+        setting->state.status = f_string_dynamic_increase_by(utf8_default_allocation_step_d, &setting->text);
+        if (F_status_is_error(setting->state.status)) return;
       }
 
       for (f_array_length_t i = 0; i < hex.used; ++i) {
@@ -121,25 +123,25 @@ extern "C" {
       {
         f_number_unsigned_t number = 0;
 
-        status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, setting->text, &number);
+        setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, setting->text, &number);
 
         raw = (f_utf_char_t) number;
       }
 
-      if (F_status_is_error(status)) {
-        status = F_status_set_fine(status);
+      if (F_status_is_error(setting->state.status)) {
+        setting->state.status = F_status_set_fine(setting->state.status);
 
-        if (status == F_number || status == F_utf_not || status == F_complete_not_utf || status == F_utf_fragment || status == F_number_decimal || status == F_number_negative || status == F_number_positive || status == F_number_overflow) {
+        if (setting->state.status == F_number || setting->state.status == F_utf_not || setting->state.status == F_complete_not_utf || setting->state.status == F_utf_fragment || setting->state.status == F_number_decimal || setting->state.status == F_number_negative || setting->state.status == F_number_positive || setting->state.status == F_number_overflow) {
           valid_not = F_true;
 
           utf8_print_character_invalid(setting, main->output, hex);
         }
         else {
-          status = F_status_set_error(status);
+          setting->state.status = F_status_set_error(setting->state.status);
 
-          utf8_print_error_decode(setting, main->error, status, hex);
+          utf8_print_error_decode(setting, main->error, hex);
 
-          return status;
+          return;
         }
       }
       else if (!(setting->flag & utf8_main_flag_verify_e)) {
@@ -163,34 +165,38 @@ extern "C" {
       }
     }
     else if (*mode == utf8_codepoint_mode_bad_end_e) {
-      status = F_none;
+      setting->state.status = F_none;
 
       utf8_print_character_invalid(setting, main->output, hex);
     }
     else {
-      return F_none;
+      setting->state.status = F_none;
+
+      return;
     }
 
     *mode = utf8_codepoint_mode_ready_e;
     setting->text.used = 0;
 
-    if (valid_not || F_status_is_error(status)) {
-      return F_valid_not;
+    if (valid_not || F_status_is_error(setting->state.status)) {
+      setting->state.status = F_valid_not;
     }
-
-    return status;
   }
 #endif // _di_utf8_convert_raw_
 
 #ifndef _di_utf8_detect_codepoint_
-  f_status_t utf8_detect_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t unicode, uint8_t *mode) {
+  void utf8_detect_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t unicode, uint8_t *mode) {
+
+    if (!main || !setting) return;
 
     // Skip past NULL.
     if (!unicode.string[0]) {
-      return F_next;
+      setting->state.status = F_next;
+
+      return;
     }
 
-    f_status_t status = F_none;
+    setting->state.status = F_none;
 
     if (unicode.string[0] == f_string_ascii_u_s.string[0] || unicode.string[0] == f_string_ascii_U_s.string[0] || unicode.string[0] == f_string_ascii_plus_s.string[0]) {
       // Do nothing.
@@ -199,50 +205,40 @@ extern "C" {
       // Do nothing.
     }
     else if (unicode.string[0] == f_string_ascii_space_s.string[0]) {
-      status = F_space;
+      setting->state.status = F_space;
     }
     else if (macro_f_utf_byte_width_is(*unicode.string)) {
-      status = f_utf_is_whitespace(unicode.string, 4, F_true);
+      setting->state.status = f_utf_is_whitespace(unicode.string, 4, F_true);
 
-      if (F_status_is_error(status)) {
-        if (F_status_set_fine(status) == F_complete_not_utf || F_status_set_fine(status) == F_utf_fragment) {
-          status = F_valid_not;
+      if (F_status_is_error(setting->state.status)) {
+        if (F_status_set_fine(setting->state.status) == F_complete_not_utf || F_status_set_fine(setting->state.status) == F_utf_fragment) {
+          setting->state.status = F_valid_not;
         }
         else {
-          return status;
+          return;
         }
       }
 
-      if (status == F_true) {
-        status = F_space;
-      }
-      else {
-        status = F_valid_not;
-      }
+      setting->state.status = (setting->state.status == F_true) ? F_space : F_valid_not;
     }
     else {
       if (unicode.string[0] < 0x30 || unicode.string[0] > (0x39 && unicode.string[0] < 0x41) || (unicode.string[0] > 0x46 && unicode.string[0] < 0x61) || unicode.string[0] > 0x66) {
-        status = f_utf_is_whitespace(unicode.string, 4, F_true);
+        setting->state.status = f_utf_is_whitespace(unicode.string, 4, F_true);
 
-        if (F_status_is_error(status)) {
-          if (F_status_set_fine(status) == F_complete_not_utf || F_status_set_fine(status) == F_utf_fragment) {
-            status = F_valid_not;
+        if (F_status_is_error(setting->state.status)) {
+          if (F_status_set_fine(setting->state.status) == F_complete_not_utf || F_status_set_fine(setting->state.status) == F_utf_fragment) {
+            setting->state.status = F_valid_not;
           }
           else {
-            return status;
+            return;
           }
         }
 
-        if (status == F_true) {
-          status = F_space;
-        }
-        else {
-          status = F_none;
-        }
+        setting->state.status = (setting->state.status == F_true) ? F_space : F_none;
       }
     }
 
-    if (status == F_valid_not) {
+    if (setting->state.status == F_valid_not) {
       if (*mode != utf8_codepoint_mode_bad_e) {
         if (*mode == utf8_codepoint_mode_bad_begin_e) {
           *mode = utf8_codepoint_mode_bad_e;
@@ -254,13 +250,13 @@ extern "C" {
     }
     else {
       if (*mode == utf8_codepoint_mode_bad_e) {
-        if (status == F_space) {
+        if (setting->state.status == F_space) {
           *mode = utf8_codepoint_mode_bad_end_e;
         }
       }
       else if (*mode == utf8_codepoint_mode_ready_e) {
-        if (status == F_space) {
-          status = F_next;
+        if (setting->state.status == F_space) {
+          setting->state.status = F_next;
         }
         else if (unicode.string[0] == f_string_ascii_u_s.string[0] || unicode.string[0] == f_string_ascii_U_s.string[0]) {
           *mode = utf8_codepoint_mode_begin_e;
@@ -291,25 +287,26 @@ extern "C" {
         }
       }
       else if (*mode == utf8_codepoint_mode_raw_number_e) {
-        if (status == F_space) {
+        if (setting->state.status == F_space) {
           *mode = utf8_codepoint_mode_raw_end_e;
         }
       }
       else if (*mode == utf8_codepoint_mode_number_e) {
-        if (status == F_space) {
+        if (setting->state.status == F_space) {
           *mode = utf8_codepoint_mode_end_e;
         }
       }
     }
-
-    return status;
   }
 #endif // _di_utf8_detect_codepoint_
 
 #ifndef _di_utf8_process_file_codepoint_
-  f_status_t utf8_process_file_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_file_t file) {
+  void utf8_process_file_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_file_t file) {
+
+    if (!main || !setting) return;
+
+    setting->state.status = F_none;
 
-    f_status_t status = F_none;
     bool valid = F_true;
     bool next = F_true;
     uint8_t mode_codepoint = utf8_codepoint_mode_ready_e;
@@ -321,21 +318,21 @@ extern "C" {
     f_string_static_t sequence = macro_f_string_static_t_initialize(block, 0, 0);
 
     do {
-      status = f_file_stream_read_block(file, &setting->buffer);
+      setting->state.status = f_file_stream_read_block(file, &setting->buffer);
 
-      if (status == F_none_eof && !setting->buffer.used) {
+      if (setting->state.status == F_none_eof && !setting->buffer.used) {
 
         // Handle complete character, which must be explicitly set to end in this situation.
         if (mode_codepoint == utf8_codepoint_mode_number_e || mode_codepoint == utf8_codepoint_mode_raw_number_e) {
           if (mode_codepoint == utf8_codepoint_mode_number_e) {
             mode_codepoint = utf8_codepoint_mode_end_e;
 
-            status = utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
+            utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
           }
           else if (mode_codepoint == utf8_codepoint_mode_raw_number_e) {
             mode_codepoint = utf8_codepoint_mode_raw_end_e;
 
-            status = utf8_convert_raw(main, setting, sequence, &mode_codepoint);
+            utf8_convert_raw(main, setting, sequence, &mode_codepoint);
 
             // Raw mode represents an invalid Unicode sequence.
             valid = F_false;
@@ -343,20 +340,20 @@ extern "C" {
 
           j = 0;
           next = F_true;
-          status = F_none_eof;
+          setting->state.status = F_none_eof;
           mode_codepoint = utf8_codepoint_mode_ready_e;
         }
 
         break;
       }
 
-      for (i = 0; F_status_is_fine(status) && i < setting->buffer.used; ) {
+      for (i = 0; F_status_is_error_not(setting->state.status) && i < setting->buffer.used; ) {
 
         if (!((++main->signal_check) % utf8_signal_check_d)) {
           if (fll_program_standard_signal_received(main)) {
             fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-            status = F_interrupt;
+            setting->state.status = F_status_set_error(F_interrupt);
 
             break;
           }
@@ -364,7 +361,7 @@ extern "C" {
           main->signal_check = 0;
         }
 
-        status = F_none;
+        setting->state.status = F_none;
 
         // Get the current width only when processing a new block.
         if (next) {
@@ -378,25 +375,25 @@ extern "C" {
 
         if (j >= sequence.used) {
           if (setting->mode & utf8_mode_from_bytesequence_e) {
-            status = utf8_convert_bytesequence(main, setting, sequence);
+            utf8_convert_bytesequence(main, setting, sequence);
           }
           else {
-            status = utf8_detect_codepoint(main, setting, sequence, &mode_codepoint);
+            utf8_detect_codepoint(main, setting, sequence, &mode_codepoint);
 
-            if (F_status_is_fine(status) && status != F_next) {
+            if (F_status_is_error_not(setting->state.status) && setting->state.status != F_next) {
               if (mode_codepoint == utf8_codepoint_mode_raw_begin_e || mode_codepoint == utf8_codepoint_mode_raw_number_e || mode_codepoint == utf8_codepoint_mode_raw_end_e) {
-                status = utf8_convert_raw(main, setting, sequence, &mode_codepoint);
+                utf8_convert_raw(main, setting, sequence, &mode_codepoint);
 
                 // Raw mode represents an invalid Unicode sequence.
                 valid = F_false;
               }
               else {
-                status = utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
+                utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
               }
             }
           }
 
-          if (status == F_utf_not) {
+          if (setting->state.status == F_utf_not) {
             valid = F_false;
           }
 
@@ -407,41 +404,41 @@ extern "C" {
 
       setting->buffer.used = 0;
 
-    } while (F_status_is_fine(status) && status != F_interrupt);
+    } while (F_status_is_error_not(setting->state.status));
 
     // Handle last (incomplete) character when the buffer ended before the character is supposed to end.
-    if (F_status_is_error_not(status) && status != F_interrupt && next == F_false) {
+    if (F_status_is_error_not(setting->state.status) && next == F_false) {
       sequence.used = j;
 
       if (setting->mode & utf8_mode_from_bytesequence_e) {
-        status = utf8_convert_bytesequence(main, setting, sequence);
+        utf8_convert_bytesequence(main, setting, sequence);
       }
       else {
-        status = utf8_detect_codepoint(main, setting, sequence, &mode_codepoint);
+        utf8_detect_codepoint(main, setting, sequence, &mode_codepoint);
 
-        if (F_status_is_fine(status) && status != F_next) {
+        if (F_status_is_error_not(setting->state.status) && setting->state.status != F_next) {
           if (mode_codepoint == utf8_codepoint_mode_raw_begin_e || mode_codepoint == utf8_codepoint_mode_raw_number_e || mode_codepoint == utf8_codepoint_mode_raw_end_e) {
-            status = utf8_convert_raw(main, setting, sequence, &mode_codepoint);
+            utf8_convert_raw(main, setting, sequence, &mode_codepoint);
 
             // Raw mode represents an invalid Unicode sequence.
             valid = F_false;
           }
           else {
-            status = utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
+            utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
           }
         }
       }
 
-      if (status == F_utf_not) {
+      if (setting->state.status == F_utf_not) {
         valid = F_false;
       }
     }
 
     setting->buffer.used = 0;
 
-    if (F_status_is_error(status) || status == F_interrupt) return status;
+    if (F_status_is_error(setting->state.status)) return;
 
-    return valid;
+    setting->state.status = valid;
   }
 #endif // _di_utf8_process_file_codepoint_
 
similarity index 55%
rename from level_3/utf8/c/main/private-utf8_codepoint.h
rename to level_3/utf8/c/main/codepoint.h
index 60b8ba8bc93118a2d77b0e98f02d5b8dd69ddb08..c8e7c7b81869df99dae71f8b256711761bd25a97 100644 (file)
@@ -26,18 +26,18 @@ extern "C" {
  * @param mode
  *   The codepoint mode the text is currently in.
  *
- * @return
- *   F_none on success.
- *   F_utf_not on invalid UTF-8 (which is still "success" when verifying).
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *     F_utf_not on invalid UTF-8 (which is still "success" when verifying).
  *
- *   F_utf_not (with error bit) if not verifying and the Unicode value is invalid.
+ *     F_utf_not (with error bit) if not verifying and the Unicode value is invalid.
  *
- *   Errors (with error bit) from: f_utf_unicode_to()
+ *     Errors (with error bit) from: f_utf_unicode_to()
  *
  * @see f_utf_unicode_to()
  */
 #ifndef _di_utf8_convert_codepoint_
-  extern f_status_t utf8_convert_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t unicode, uint8_t *mode) F_attribute_visibility_internal_d;
+  extern void utf8_convert_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t unicode, uint8_t *mode) F_attribute_visibility_internal_d;
 #endif // _di_utf8_convert_codepoint_
 
 /**
@@ -54,18 +54,18 @@ extern "C" {
  * @param mode
  *   The codepoint mode the text is currently in.
  *
- * @return
- *   F_none on success.
- *   F_valid_not on invalid raw (which is still "success" when verifying).
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *     F_valid_not on invalid raw (which is still "success" when verifying).
  *
- *   F_valid_not (with error bit) if not verifying and the raw value is invalid.
+ *     F_valid_not (with error bit) if not verifying and the raw value is invalid.
  *
- *   Errors (with error bit) from: fl_conversion_dynamic_to_unsigned_detect()
+ *     Errors (with error bit) from: fl_conversion_dynamic_to_unsigned_detect()
  *
  * @see fl_conversion_dynamic_to_unsigned_detect()
  */
 #ifndef _di_utf8_convert_raw_
-  extern f_status_t utf8_convert_raw(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t hex, uint8_t *mode) F_attribute_visibility_internal_d;
+  extern void utf8_convert_raw(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t hex, uint8_t *mode) F_attribute_visibility_internal_d;
 #endif // _di_utf8_convert_raw_
 
 /**
@@ -80,15 +80,15 @@ extern "C" {
  * @param mode
  *   Designate the mode in which the curent state is being processed.
  *
- * @return
- *   F_none on success.
- *   F_next on success, but should not be processed (it is white space or NULL).
- *   F_space on success, but the character is whitespace.
+ *   This alters setting.state.status:
+ *     F_none on success.
+ *     F_next on success, but should not be processed (it is white space or NULL).
+ *     F_space on success, but the character is whitespace.
  *
- *   Errors (with error bit) from: f_utf_is_whitespace()
+ *     Errors (with error bit) from: f_utf_is_whitespace()
  */
 #ifndef _di_utf8_detect_codepoint_
-  extern f_status_t utf8_detect_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t unicode, uint8_t *mode) F_attribute_visibility_internal_d;
+  extern void utf8_detect_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t unicode, uint8_t *mode) F_attribute_visibility_internal_d;
 #endif // _di_utf8_detect_codepoint_
 
 /**
@@ -102,20 +102,20 @@ extern "C" {
  *   The file stream to process.
  *   This file may contain NULLs.
  *
- * @return
- *   F_true on success and is valid.
- *   F_false on success and contains invalid sequences.
- *   F_interrupt on (exit) signal received.
+ *   This alters setting.state.status:
+ *     F_true on success and is valid.
+ *     F_false on success and contains invalid sequences.
+ *     F_interrupt on (exit) signal received.
  *
- *   Errors (with error bit) from: utf8_convert_bytesequence()
- *   Errors (with error bit) from: utf8_detect_codepoint()
+ *     Errors (with error bit) from: utf8_convert_bytesequence()
+ *     Errors (with error bit) from: utf8_detect_codepoint()
  *
  * @see fll_program_standard_signal_received()
  * @see utf8_convert_bytesequence()
  * @see utf8_detect_codepoint()
  */
 #ifndef _di_utf8_process_file_codepoint_
-  extern f_status_t utf8_process_file_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_file_t file) F_attribute_visibility_internal_d;
+  extern void utf8_process_file_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_file_t file) F_attribute_visibility_internal_d;
 #endif // _di_utf8_process_file_codepoint_
 
 #ifdef __cplusplus
index f7e582cd4f23a97bcfe95f8dd7ddc6b8b9d1098f..8d618e0effa2b18cff8e5def4deaf49545b110d1 100644 (file)
@@ -91,6 +91,39 @@ extern "C" {
 #endif // _di_utf8_main_flag_e_
 
 /**
+ * Codepoint modes for converting to/from binary and codepoint values.
+ *
+ * The special "raw" format is used only for reading from codepoint format where that format represents binary character that is not a valid Unicode character.
+ * This is intended to be used to save and restore the original binary data even if that data is invalid.
+ *
+ * private_utf8_codepoint_mode_*:
+ *   - ready:      The codepoint has yet to be processed, skip leading spaces until first 'U' is matched.
+ *   - begin:      The first 'U' is matched, look for the '+'.
+ *   - number:     The '+' is matched, process numbers.
+ *   - end:        The last number is reached (at either white space or EOS/EOF).
+ *   - bad:        This is not a valid codepoint.
+ *   - bad_begin:  This is the beginning of an invalid codepoint.
+ *   - bad_end:    The end of bad is detected, which happens on white space or end of buffer.
+ *   - raw_begin:  This is the beginning of a potential raw data (matched '0').
+ *   - raw_number: This is the confirmed beginning of raw data (matched 'X'), process numbers.
+ *   - raw_end:    The end of raw data is detected, which happens on white space or end of buffer.
+ */
+#ifndef _di_utf8_codepoint_modes_
+  enum {
+    utf8_codepoint_mode_ready_e = 1,
+    utf8_codepoint_mode_begin_e,
+    utf8_codepoint_mode_number_e,
+    utf8_codepoint_mode_end_e,
+    utf8_codepoint_mode_bad_e,
+    utf8_codepoint_mode_bad_begin_e,
+    utf8_codepoint_mode_bad_end_e,
+    utf8_codepoint_mode_raw_begin_e,
+    utf8_codepoint_mode_raw_number_e,
+    utf8_codepoint_mode_raw_end_e,
+  }; // enum
+#endif // _di__utf8_codepoint_modes_
+
+/**
  * The main program parameters.
  */
 #ifndef _di_utf8_parameter_e_
@@ -214,7 +247,7 @@ extern "C" {
     { \
       utf8_mode_from_bytesequence_e | utf8_mode_to_codepoint_e, \
       utf8_main_flag_none_e, \
-      f_state_initialize_t, \
+      f_state_t_initialize, \
       f_color_set_t_initialize, \
       f_color_set_t_initialize, \
       f_string_static_t_initialize, \
index 4b8a43163a4048a92ecc7b19a5da26c15b7152a6..22e2c787c8414a6f02d71066859215916d447b59 100644 (file)
@@ -21,16 +21,15 @@ extern "C" {
 #endif // _di_utf8_setting_delete_
 
 #ifndef _di_utf8_setting_load_
-  void utf8_setting_load(const f_console_arguments_t arguments, f_state_t * const state, fll_program_data_t * const main, utf8_setting_t * const setting) {
+  void utf8_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, utf8_setting_t * const setting) {
 
     if (!main || !setting) return;
 
     setting->flag = 0;
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, state, &main->parameters, 0);
+    f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       utf8_print_error(setting, main->error, macro_utf8_f(f_console_parameter_process));
 
       return;
@@ -48,9 +47,9 @@ extern "C" {
 
         const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
-        setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
+        setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_error(setting, main->error, macro_utf8_f(fll_program_parameter_process_context));
 
           return;
@@ -79,9 +78,9 @@ extern "C" {
 
         const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
 
-        setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+        setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_error(setting, main->error, macro_utf8_f(fll_program_parameter_process_verbosity));
 
           return;
@@ -94,9 +93,9 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 2;
 
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
+        setting->state.status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_error(setting, main->error, macro_utf8_f(f_console_parameter_prioritize_right));
 
           return;
@@ -119,9 +118,9 @@ extern "C" {
         choices.used = 4;
         choice = 1;
 
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
+        setting->state.status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_error(setting, main->error, macro_utf8_f(f_console_parameter_prioritize_right));
 
           return;
@@ -186,7 +185,7 @@ extern "C" {
 
     if (main->parameters.array[utf8_parameter_to_file_e].result & f_console_result_value_e) {
       if (main->parameters.array[utf8_parameter_to_file_e].values.used > 1) {
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         utf8_print_error_parameter_file_to_too_many(setting, main->error);
 
@@ -196,9 +195,9 @@ extern "C" {
       if (main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]].used) {
         setting->path_files_to.used = 0;
 
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
+        setting->state.status = f_string_dynamics_increase_by(1, &setting->path_files_to);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_error(setting, main->error, macro_utf8_f(f_string_dynamics_increase_by));
 
           return;
@@ -206,9 +205,9 @@ extern "C" {
 
         setting->path_files_to.array[setting->path_files_to.used].used = 0;
 
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
+        setting->state.status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_error(setting, main->error, macro_utf8_f(f_string_dynamic_append_nulless));
 
           return;
@@ -216,9 +215,9 @@ extern "C" {
 
         ++setting->path_files_to.used;
 
-        setting->status = f_file_stream_open(main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
+        setting->state.status = f_file_stream_open(main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_error_file(setting, main->error, macro_utf8_f(f_file_stream_open), main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
 
           return;
@@ -230,13 +229,13 @@ extern "C" {
         utf8_print_line_first_locked(setting, main->error);
         utf8_print_error_parameter_file_name_empty(setting, main->error, main->parameters.array[utf8_parameter_to_file_e].values.array[0]);
 
-        setting->status = F_status_set_error(F_parameter);
+        setting->state.status = F_status_set_error(F_parameter);
 
         return;
       }
     }
     else if (main->parameters.array[utf8_parameter_to_file_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       utf8_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, utf8_long_to_file_s);
@@ -251,9 +250,9 @@ extern "C" {
     if (main->parameters.array[utf8_parameter_from_file_e].result & f_console_result_value_e) {
       setting->path_files_from.used = 0;
 
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[utf8_parameter_from_file_e].values.used, &setting->path_files_from);
+      setting->state.status = f_string_dynamics_increase_by(main->parameters.array[utf8_parameter_from_file_e].values.used, &setting->path_files_from);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         utf8_print_error(setting, main->error, macro_utf8_f(f_string_dynamics_increase_by));
 
         return;
@@ -269,11 +268,11 @@ extern "C" {
         index = main->parameters.array[utf8_parameter_from_file_e].values.array[i];
         setting->path_files_from.array[i].used = 0;
 
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
+        setting->state.status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), macro_utf8_f(f_string_dynamic_append_nulless), fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), macro_utf8_f(f_string_dynamic_append_nulless), fll_error_file_flag_fallback_e);
 
           break;
         }
@@ -282,26 +281,26 @@ extern "C" {
           if (f_file_exists(main->parameters.arguments.array[index], F_true) != F_true) {
             utf8_print_error_parameter_file_not_found(setting, main->error, F_true, main->parameters.arguments.array[index]);
 
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
+            if (F_status_is_error_not(setting->state.status)) {
+              setting->state.status = F_status_set_error(F_file_found_not);
             }
           }
         }
         else {
           utf8_print_error_parameter_file_name_empty(setting, main->error, index);
 
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
+          if (F_status_is_error_not(setting->state.status)) {
+            setting->state.status = F_status_set_error(F_parameter);
           }
         }
       } // for
 
-      if (F_status_is_error(setting->status)) return;
+      if (F_status_is_error(setting->state.status)) return;
 
       setting->flag |= utf8_main_flag_file_from_e;
     }
     else if (main->parameters.array[utf8_parameter_from_file_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       utf8_print_line_first_locked(setting, main->error);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, utf8_long_from_file_s);
@@ -315,9 +314,9 @@ extern "C" {
     if (main->parameters.remaining.used) {
       setting->remaining.used = 0;
 
-      setting->status = f_string_dynamics_increase_by(main->parameters.remaining.used, &setting->remaining);
+      setting->state.status = f_string_dynamics_increase_by(main->parameters.remaining.used, &setting->remaining);
 
-      if (F_status_is_error(setting->status)) {
+      if (F_status_is_error(setting->state.status)) {
         utf8_print_error(setting, main->error, macro_utf8_f(f_string_dynamics_increase_by));
 
         return;
@@ -335,7 +334,7 @@ extern "C" {
     }
 
     if (!(main->parameters.array[utf8_parameter_from_file_e].result & f_console_result_found_e) && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      setting->status = F_status_set_error(F_parameter);
+      setting->state.status = F_status_set_error(F_parameter);
 
       utf8_print_line_first_locked(setting, main->error);
       utf8_print_error_no_from(setting, main->error);
index 2a3f29447426e7a4e3dfe68cb0eb917f0e6f76c4..4eccb9d66273f1124837173524806cb27ddb3371 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
  * @param setting
  *   The program main setting data.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
@@ -47,7 +47,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *
  *     Errors (with error bit) from: f_console_parameter_process().
@@ -59,7 +59,7 @@ extern "C" {
  * @see fll_program_parameter_process_context()
  */
 #ifndef _di_utf8_setting_load_
-  extern void utf8_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, utf8_setting_t * const setting, f_state_t * const state);
+  extern void utf8_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, utf8_setting_t * const setting);
 #endif // _di_utf8_setting_load_
 
 /**
@@ -71,7 +71,7 @@ extern "C" {
  *   The main program settings.
  *   All buffers are deallocated.
  *
- *   This does not alter setting.status.
+ *   This does not alter setting.state.status.
  *
  * @return
  *   F_none on success.
index b4a5c32ed313a4fbc7d58df4890adcb84532960e..3739c3800c1356e66a690876765fcdbab00bb02a 100644 (file)
@@ -18,9 +18,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
-    f_state_t state = f_state_t_initialize;
 
-    utf8_setting_load(arguments, state, &data, &setting);
+    utf8_setting_load(arguments, &data, &setting);
   }
 
   utf8_main(&data, &setting);
@@ -31,5 +30,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return (F_status_is_error(setting.status) || setting.status == F_false) ? 1 : 0;
+  return (F_status_is_error(setting.state.status) || setting.state.status == F_false) ? 1 : 0;
 }
index afc7098528058745c3944ce15c6904a6b6885743..e9808327c52acf6646fa377129c5c890d1a9cb7a 100644 (file)
@@ -1,5 +1,4 @@
 #include "utf8.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -8,18 +7,20 @@ extern "C" {
 #ifndef _di_utf8_print_error_
   f_status_t utf8_print_error(utf8_setting_t * const setting, const fl_print_t print, const f_string_t function) {
 
+    if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     utf8_print_line_first_locked(setting, print);
-    fll_error_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e);
+    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
 
     return F_none;
   }
 #endif // _di_utf8_print_error_
 
 #ifndef _di_utf8_print_error_decode_
-  f_status_t utf8_print_error_decode(utf8_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_static_t invalid) {
+  f_status_t utf8_print_error_decode(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t invalid) {
 
+    if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
     if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
@@ -37,18 +38,18 @@ extern "C" {
       fl_print_format("%]", print.to, print.set->notable);
     }
 
-    if (F_status_set_fine(status) == F_utf_not) {
+    if (F_status_set_fine(setting->state.status) == F_utf_not) {
       fl_print_format("%[', not a valid UTF-8 character sequence.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
     }
-    else if (F_status_set_fine(status) == F_complete_not_utf) {
+    else if (F_status_set_fine(setting->state.status) == F_complete_not_utf) {
       fl_print_format("%[', invalid UTF-8 (truncated).%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
     }
-    else if (F_status_set_fine(status) == F_utf_fragment) {
+    else if (F_status_set_fine(setting->state.status) == F_utf_fragment) {
       fl_print_format("%[', invalid UTF-8 fragment.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
     }
     else {
       fl_print_format("%[', error status code%] ", print.to, print.set->error, print.set->error, f_string_eol_s);
-      fl_print_format("%[%ui%]", print.to, print.set->notable, F_status_set_fine(status), print.set->notable);
+      fl_print_format("%[%ui%]", print.to, print.set->notable, F_status_set_fine(setting->state.status), print.set->notable);
       fl_print_format("%[.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
     }
 
@@ -57,8 +58,9 @@ extern "C" {
 #endif // _di_utf8_print_error_decode_
 
 #ifndef _di_utf8_print_error_encode_
-  f_status_t utf8_print_error_encode(utf8_setting_t * const setting, const fl_print_t print, const f_status_t status, const uint32_t codepoint) {
+  f_status_t utf8_print_error_encode(utf8_setting_t * const setting, const fl_print_t print, const uint32_t codepoint) {
 
+    if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     utf8_print_line_first_unlocked(setting, print);
@@ -66,12 +68,12 @@ extern "C" {
     fl_print_format("%[%QFailed to encode Unicode codepoint '%]", print.to, print.set->error, print.prefix, print.set->error);
     fl_print_format("%[U+%_U%]", print.to, print.set->notable, codepoint, print.set->notable);
 
-    if (F_status_set_fine(status) == F_utf_not) {
+    if (F_status_set_fine(setting->state.status) == F_utf_not) {
       fl_print_format("%[', not a valid Unicode codepoint.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
     }
     else {
       fl_print_format("%[', error status code%] ", print.to, print.set->error, print.set->error, f_string_eol_s);
-      fl_print_format("%[%ui%]", print.to, print.set->notable, F_status_set_fine(status), print.set->notable);
+      fl_print_format("%[%ui%]", print.to, print.set->notable, F_status_set_fine(setting->state.status), print.set->notable);
       fl_print_format("%[.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
     }
 
@@ -82,10 +84,11 @@ extern "C" {
 #ifndef _di_utf8_print_error_file_
   f_status_t utf8_print_error_file(utf8_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
 
+    if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     utf8_print_line_first_locked(setting, print);
-    fll_error_file_print(print, F_status_set_fine(setting->status), function, fll_error_file_flag_fallback_e, name, operation, type);
+    fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
 
     return F_none;
   }
@@ -94,6 +97,7 @@ extern "C" {
 #ifndef _di_utf8_print_error_no_from_
   f_status_t utf8_print_error_no_from(utf8_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     fll_print_format("%[%QNo from sources are specified, please pipe data, designate a file, or add parameters.%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
@@ -105,6 +109,7 @@ extern "C" {
 #ifndef _di_utf8_print_error_parameter_file_name_empty_
   f_status_t utf8_print_error_parameter_file_name_empty(utf8_setting_t * const setting, const fl_print_t print, const f_array_length_t index) {
 
+    if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
@@ -124,6 +129,7 @@ extern "C" {
 #ifndef _di_utf8_print_error_parameter_file_not_found_
   f_status_t utf8_print_error_parameter_file_not_found(utf8_setting_t * const setting, const fl_print_t print, const bool from, const f_string_static_t name) {
 
+    if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
@@ -143,6 +149,7 @@ extern "C" {
 #ifndef _di_utf8_print_error_parameter_file_to_too_many_
   f_status_t utf8_print_error_parameter_file_to_too_many(utf8_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     utf8_print_line_first_locked(setting, print);
@@ -156,6 +163,8 @@ extern "C" {
 #ifndef _di_utf8_print_bytesequence_
   f_status_t utf8_print_bytesequence(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence) {
 
+    if (!setting) return F_output_not;
+
     fl_print_format("%r%r%r", print.to, setting->prepend, sequence, setting->append);
 
     return F_none;
@@ -165,6 +174,7 @@ extern "C" {
 #ifndef _di_utf8_print_character_invalid_
   f_status_t utf8_print_character_invalid(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t invalid) {
 
+    if (!setting) return F_output_not;
     if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
     if (!invalid.used) return F_output_not;
 
@@ -194,6 +204,8 @@ extern "C" {
 #ifndef _di_utf8_print_codepoint_
   f_status_t utf8_print_codepoint(utf8_setting_t * const setting, const fl_print_t print, const uint32_t codepoint) {
 
+    if (!setting) return F_output_not;
+
     if (codepoint < 0x10000) {
       fl_print_format("%rU+%04_U%r", print.to, setting->prepend, codepoint, setting->append);
     }
@@ -211,6 +223,8 @@ extern "C" {
 #ifndef _di_utf8_print_combining_or_width_
   f_status_t utf8_print_combining_or_width(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence) {
 
+    if (!setting) return F_output_not;
+
     if (setting->mode & utf8_mode_to_combining_e) {
       f_status_t status = f_utf_is_combining(sequence.string, sequence.used);
 
@@ -245,6 +259,7 @@ extern "C" {
 #ifndef _di_utf8_print_combining_or_width_invalid_
   f_status_t utf8_print_combining_or_width_invalid(utf8_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_output_not;
     if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     fl_print_format("%r%[%r%]%r", print.to, setting->prepend, setting->valid_not, utf8_string_unknown_s, setting->valid_not, setting->append);
@@ -256,6 +271,8 @@ extern "C" {
 #ifndef _di_utf8_print_help_
   f_status_t utf8_print_help(utf8_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_output_not;
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
@@ -313,9 +330,10 @@ extern "C" {
 #ifndef _di_utf8_print_line_first_locked_
   f_status_t utf8_print_line_first_locked(utf8_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (utf8_main_flag_verify_e | utf8_main_flag_file_to_e)) return F_output_not;
     }
@@ -329,9 +347,10 @@ extern "C" {
 #ifndef _di_utf8_print_line_first_unlocked_
   f_status_t utf8_print_line_first_unlocked(utf8_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (utf8_main_flag_verify_e | utf8_main_flag_file_to_e)) return F_output_not;
     }
@@ -345,9 +364,10 @@ extern "C" {
 #ifndef _di_utf8_print_line_last_locked_
   f_status_t utf8_print_line_last_locked(utf8_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (utf8_main_flag_verify_e | utf8_main_flag_file_to_e)) return F_output_not;
     }
@@ -356,7 +376,7 @@ extern "C" {
 
     // Two lines are printed because the normal final end of line is never printed by design.
     // If this is an error or the header flag is set, then the normal end of line is printed by design so do not print this second new line.
-    if (F_status_is_error_not(setting->status) && !(setting->flag & utf8_main_flag_header_e)) {
+    if (F_status_is_error_not(setting->state.status) && !(setting->flag & utf8_main_flag_header_e)) {
       fll_print_dynamic_raw(setting->line_last, print.to);
     }
 
@@ -367,9 +387,10 @@ extern "C" {
 #ifndef _di_utf8_print_line_last_unlocked_
   f_status_t utf8_print_line_last_unlocked(utf8_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
       if (setting->flag & (utf8_main_flag_verify_e | utf8_main_flag_file_to_e)) return F_output_not;
     }
@@ -383,6 +404,7 @@ extern "C" {
 #ifndef _di_utf8_print_raw_bytesequence_
   f_status_t utf8_print_raw_bytesequence(utf8_setting_t * const setting, const fl_print_t print, const f_utf_char_t raw, const uint8_t width) {
 
+    if (!setting) return F_output_not;
     if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     f_string_static_t character = macro_f_string_static_t_initialize(0, 0, width);
@@ -424,6 +446,7 @@ extern "C" {
 #ifndef _di_utf8_print_raw_codepoint_
   f_status_t utf8_print_raw_codepoint(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t raw) {
 
+    if (!setting) return F_output_not;
     if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     fl_print_format("%r%[%r%]%r", print.to, setting->prepend, setting->valid_not, raw, setting->valid_not, setting->append);
@@ -435,6 +458,7 @@ extern "C" {
 #ifndef _di_utf8_print_raw_combining_or_width_
   f_status_t utf8_print_raw_combining_or_width(utf8_setting_t * const setting, const fl_print_t print, const uint8_t width) {
 
+    if (!setting) return F_output_not;
     if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     if (setting->mode & utf8_mode_to_combining_e) {
@@ -474,6 +498,7 @@ extern "C" {
 #ifndef _di_utf8_print_section_header_file_
   f_status_t utf8_print_section_header_file(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t name, const f_array_length_t index) {
 
+    if (!setting) return F_output_not;
     if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not;
     if (setting->flag & utf8_main_flag_verify_e) return F_output_not;
 
@@ -507,6 +532,7 @@ extern "C" {
 #ifndef _di_utf8_print_section_header_parameter_
   f_status_t utf8_print_section_header_parameter(utf8_setting_t * const setting, const fl_print_t print, const f_array_length_t index) {
 
+    if (!setting) return F_output_not;
     if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not;
     if (setting->flag & utf8_main_flag_verify_e) return F_output_not;
 
@@ -533,6 +559,7 @@ extern "C" {
 #ifndef _di_utf8_print_section_header_pipe_
   f_status_t utf8_print_section_header_pipe(utf8_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_output_not;
     if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not;
     if (setting->flag & utf8_main_flag_verify_e) return F_output_not;
 
@@ -553,6 +580,9 @@ extern "C" {
 #ifndef _di_utf8_print_width_
   f_status_t utf8_print_width(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
     f_status_t status = f_utf_is_wide(sequence.string, sequence.used);
 
     if (status == F_true) {
index 923f03ddc153b1b297d31743ac09b0f20e64b0b5..6613f56e883445cf675238a3a15a9b90c3f94bc9 100644 (file)
@@ -18,9 +18,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
@@ -28,6 +26,8 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
  * @see fll_error_print()
  */
 #ifndef _di_utf8_print_error_
@@ -42,18 +42,18 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param invalid
  *   The byte sequence string or unicode codepoint string representing a single character to print.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_error_decode_
-  extern f_status_t utf8_print_error_decode(utf8_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_static_t invalid);
+  extern f_status_t utf8_print_error_decode(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t invalid);
 #endif // _di_utf8_print_error_decode_
 
 /**
@@ -62,9 +62,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param codepoint
@@ -73,9 +71,11 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_error_encode_
-  extern f_status_t utf8_print_error_encode(utf8_setting_t * const setting, const fl_print_t print, const f_status_t status, const uint32_t codepoint);
+  extern f_status_t utf8_print_error_encode(utf8_setting_t * const setting, const fl_print_t print, const uint32_t codepoint);
 #endif // _di_utf8_print_error_encode_
 
 /**
@@ -84,9 +84,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param function
@@ -103,6 +101,8 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
  * @see fll_error_file_print()
  */
 #ifndef _di_utf8_print_error_file_
@@ -115,15 +115,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_error_no_from_
   extern f_status_t utf8_print_error_no_from(utf8_setting_t * const setting, const fl_print_t print);
@@ -135,9 +135,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param index
@@ -146,6 +144,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_error_parameter_file_name_empty_
   extern f_status_t utf8_print_error_parameter_file_name_empty(utf8_setting_t * const setting, const fl_print_t print, const f_array_length_t index);
@@ -157,9 +157,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param from
@@ -171,6 +169,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_error_parameter_file_not_found_
   extern f_status_t utf8_print_error_parameter_file_not_found(utf8_setting_t * const setting, const fl_print_t print, const bool from, const f_string_static_t name);
@@ -182,15 +182,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_error_parameter_file_to_too_many_
   extern f_status_t utf8_print_error_parameter_file_to_too_many(utf8_setting_t * const setting, const fl_print_t print);
@@ -202,9 +202,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param sequence
@@ -213,6 +211,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_bytesequence_
   extern f_status_t utf8_print_bytesequence(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence);
@@ -226,9 +226,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param invalid
@@ -238,6 +236,8 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
  * @see utf8_print_combining_or_width()
  */
 #ifndef _di_utf8_print_character_invalid_
@@ -250,9 +250,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param codepoint
@@ -262,6 +260,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_codepoint_
   extern f_status_t utf8_print_codepoint(utf8_setting_t * const setting, const fl_print_t print, const uint32_t codepoint);
@@ -273,9 +273,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  * @param sequence
@@ -286,6 +284,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_combining_or_width_
   extern f_status_t utf8_print_combining_or_width(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence);
@@ -297,15 +297,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates how printing is to be performed.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_combining_or_width_invalid_
   extern f_status_t utf8_print_combining_or_width_invalid(utf8_setting_t * const setting, const fl_print_t print);
@@ -317,15 +317,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   The output structure to print to.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_help_
   extern f_status_t utf8_print_help(utf8_setting_t * const setting, const fl_print_t print);
@@ -341,15 +341,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_line_first_locked_
   extern f_status_t utf8_print_line_first_locked(utf8_setting_t * const setting, const fl_print_t print);
@@ -365,15 +365,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_line_first_unlocked_
   extern f_status_t utf8_print_line_first_unlocked(utf8_setting_t * const setting, const fl_print_t print);
@@ -389,15 +389,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_line_last_locked_
   extern f_status_t utf8_print_line_last_locked(utf8_setting_t * const setting, const fl_print_t print);
@@ -413,15 +413,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_line_last_unlocked_
   extern f_status_t utf8_print_line_last_unlocked(utf8_setting_t * const setting, const fl_print_t print);
@@ -433,9 +433,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param raw
@@ -446,6 +444,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_raw_bytesequence_
   extern f_status_t utf8_print_raw_bytesequence(utf8_setting_t * const setting, const fl_print_t print, const f_utf_char_t raw, const uint8_t width);
@@ -457,9 +457,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param raw
@@ -468,6 +466,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_raw_codepoint_
   extern f_status_t utf8_print_raw_codepoint(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t raw);
@@ -479,9 +479,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param width
@@ -491,6 +489,8 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
  * @see utf8_print_width()
  */
 #ifndef _di_utf8_print_raw_combining_or_width_
@@ -503,9 +503,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param name
@@ -516,6 +514,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_section_header_file_
   extern f_status_t utf8_print_section_header_file(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t name, const f_array_length_t index);
@@ -527,9 +527,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param index
@@ -538,6 +536,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_section_header_parameter_
   extern f_status_t utf8_print_section_header_parameter(utf8_setting_t * const setting, const fl_print_t print, const f_array_length_t index);
@@ -549,15 +549,15 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_section_header_pipe_
   extern f_status_t utf8_print_section_header_pipe(utf8_setting_t * const setting, const fl_print_t print);
@@ -569,9 +569,7 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This does not alter setting.status.
- *
- *   Assumed to always be non-NULL.
+ *   This does not alter setting.state.status.
  * @param print
  *   Designates the how and where to print.
  * @param sequence
@@ -580,6 +578,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_utf8_print_width_
   extern f_status_t utf8_print_width(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence);
index 48dad90ef9862a0f200d1851fbd71a0da7d5672a..5bf1965062bc59531f3a4dcec960ff1ba70cdb7b 100644 (file)
 extern "C" {
 #endif
 
-/**
- * Codepoint modes for converting to/from binary and codepoint values.
- *
- * The special "raw" format is used only for reading from codepoint format where that format represents binary character that is not a valid Unicode character.
- * This is intended to be used to save and restore the original binary data even if that data is invalid.
- *
- * private_utf8_codepoint_mode_*:
- *   - ready:      The codepoint has yet to be processed, skip leading spaces until first 'U' is matched.
- *   - begin:      The first 'U' is matched, look for the '+'.
- *   - number:     The '+' is matched, process numbers.
- *   - end:        The last number is reached (at either white space or EOS/EOF).
- *   - bad:        This is not a valid codepoint.
- *   - bad_begin:  This is the beginning of an invalid codepoint.
- *   - bad_end:    The end of bad is detected, which happens on white space or end of buffer.
- *   - raw_begin:  This is the beginning of a potential raw data (matched '0').
- *   - raw_number: This is the confirmed beginning of raw data (matched 'X'), process numbers.
- *   - raw_end:    The end of raw data is detected, which happens on white space or end of buffer.
- */
-#ifndef _di_utf8_codepoint_modes_
-  enum {
-    utf8_codepoint_mode_ready_e = 1,
-    utf8_codepoint_mode_begin_e,
-    utf8_codepoint_mode_number_e,
-    utf8_codepoint_mode_end_e,
-    utf8_codepoint_mode_bad_e,
-    utf8_codepoint_mode_bad_begin_e,
-    utf8_codepoint_mode_bad_end_e,
-    utf8_codepoint_mode_raw_begin_e,
-    utf8_codepoint_mode_raw_number_e,
-    utf8_codepoint_mode_raw_end_e,
-  };
-#endif // _di__utf8_codepoint_modes_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
diff --git a/level_3/utf8/c/main/private-utf8_bytesequence.c b/level_3/utf8/c/main/private-utf8_bytesequence.c
deleted file mode 100644 (file)
index dcf6e44..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-#include "utf8.h"
-#include "private-common.h"
-#include "private-utf8.h"
-#include "private-utf8_bytesequence.h"
-#include "private-utf8_codepoint.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _di_utf8_convert_bytesequence_
-  f_status_t utf8_convert_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
-
-    f_status_t status = F_none;
-    bool valid_not = F_false;
-
-    uint32_t codepoint = 0;
-
-    if (sequence.used) {
-      status = f_utf_unicode_to(sequence.string, sequence.used, &codepoint);
-    }
-    else {
-      status = F_status_set_error(F_utf_not);
-    }
-
-    if (F_status_is_error(status)) {
-      status = F_status_set_fine(status);
-
-      if (status == F_failure || status == F_utf_not || status == F_complete_not_utf || status == F_utf_fragment || status == F_valid_not) {
-        valid_not = F_true;
-
-        utf8_print_character_invalid(setting, main->output, sequence);
-      }
-      else {
-        status = F_status_set_error(status);
-
-        utf8_print_error_decode(setting, main->error, status, sequence);
-
-        return status;
-      }
-    }
-    else if (!(setting->flag & utf8_main_flag_verify_e)) {
-      if (setting->mode & utf8_mode_to_bytesequence_e) {
-        utf8_print_bytesequence(setting, main->output, sequence);
-      }
-      else if (setting->mode & utf8_mode_to_codepoint_e) {
-        utf8_print_codepoint(setting, main->output, codepoint);
-      }
-      else {
-        utf8_print_combining_or_width(setting, main->output, sequence);
-      }
-    }
-
-    if (valid_not || F_status_is_error(status)) return F_utf_not;
-
-    return F_none;
-  }
-#endif // _di_utf8_convert_bytesequence_
-
-#ifndef _di_utf8_process_file_bytesequence_
-  f_status_t utf8_process_file_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_file_t file) {
-
-    f_status_t status = F_none;
-
-    bool valid = F_true;
-    bool next = F_true;
-    uint8_t mode_codepoint = utf8_codepoint_mode_ready_e;
-
-    f_array_length_t i = 0;
-    f_array_length_t j = 0;
-
-    f_char_t block[4] = { 0, 0, 0, 0 };
-    f_string_static_t sequence = macro_f_string_static_t_initialize(block, 0, 4);
-
-    do {
-      status = f_file_stream_read_block(file, &setting->buffer);
-
-      if (status == F_none_eof && !setting->buffer.used) break;
-
-      for (i = 0; F_status_is_fine(status) && i < setting->buffer.used; ) {
-
-        if (!((++main->signal_check) % utf8_signal_check_d)) {
-          if (fll_program_standard_signal_received(main)) {
-            fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
-
-            status = F_interrupt;
-
-            break;
-          }
-
-          main->signal_check = 0;
-        }
-
-        status = F_none;
-
-        // Get the current width only when processing a new block.
-        if (next) {
-          sequence.used = macro_f_utf_byte_width(setting->buffer.string[i]);
-          next = F_false;
-        }
-
-        for (; j < sequence.used && i < setting->buffer.used; ++j, ++i) {
-          sequence.string[j] = setting->buffer.string[i];
-        } // for
-
-        if (j == sequence.used) {
-          if (setting->mode & utf8_mode_from_bytesequence_e) {
-            status = utf8_convert_bytesequence(main, setting, sequence);
-          }
-          else {
-            status = utf8_detect_codepoint(main, setting, sequence, &mode_codepoint);
-
-            if (F_status_is_fine(status) && status != F_next) {
-              status = utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
-            }
-          }
-
-          if (status == F_utf_not) {
-            valid = F_false;
-          }
-
-          j = 0;
-          next = F_true;
-        }
-      } // for
-
-      i = 0;
-      setting->buffer.used = 0;
-
-    } while (F_status_is_fine(status) && status != F_interrupt);
-
-    // Handle last (incomplete) sequence when the buffer ended before the sequence is supposed to end.
-    if (F_status_is_error_not(status) && status != F_interrupt && next == F_false) {
-      sequence.used = j;
-
-      if (setting->mode & utf8_mode_from_bytesequence_e) {
-        status = utf8_convert_bytesequence(main, setting, sequence);
-      }
-      else {
-        status = utf8_detect_codepoint(main, setting, sequence, &mode_codepoint);
-
-        if (F_status_is_fine(status) && status != F_next) {
-          status = utf8_convert_codepoint(main, setting, sequence, &mode_codepoint);
-        }
-      }
-
-      if (status == F_utf_not) {
-        valid = F_false;
-      }
-    }
-
-    setting->buffer.used = 0;
-
-    if (F_status_is_error(status) || status == F_interrupt) return status;
-
-    return valid;
-  }
-#endif // _di_utf8_process_file_bytesequence_
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
similarity index 66%
rename from level_3/utf8/c/main/private-utf8.c
rename to level_3/utf8/c/main/process.c
index 69d7ef651a34d2d7aebbbad4dcada11310314ba4..b4cc7d6c9e65f26b4b51998966a1e28a64e555eb 100644 (file)
@@ -1,19 +1,22 @@
 #include "utf8.h"
-#include "private-common.h"
-#include "private-utf8.h"
-#include "private-utf8_bytesequence.h"
-#include "private-utf8_codepoint.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #ifndef _di_utf8_process_text_
-  f_status_t utf8_process_text(fll_program_data_t * const main, utf8_setting_t * const setting, f_string_static_t text) {
+  void utf8_process_text(fll_program_data_t * const main, utf8_setting_t * const setting, f_string_static_t text) {
 
-    if (!text.used) return F_true;
+    if (!main || !setting) return;
+
+    if (!text.used) {
+      setting->state.status = F_true;
+
+      return;
+    }
+
+    setting->state.status = F_none;
 
-    f_status_t status = F_none;
     bool valid = F_true;
     uint8_t mode_codepoint = utf8_codepoint_mode_ready_e;
 
@@ -21,13 +24,13 @@ extern "C" {
 
     f_file_stream_lock(main->output.to);
 
-    for (; text.string[0] && F_status_is_error_not(status); ) {
+    for (; text.string[0] && F_status_is_error_not(setting->state.status); ) {
 
       if (!((++main->signal_check) % utf8_signal_check_d)) {
         if (fll_program_standard_signal_received(main)) {
           fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-          status = F_status_set_error(F_interrupt);
+          setting->state.status = F_status_set_error(F_interrupt);
 
           break;
         }
@@ -35,27 +38,27 @@ extern "C" {
         main->signal_check = 0;
       }
 
-      status = F_none;
+      setting->state.status = F_none;
 
       if (setting->mode & utf8_mode_from_bytesequence_e) {
-        status = utf8_convert_bytesequence(main, setting, text);
+        utf8_convert_bytesequence(main, setting, text);
       }
       else {
-        status = utf8_detect_codepoint(main, setting, text, &mode_codepoint);
+        utf8_detect_codepoint(main, setting, text, &mode_codepoint);
 
-        if (F_status_is_error(status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(status), macro_utf8_f(utf8_detect_codepoint), fll_error_file_flag_fallback_e);
+          fll_error_print(main->error, F_status_set_fine(setting->state.status), macro_utf8_f(utf8_detect_codepoint), fll_error_file_flag_fallback_e);
 
           break;
         }
 
-        if (F_status_is_fine(status) && status != F_next) {
-          status = utf8_convert_codepoint(main, setting, text, &mode_codepoint);
+        if (F_status_is_error_not(setting->state.status) && setting->state.status != F_next) {
+          utf8_convert_codepoint(main, setting, text, &mode_codepoint);
         }
       }
 
-      if (status == F_utf_not) {
+      if (setting->state.status == F_utf_not) {
         valid = F_false;
       }
 
@@ -63,7 +66,7 @@ extern "C" {
       utf8_process_text_width(&text);
     } // for
 
-    if (F_status_is_error_not(status) && !(setting->mode & utf8_mode_from_bytesequence_e)) {
+    if (F_status_is_error_not(setting->state.status) && !(setting->mode & utf8_mode_from_bytesequence_e)) {
       if (mode_codepoint != utf8_codepoint_mode_ready_e && mode_codepoint != utf8_codepoint_mode_end_e && mode_codepoint != utf8_codepoint_mode_bad_end_e && mode_codepoint != utf8_codepoint_mode_raw_end_e) {
         if (mode_codepoint == utf8_codepoint_mode_number_e) {
           mode_codepoint = utf8_codepoint_mode_end_e;
@@ -79,29 +82,26 @@ extern "C" {
         text.used = 0;
 
         if (mode_codepoint == utf8_codepoint_mode_raw_number_e) {
-          status = utf8_convert_raw(main, setting, text, &mode_codepoint);
+          utf8_convert_raw(main, setting, text, &mode_codepoint);
         }
         else {
-          status = utf8_convert_codepoint(main, setting, text, &mode_codepoint);
+          utf8_convert_codepoint(main, setting, text, &mode_codepoint);
         }
       }
     }
 
-    if (F_status_is_error(status)) {
-      f_file_stream_unlock(main->output.to);
-
-      return status;
-    }
-
     f_file_stream_unlock(main->output.to);
 
-    return valid;
+    if (F_status_is_error_not(setting->state.status)) {
+      setting->state.status = valid;
+    }
   }
 #endif // _di_utf8_process_text_
 
 #ifndef _di_utf8_process_text_width_
   void utf8_process_text_width(f_string_static_t *text) {
 
+    if (!text) return;
     if (!text->string[0]) return;
 
     text->used = 0;
similarity index 65%
rename from level_3/utf8/c/main/private-utf8.h
rename to level_3/utf8/c/main/process.h
index 6638f1209fd5a7a43288be9db29648d11240cd11..81db317b3325b01c5beab217e71b9d23d9568ddb 100644 (file)
@@ -5,8 +5,8 @@
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
  */
-#ifndef _PRIVATE_utf8_h
-#define _PRIVATE_utf8_h
+#ifndef _utf8_process_h
+#define _utf8_process_h
 
 #ifdef __cplusplus
 extern "C" {
@@ -23,14 +23,14 @@ extern "C" {
  *   This represent a single text data.
  *   This text is NULL terminated and can therefore not contain any NULLs.
  *
- * @return
- *   F_true on success and is valid.
- *   F_false on success and contains invalid sequences.
- *   F_interrupt on (exit) signal received.
+ *   This alters setting.state.status:
+ *     F_true on success and is valid.
+ *     F_false on success and contains invalid sequences.
+ *     F_interrupt on (exit) signal received.
  *
- *   Errors (with error bit) from: utf8_convert_bytesequence()
- *   Errors (with error bit) from: utf8_convert_codepoint()
- *   Errors (with error bit) from: utf8_detect_codepoint()
+ *     Errors (with error bit) from: utf8_convert_bytesequence()
+ *     Errors (with error bit) from: utf8_convert_codepoint()
+ *     Errors (with error bit) from: utf8_detect_codepoint()
  *
  * @see utf8_convert_bytesequence()
  * @see utf8_convert_codepoint()
@@ -38,7 +38,7 @@ extern "C" {
  * @see utf8_signal_received()
  */
 #ifndef _di_utf8_process_text_
-  extern f_status_t utf8_process_text(fll_program_data_t * const main, utf8_setting_t * const setting, f_string_static_t text) F_attribute_visibility_internal_d;
+  extern void utf8_process_text(fll_program_data_t * const main, utf8_setting_t * const setting, f_string_static_t text) F_attribute_visibility_internal_d;
 #endif // _di_utf8_process_text_
 
 /**
@@ -58,4 +58,4 @@ extern "C" {
 } // extern "C"
 #endif
 
-#endif // _PRIVATE_utf8_h
+#endif // _utf8_process_h
index 3d9f64c5e6932f86b75fe0252bd462eb7903bec2..06ca2c99cda02cca0ca090bdde6500c7c9a5affd 100644 (file)
@@ -1,8 +1,4 @@
 #include "utf8.h"
-#include "private-common.h"
-#include "private-utf8.h"
-#include "private-utf8_bytesequence.h"
-#include "private-utf8_codepoint.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -13,13 +9,13 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
       utf8_print_line_last_locked(setting, main->error);
 
       return;
     }
 
-    setting->status = F_none;
+    setting->state.status = F_none;
 
     if (setting->flag & utf8_main_flag_help_e) {
       utf8_print_help(setting, main->message);
@@ -51,13 +47,13 @@ extern "C" {
       utf8_print_section_header_pipe(setting, main->output);
 
       if (setting->mode & utf8_mode_from_bytesequence_e) {
-        setting->status = utf8_process_file_bytesequence(main, setting, file);
+        utf8_process_file_bytesequence(main, setting, file);
       }
       else {
-        setting->status = utf8_process_file_codepoint(main, setting, file);
+        utf8_process_file_codepoint(main, setting, file);
       }
 
-      if (F_status_is_error_not(setting->status)) {
+      if (F_status_is_error_not(setting->state.status)) {
         if (setting->mode & utf8_mode_to_bytesequence_e) {
           if (setting->flag & utf8_main_flag_header_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->output.to);
@@ -68,20 +64,20 @@ extern "C" {
         }
       }
 
-      if (F_status_is_error(setting->status) && F_status_set_fine(setting->status) != F_utf_fragment && F_status_set_fine(setting->status) != F_complete_not_utf) {
+      if (F_status_is_error(setting->state.status) && F_status_set_fine(setting->state.status) != F_utf_fragment && F_status_set_fine(setting->state.status) != F_complete_not_utf) {
         utf8_print_error_file(setting, main->error, setting->mode & utf8_mode_from_bytesequence_e ? macro_utf8_f(utf8_process_file_bytesequence) : macro_utf8_f(utf8_process_file_codepoint), f_string_empty_s, f_file_operation_process_s, fll_error_file_type_pipe_e);
       }
     }
 
     // Process "from" files.
-    if (F_status_is_error_not(setting->status) && setting->status != F_interrupt && (setting->flag & utf8_main_flag_file_from_e)) {
+    if (F_status_is_error_not(setting->state.status) && (setting->flag & utf8_main_flag_file_from_e)) {
       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 (f_array_length_t i = 0; i < setting->path_files_from.used && setting->status != F_interrupt; ++i) {
+      for (f_array_length_t i = 0; i < setting->path_files_from.used && F_status_is_error_not(setting->state.status); ++i) {
 
         if (!((++main->signal_check) % utf8_signal_check_d)) {
           if (fll_program_standard_signal_received(main)) {
-            setting->status = F_status_set_error(F_interrupt);
+            setting->state.status = F_status_set_error(F_interrupt);
 
             break;
           }
@@ -91,31 +87,31 @@ extern "C" {
 
         utf8_print_section_header_file(setting, main->output, setting->path_files_from.array[i], i);
 
-        setting->status = f_file_stream_open(setting->path_files_from.array[i], f_string_empty_s, &file);
+        setting->state.status = f_file_stream_open(setting->path_files_from.array[i], f_string_empty_s, &file);
 
-        if (F_status_is_error(setting->status)) {
+        if (F_status_is_error(setting->state.status)) {
           utf8_print_error_file(setting, main->error, macro_utf8_f(f_file_stream_open), setting->path_files_from.array[i], f_file_operation_open_s, fll_error_file_type_file_e);
 
           break;
         }
 
         if (setting->mode & utf8_mode_from_bytesequence_e) {
-          setting->status = utf8_process_file_bytesequence(main, setting, file);
+          utf8_process_file_bytesequence(main, setting, file);
         }
         else {
-          setting->status = utf8_process_file_codepoint(main, setting, file);
+          utf8_process_file_codepoint(main, setting, file);
         }
 
         f_file_stream_flush(file);
         f_file_stream_close(&file);
 
         if (setting->flag & utf8_main_flag_verify_e) {
-          if (setting->status == F_false) {
+          if (setting->state.status == F_false) {
             valid = F_false;
           }
         }
 
-        if (F_status_is_error_not(setting->status)) {
+        if (F_status_is_error_not(setting->state.status)) {
           if (setting->mode & utf8_mode_to_bytesequence_e) {
             if (setting->flag & utf8_main_flag_header_e) {
               fll_print_dynamic_raw(f_string_eol_s, main->output.to);
@@ -133,7 +129,7 @@ extern "C" {
           }
         }
 
-        if (F_status_is_error(setting->status) && F_status_set_fine(setting->status) != F_utf_fragment && F_status_set_fine(setting->status) != F_complete_not_utf) {
+        if (F_status_is_error(setting->state.status) && F_status_set_fine(setting->state.status) != F_utf_fragment && F_status_set_fine(setting->state.status) != F_complete_not_utf) {
           utf8_print_error_file(setting, main->error, setting->mode & utf8_mode_from_bytesequence_e ? macro_utf8_f(utf8_process_file_bytesequence) : macro_utf8_f(utf8_process_file_codepoint), setting->path_files_from.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
 
           break;
@@ -142,12 +138,12 @@ extern "C" {
     }
 
     // Process remaining parameters.
-    if (F_status_is_error_not(setting->status) && setting->status != F_interrupt && setting->remaining.used) {
-      for (f_array_length_t i = 0; F_status_is_error_not(setting->status) && i < setting->remaining.used; ++i) {
+    if (F_status_is_error_not(setting->state.status) && setting->remaining.used) {
+      for (f_array_length_t i = 0; F_status_is_error_not(setting->state.status) && i < setting->remaining.used; ++i) {
 
         if (!((++main->signal_check) % utf8_signal_check_d)) {
           if (fll_program_standard_signal_received(main)) {
-            setting->status = F_status_set_error(F_interrupt);
+            setting->state.status = F_status_set_error(F_interrupt);
 
             break;
           }
@@ -157,31 +153,31 @@ extern "C" {
 
         utf8_print_section_header_parameter(setting, main->output, main->parameters.remaining.array[i]);
 
-        setting->status = utf8_process_text(main, setting, main->parameters.arguments.array[main->parameters.remaining.array[i]]);
+        utf8_process_text(main, setting, main->parameters.arguments.array[main->parameters.remaining.array[i]]);
 
         if (setting->flag & utf8_main_flag_verify_e) {
-          if (setting->status == F_false) {
+          if (setting->state.status == F_false) {
             valid = F_false;
           }
         }
       } // for
     }
 
-    if (F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->state.status)) {
+      if (F_status_set_fine(setting->state.status) == F_interrupt) return;
+
       utf8_print_line_last_locked(setting, main->error);
 
       return;
     }
 
-    if (setting->status == F_interrupt) return;
-
     utf8_print_line_last_locked(setting, main->message);
 
     if (setting->flag & utf8_main_flag_verify_e) {
-      setting->status = valid;
+      setting->state.status = valid;
     }
     else {
-      setting->status = F_none;
+      setting->state.status = F_none;
     }
   }
 #endif // _di_utf8_main_
index 525fecc217d738fe7b491de48691facecfad6213..1f379f24b08f0d94bfb348c26a4a87b3decfc253 100644 (file)
 #include <program/utf8/main/common-string.h>
 #include <program/utf8/main/common-type.h>
 #include <program/utf8/main/common.h>
+#include <program/utf8/main/bytesequence.h>
+#include <program/utf8/main/codepoint.h>
 #include <program/utf8/main/print.h>
+#include <program/utf8/main/process.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -81,12 +84,12 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *
- *   This alters setting.status:
+ *   This alters setting.state.status:
  *     F_none on success.
  *     F_true on success when performing verification and verify passed.
  *     F_false on success when performing verification and verify failed.
- *     F_interrupt on (exit) signal received.
  *
+ *     F_interrupt (with error bit) on (exit) signal received.
  *     F_parameter (with error bit) if main is NULL or setting is NULL.
  */
 #ifndef _di_utf8_main_
index 541ebacbe1705353ff4fdf8b7585ad78d99efe29..fc11590b9615216dd81086be646b04feba2885e6 100644 (file)
@@ -22,12 +22,11 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library main/common.c main/common-print.c main/common-string.c main/common-type.c main/print.c main/utf8.c
-build_sources_library main/private-common.c main/private-utf8.c main/private-utf8_bytesequence.c main/private-utf8_codepoint.c
+build_sources_library main/common.c main/common-print.c main/common-string.c main/common-type.c main/bytesequence.c main/codepoint.c main/print.c main/process.c main/utf8.c
 
 build_sources_program main/main.c
 
-build_sources_headers main/common.h main/common-print.h main/common-string.h main/common-type.h main/print.h main/utf8.h
+build_sources_headers main/common.h main/common-print.h main/common-string.h main/common-type.h main/bytesequence.h main/codepoint.h main/print.h main/process.h main/utf8.h
 
 build_sources_documentation man