]> Kevux Git Server - fll/commitdiff
Progress: Continue work on fss_read, making relevant changes in other projects.
authorKevin Day <kevin@kevux.org>
Mon, 1 May 2023 03:02:04 +0000 (22:02 -0500)
committerKevin Day <kevin@kevux.org>
Mon, 1 May 2023 03:02:04 +0000 (22:02 -0500)
Start using "static" where it is safe to do so and easy for me to identify such cases.
I would note that a static array of const f_string_static_t does not work.

33 files changed:
level_2/fll_program/c/program/print.c
level_2/fll_program/c/program/print.h
level_3/byte_dump/c/common.c
level_3/control/c/common.c
level_3/controller/c/common.c
level_3/fake/c/main/build/load.c
level_3/fake/c/main/common.c
level_3/fake/c/main/fake/path_generate.c
level_3/fake/c/main/make/operate.c
level_3/fake/c/main/make/operate_validate_type.c
level_3/firewall/c/common.c
level_3/fss_basic_list_read/c/common.c
level_3/fss_basic_read/c/common.c
level_3/fss_embedded_list_read/c/common.c
level_3/fss_extended_list_read/c/common.c
level_3/fss_extended_read/c/common.c
level_3/fss_identify/c/common.c
level_3/fss_identify/c/fss_identify.c
level_3/fss_payload_read/c/common.c
level_3/fss_read/c/main/common.c
level_3/fss_read/c/main/common.h
level_3/fss_read/c/main/common/enumeration.h
level_3/fss_read/c/main/common/print.c
level_3/fss_read/c/main/common/print.h
level_3/fss_read/c/main/common/type.h
level_3/fss_read/c/main/print/error.c
level_3/fss_read/c/main/print/error.h
level_3/fss_write/c/main/common.c
level_3/fss_write/c/main/common/type.h
level_3/iki_read/c/main/common.c
level_3/iki_write/c/main/common.c
level_3/status_code/c/main/common.c
level_3/utf8/c/main/common.c

index 6cbfa5812bcf47a6a4bbc0dcaaf1e280eaf2b5c8..1205bf3f8458036216da0b50674d99fd544931f7 100644 (file)
@@ -210,6 +210,26 @@ extern "C" {
   }
 #endif // _di_fll_program_print_error_parameter_cannot_use_with_xor_
 
+#ifndef _di_fll_program_print_error_parameter_empty_value_
+  f_status_t fll_program_print_error_parameter_empty_value(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name) {
+    #ifndef _di_level_2_parameter_checking_
+      if (!print) return F_status_set_error(F_parameter);
+    #endif // _di_level_2_parameter_checking_
+
+    if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    f_file_stream_lock(print->to);
+
+    fl_print_format("%[%QThe parameter%] ", print->to, print->set->error, print->prefix, print->set->error);
+    fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+    fl_print_format(" %[is specified as an empty string, but an empty string is not allowed.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print->to);
+
+    return F_none;
+  }
+#endif // _di_fll_program_print_error_parameter_empty_value_
+
 #ifndef _di_fll_program_print_error_parameter_integer_not_
   f_status_t fll_program_print_error_parameter_integer_not(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
     #ifndef _di_level_2_parameter_checking_
index 47a61358f6e2b8eb052c28f686a876eb423fa607..f0ac8a49fdafeb3e50d3517288649b6aa86075e5 100644 (file)
@@ -305,6 +305,36 @@ extern "C" {
 #endif // _di_fll_program_print_error_parameter_allows_either_xor_
 
 /**
+ * Print message about parameter the parameter value being an empty string.
+ *
+ * This is only printed when verbosity is not set to quiet.
+ *
+ * This uses the following:
+ *   - print.set->error: For the error context.
+ *   - print.set->strong: For the highlighting context
+ *   - print.prefix: For the prefixing a string to the message (such as "ERROR:").
+ *
+ * @param print
+ *   The output structure.
+ *   This locks, uses, and unlocks the file stream.
+ * @param symbol
+ *   The symbol string prepended to both parameters.
+ *   This locks, uses, and unlocks the file stream.
+ *   This is usually f_console_symbol_long_normal_s.
+ * @param name
+ *   The parameter name.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_fll_program_print_error_parameter_empty_value_
+  extern f_status_t fll_program_print_error_parameter_empty_value(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name);
+#endif // _di_fll_program_print_error_parameter_empty_value_
+
+/**
  * Print message about parameter not being a valid integer.
  *
  * This is only printed when verbosity is not set to quiet.
index 5e57f08e119c0a5cea7378359f36b8acb6fed30e..daeaba42639d8184c3506ab9f83e023ebb46b224 100644 (file)
@@ -122,7 +122,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -143,7 +143,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index a6f6032d77f75b05c8d05d8496474535cddccfeb..9c59be5ecef1ea8f8f32f6581686b077373dfba9 100644 (file)
@@ -225,7 +225,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -246,7 +246,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 7c3a0eebfb00e6da30aed5dd11053cd39b8dad61..58c6e0f8f9b635eca196c9d7af76b900dd8acc7a 100644 (file)
@@ -657,7 +657,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -678,7 +678,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 2b4e3ca86fe4626b6de9b434842ec82fb8087d71..82e862d5ed207a6d73f181dd41d989d00fb0842e 100644 (file)
@@ -948,7 +948,7 @@ extern "C" {
         &setting->version_target,                    // version_target
       };
 
-      const uint8_t settings_single_version_default[] = {
+      static const uint8_t settings_single_version_default[] = {
         0,                                           // build_compiler
         0,                                           // build_indexer
         0,                                           // build_language
@@ -1035,7 +1035,7 @@ extern "C" {
       };
 
       // 1 = "yes" or "no", 2 = path/, 3 = literal, 4 = "bash", "c", or "c++", 5 = "major", "minor", "micro", or "nano".
-      const uint8_t settings_single_type[] = {
+      static const uint8_t settings_single_type[] = {
         3,                                           // build_compiler
         3,                                           // build_indexer
         4,                                           // build_language
index de56b30a6cb85972af817b0cc80f95a5b8605f1c..5be6e321c57bfc4f646050094b80a397991561f5 100644 (file)
@@ -59,7 +59,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -80,7 +80,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
@@ -121,19 +121,19 @@ extern "C" {
       uint8_t i = 0;
 
       {
-        const uint8_t enables[] = {
+        static const uint8_t enables[] = {
           fake_parameter_documents_enable_e,
           fake_parameter_shared_enable_e,
           fake_parameter_static_enable_e,
         };
 
-        const uint8_t disables[] = {
+        static const uint8_t disables[] = {
           fake_parameter_documents_enable_e,
           fake_parameter_shared_enable_e,
           fake_parameter_static_enable_e,
         };
 
-        const uint16_t flags[] = {
+        static const uint16_t flags[] = {
           fake_main_flag_enable_documents_e,
           fake_main_flag_enable_shared_e,
           fake_main_flag_enable_static_e,
@@ -161,7 +161,7 @@ extern "C" {
       }
 
       {
-        const f_array_length_t parameters[] = {
+        static const f_array_length_t parameters[] = {
           fake_parameter_build_e,
           fake_parameter_data_e,
           fake_parameter_documents_e,
@@ -219,7 +219,7 @@ extern "C" {
           fake_default_work_s,
         };
 
-        const bool cleanups[] = {
+        static const bool cleanups[] = {
           F_true,  // fake_parameter_build_e
           F_true,  // fake_parameter_data_e
           F_true,  // fake_parameter_documents_e
@@ -363,7 +363,7 @@ extern "C" {
       }
 
       {
-        const f_array_length_t parameters[] = {
+        static const f_array_length_t parameters[] = {
           fake_parameter_define_e,
           fake_parameter_mode_e,
         };
index 34c870d407fb9827cb65d3a762bd61ae881f204e..7f9dbfb79938446ab9f27a652df9100115d7608a 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
         main->setting.data,
       };
 
-      const uint8_t parameters_size[] = {
+      static const uint8_t parameters_size[] = {
         9,
         3,
       };
@@ -121,7 +121,7 @@ extern "C" {
         data->path_documents,
       };
 
-      const uint8_t parameters_size[] = {
+      static const uint8_t parameters_size[] = {
         3,
         3,
         3,
@@ -293,7 +293,7 @@ extern "C" {
           data->path_work_programs,
         };
 
-        const uint8_t parameters_size[] = {
+        static const uint8_t parameters_size[] = {
           3,
           3,
         };
index 58a04d10aeb3d6a6a8f560adc75c226716ad5d7d..eb160a894b0e2a64a3174452bc72f8f5459ae8cc 100644 (file)
@@ -1043,7 +1043,7 @@ extern "C" {
         data_make->setting_build.modes_default,
       };
 
-      const uint8_t dynamics_flag[] = {
+      static const uint8_t dynamics_flag[] = {
         0,                                         // build_libraries
         0,                                         // build_libraries_shared
         0,                                         // build_libraries_static
@@ -1306,7 +1306,7 @@ extern "C" {
       fake_make_operation_write_s,
     };
 
-    const uint8_t operations_type[] = {
+    static const uint8_t operations_type[] = {
       fake_make_operation_type_and_e,
       fake_make_operation_type_break_e,
       fake_make_operation_type_build_e,
index 0e86982718c8b1774ff1f1169817d883c3c02e8b..fbc0a16b5167e51a427879691e9ff91f5d37e3ee 100644 (file)
@@ -253,7 +253,7 @@ extern "C" {
         fake_make_operation_argument_if_success_s,
       };
 
-      const uint8_t if_type_codes[] = {
+      static const uint8_t if_type_codes[] = {
         fake_make_operation_if_type_if_define_e,
         fake_make_operation_if_type_if_equal_e,
         fake_make_operation_if_type_if_equal_not_e,
@@ -289,7 +289,7 @@ extern "C" {
         fake_make_operation_argument_if_parameter_s,
       };
 
-      const uint8_t if_not_type_codes[] = {
+      static const uint8_t if_not_type_codes[] = {
         fake_make_operation_if_type_if_not_define_e,
         fake_make_operation_if_type_if_not_exist_e,
         fake_make_operation_if_type_if_not_group_e,
index 65a4c261e2367cbcba22093d610b382fef7ca793..795ff4285354c100cb5762252b4a2f49a914526d 100644 (file)
@@ -156,7 +156,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -177,7 +177,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 9c75267c0688b90cedfb9a510eef85ef5baecac9..5bca369908444568c59a055b107f936662cc0eed 100644 (file)
@@ -116,7 +116,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -137,7 +137,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index aac561082ea74921f2ecb876ccc8dfe3e1e6a4d9..9b99afdf4f6438e4e57f08f4ee2a79aa99b7ba3a 100644 (file)
@@ -115,7 +115,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -136,7 +136,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 69baf61a414e825cd0f70864d7b9766bc1122bc4..cfa6775a8ec20b21eb814facc1d29cabb5569bdf 100644 (file)
@@ -114,7 +114,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -135,7 +135,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 88ec05d278ef746ba3707f877c8b290b189b9667..f7465ca982976343ebcb8524ff7374fb6565fa5d 100644 (file)
@@ -122,7 +122,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -143,7 +143,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 0f52cfced6fe7163383cb2d8f9ad696eb385da4d..93de956c4be7cbb77cdf4fa8d7a3fdb44c960dde 100644 (file)
@@ -115,7 +115,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -136,7 +136,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 5cd74c148ba4af7be57dc54a77617282d47c7dec..dd2e5bc78b52f6fd3a193bfd079b98cfd56f6884 100644 (file)
@@ -82,7 +82,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -103,7 +103,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 2544d2c32b4c486c7ae4c44600b6b4d29519c450..7e620942702d7d31239ca1639be0a27f147348e1 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -50,7 +50,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 698b8ac8589369dd2e438abdbf0f157539d16856..db2f7e67afdf1d8a3128c34a315f9add648ad10a 100644 (file)
@@ -116,7 +116,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -137,7 +137,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index e4c66e30d87838b69a7e29300c4c019c6a06c7d7..4108faa72e615c3c6bde60c05418e29d75e0990d 100644 (file)
@@ -116,623 +116,310 @@ extern "C" {
     if (main->program.parameters.array[fss_read_parameter_help_e].result & f_console_result_found_e) return;
     if (main->program.parameters.array[fss_read_parameter_version_e].result & f_console_result_found_e) return;
 
-    if (main->program.parameters.array[fss_read_parameter_strip_invalid_e].result & f_console_result_found_e) {
-      main->setting.flag |= fss_read_main_flag_strip_invalid_e;
-    }
-
-    if ((main->program.parameters.array[fss_read_parameter_file_e].result & f_console_result_value_e) && main->program.parameters.array[fss_read_parameter_file_e].values.used) {
-      if (main->program.parameters.array[fss_read_parameter_file_e].values.used > 1) {
-        main->setting.state.status = F_status_set_error(F_parameter);
-
-        if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-          fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-        }
-
-        fll_program_print_error_parameter_must_specify_once(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_file_s);
-
-        return;
-      }
-
-      const f_array_length_t index = main->program.parameters.array[fss_read_parameter_file_e].values.array[0];
-
-      main->program.output.to.id = -1;
-      main->program.output.to.stream = 0;
-
-      main->setting.state.status = f_file_stream_open(main->program.parameters.arguments.array[index], f_string_empty_s, &main->program.output.to);
-
-      if (F_status_is_error(main->setting.state.status)) {
-        if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-          fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-        }
-
-        fss_read_print_error_file(&main->program.error, macro_fss_read_f(f_file_stream_open), main->program.parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
-
-        return;
-      }
+    f_array_length_t i = 0;
 
-      main->setting.flag |= fss_read_main_flag_file_to_e;
-    }
-    else if (main->program.parameters.array[fss_read_parameter_file_e].result & f_console_result_found_e) {
-      main->setting.state.status = F_status_set_error(F_parameter);
+    {
+      static const f_array_length_t parameter_code[] = {
+        fss_read_parameter_at_e,
+        fss_read_parameter_depth_e,
+        fss_read_parameter_line_e,
+        fss_read_parameter_select_e,
+        fss_read_parameter_name_e,
+        fss_read_parameter_delimit_e,
+      };
 
-      if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-        fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-      }
+      const f_string_static_t parameter_name[] = {
+        fss_read_long_at_s,
+        fss_read_long_depth_s,
+        fss_read_long_line_s,
+        fss_read_long_select_s,
+        fss_read_long_name_s,
+        fss_read_long_delimit_s,
+      };
 
-      fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_file_s);
+      static const f_string_t message_positive_number = "a positive number";
+      static const f_string_t message_string = "a string";
+      static const f_string_t message_value = "a value";
+
+      static const f_string_t parameter_message[] = {
+        message_positive_number,
+        message_positive_number,
+        message_positive_number,
+        message_positive_number,
+        message_string,
+        message_value,
+      };
 
-      return;
-    }
+      for (i = 0; i < 6; ++i) {
 
-    if ((main->program.parameters.array[fss_read_parameter_object_e].result & f_console_result_value_e) && main->program.parameters.array[fss_read_parameter_object_e].values.used) {
-      f_array_lengths_t * const values = &main->program.parameters.array[fss_read_parameter_object_e].values;
+        if (main->program.parameters.array[parameter_code[i]].result & f_console_result_found_e)) {
+          main->setting.state.status = F_status_set_error(F_parameter);
 
-      main->setting.objects.used = 0;
+          if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+            fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+          }
 
-      main->setting.state.status = f_string_dynamics_resize(values->used, &main->setting.objects);
+          fss_read_print_error_parameter_requires_message(&main->error, f_console_symbol_long_normal_s, parameter_name[i], parameter_message[i]);
 
-      if (F_status_is_error(main->setting.state.status)) {
-        if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-          fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+          return;
         }
-
-        fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamics_resize));
-
-        return;
-      }
-
-      // Construct the array without allocating any more memory for the string data by setting this as a static string (used > 0, size = 0).
-      for (f_array_length_t index = 0; main->setting.objects.used < values->used; ) {
-
-        index = values->array[main->setting.objects.used];
-
-        main->setting.objects.array[main->setting.objects.used].string = main->program.parameters.arguments.array[index].string;
-        main->setting.objects.array[main->setting.objects.used].used = main->program.parameters.arguments.array[index].used;
-        main->setting.objects.array[main->setting.objects.used++].size = 0;
       } // for
-
-      main->setting.flag |= fss_read_main_flag_object_e;
     }
-    else if (main->program.parameters.array[fss_read_parameter_object_e].result & f_console_result_found_e) {
-      main->setting.state.status = F_status_set_error(F_parameter);
 
-      if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-        fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-      }
+    if (main->parameters.array[fss_read_parameter_columns_e].result & f_console_result_found_e) {
+      static const f_array_length_t parameter_code[] = {
+        fss_read_parameter_depth_e,
+        fss_read_parameter_line_e,
+        fss_read_parameter_pipe_e,
+        fss_read_parameter_select_e,
+        fss_read_parameter_total_e,
+      };
 
-      fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_object_s);
+      const f_string_static_t parameter_name[] = {
+        fss_read_long_depth_s,
+        fss_read_long_line_s,
+        fss_read_long_pipe_s,
+        fss_read_long_select_s,
+        fss_read_long_total_s,
+      };
 
-      return;
-    }
+      const uint8_t parameter_match[] = {
+        f_console_result_value_e,
+        f_console_result_value_e,
+        f_console_result_found_e,
+        f_console_result_value_e,
+        f_console_result_found_e,
+      };
 
-    if ((main->program.parameters.array[fss_read_parameter_content_e].result & f_console_result_value_e) && main->program.parameters.array[fss_read_parameter_content_e].values.used) {
+      for (i = 0; i < 5; ++i) {
 
-      if (main->setting.flag & fss_read_main_flag_object_e) {
-        if (!(main->setting.flag & fss_read_main_flag_content_multiple_e)) {
-          if (main->program.parameters.array[fss_read_parameter_content_e].values.used > main->program.parameters.array[fss_read_parameter_object_e].values.used) {
-            main->setting.state.status = F_status_set_error(F_support_not);
+        if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) {
+          main->setting.state.status = F_status_set_error(F_parameter);
 
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
             if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
               fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
             }
 
-            fss_read_print_error_one_content_only(&main->program.error);
-
-            return;
+            fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_read_long_columns_s, parameter_name[i]);
           }
-        }
-      }
-
-      f_array_length_t stub_object_array[1] = { 0 };
-      f_array_lengths_t stub_object = macro_f_array_lengths_t_initialize_1(stub_object_array, 0, 1);
-
-      f_array_lengths_t * const values_content = &main->program.parameters.array[fss_read_parameter_content_e].values;
-      f_array_lengths_t * const values_object = main->program.parameters.array[fss_read_parameter_object_e].values.used
-        ? &main->program.parameters.array[fss_read_parameter_object_e].values
-        : &stub_object;
-
-      main->setting.contentss.used = 0;
-
-      main->setting.state.status = f_string_dynamicss_increase_by(values_object->used, &main->setting.contentss);
-
-      if (F_status_is_error(main->setting.state.status)) {
-        if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-          fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-        }
-
-        fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamicss_increase_by));
-
-        return;
-      }
-
-      f_array_length_t i = 0; // For Contents.
-      f_array_length_t j = 0; // For Objects.
-      f_array_length_t k = 0;
-      f_array_length_t total = 0;
-      f_array_length_t index = 0;
-
-      // Construct the array without allocating any more memory for the string data by setting this as a static string (used > 0, size = 0).
-      while (i < values_content->used) {
 
-        // Determine the total Content associated with the given Object.
-        for (total = 0; i + total < values_content->used && (j + 1 >= values_object->used || values_content->array[i + total] < values_object->array[j + 1]); ++total) {
-          // Do nothing.
-        } // for
-
-
-        if (!total) {
-          ++main->setting.contentss.used;
-
-          if (++j < values_object->used) continue;
-
-          break;
+          return;
         }
+      } // for
+    }
 
-        main->setting.state.status = f_string_dynamics_increase_by(total, &main->setting.contentss.array[j]);
+    if (main->parameters.array[fss_read_parameter_pipe_e].result & f_console_result_found_e) {
+      if ((main->parameters.array[fss_read_parameter_total_e].result & f_console_result_found_e) || (main->parameters.array[fss_read_parameter_total_e].result & f_console_result_found_e)) {
+        main->setting.state.status = F_status_set_error(F_parameter);
 
-        if (F_status_is_error(main->setting.state.status)) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamics_increase_by));
-
-          return;
-        }
-
-        for (k = 0; k < total; ++k) {
-
-          index = values_content->array[i++];
-
-          main->setting.contentss.array[j].array[main->setting.contentss.array[j].used].string = main->program.parameters.arguments.array[index].string;
-          main->setting.contentss.array[j].array[main->setting.contentss.array[j].used].used = main->program.parameters.arguments.array[index].used;
-          main->setting.contentss.array[j].array[main->setting.contentss.array[j].used++].size = 0;
-        } // for
-      } // while
-
-      if (total) {
-        ++main->setting.contentss.used;
-      }
-
-      main->setting.flag |= fss_read_main_flag_content_e;
-    }
-    else if (main->program.parameters.array[fss_read_parameter_content_e].result & f_console_result_found_e) {
-      main->setting.state.status = F_status_set_error(F_parameter);
-
-      if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-        fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-      }
-
-      fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_content_s);
-
-      return;
-    }
-
-    if ((main->program.parameters.array[fss_read_parameter_prepend_e].result & f_console_result_value_e) && main->program.parameters.array[fss_read_parameter_prepend_e].values.used) {
-      const f_array_length_t index = main->program.parameters.array[fss_read_parameter_prepend_e].values.array[main->program.parameters.array[fss_read_parameter_prepend_e].values.used - 1];
-
-      main->setting.prepend.used = 0;
-
-      main->setting.state.status = f_string_dynamic_append_nulless(main->program.parameters.arguments.array[index], &main->setting.prepend);
-
-      if (F_status_is_error(main->setting.state.status)) {
-        if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-          fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+          fll_program_print_error_parameter_cannot_use_with(
+            &main->error, f_console_symbol_long_normal_s,
+            f_console_symbol_long_normal_s,
+            fss_read_long_pipe_s,
+            (main->parameters.array[fss_read_parameter_total_e].result & f_console_result_found_e)
+              ? fss_read_long_total_s
+              : fss_read_long_line_s
+          );
         }
 
-        fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamic_append_nulless));
-
         return;
       }
+    }
 
-      if (main->program.parameters.arguments.array[index].used) {
-        f_string_range_t range = macro_f_string_range_t_initialize_2(main->program.parameters.arguments.array[index].used);
+    if (main->parameters.array[fss_read_parameter_delimit_e].result & f_console_result_value_e) {
+      f_array_length_t index = 0;
+      f_array_length_t length = 0;
 
-        for (; range.start < main->program.parameters.arguments.array[index].used; range.start++) {
+      // Set the value to 0 to allow for detecting mode based on what is provided.
+      main->setting.delimit_mode = 0;
 
-          if (f_fss_is_space(main->program.parameters.arguments.array[index], range, &main->setting.state) == F_false) {
-            if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-              fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-            }
+      for (i = 0; i < main->parameters.array[fss_read_parameter_delimit_e].values.used; ++i) {
 
-            if (F_status_is_error(main->setting.state.status)) {
-              fss_read_print_error(&main->program.error, macro_fss_read_f(f_fss_is_space));
-            }
-            else {
-              main->setting.state.status = F_status_set_error(F_parameter);
+        if (!((++main->signal_check) % fss_read_signal_check_d)) {
+          if (fll_program_standard_signal_received(&main->program)) {
+            fll_program_print_signal_received(main->warning, main->signal_received);
 
-              fss_read_print_error_prepend_only_whitespace(&main->program.error);
-            }
+            main->setting.state.status = F_status_set_error(F_interrupt);
 
             return;
           }
-        } // for
-      }
 
-      main->setting.flag |= fss_read_main_flag_prepend_e;
-    }
-    else if (main->program.parameters.array[fss_read_parameter_prepend_e].result & f_console_result_found_e) {
-      main->setting.state.status = F_status_set_error(F_parameter);
-
-      if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-        fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-      }
-
-      fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_prepend_s);
-
-      return;
-    }
-
-    if ((main->program.parameters.array[fss_read_parameter_ignore_e].result & f_console_result_value_e) && main->program.parameters.array[fss_read_parameter_ignore_e].values.used) {
-      if (main->program.parameters.array[fss_read_parameter_ignore_e].values.used % 2 != 0) {
-        main->setting.state.status = F_status_set_error(F_parameter);
-
-        if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-          fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+          main->signal_check = 0;
         }
 
-        fll_program_print_error_parameter_missing_value_requires_amount(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_ignore_s, fss_read_string_two_s);
-
-        return;
-      }
-
-      // Only process if the standard designates that the ingore is supported.
-      if (main->setting.flag & fss_read_main_flag_ignore_e) {
-        f_array_length_t stub_data_array[1] = { 0 };
-        f_array_lengths_t stub_data = macro_f_array_lengths_t_initialize_1(stub_data_array, 0, 1);
-
-        f_array_lengths_t * const values_ignore = &main->program.parameters.array[fss_read_parameter_ignore_e].values;
-        f_array_lengths_t * const values_data = main->program.parameters.array[fss_read_parameter_object_e].values.used
-          ? &main->program.parameters.array[fss_read_parameter_object_e].values
-          : main->program.parameters.array[fss_read_parameter_content_e].values.used
-            ? &main->program.parameters.array[fss_read_parameter_content_e].values
-            : &stub_data;
+        index = main->parameters.array[fss_read_parameter_delimit_e].values.array[i];
+        length = main->program.parameters.arguments.array[index].used;
 
-        main->setting.ignoress.used = 0;
+        if (!length) {
+          main->setting.state.status = F_status_set_error(F_parameter);
 
-        main->setting.state.status = f_string_rangess_increase_by(values_data->used, &main->setting.ignoress);
-
-        if (F_status_is_error(main->setting.state.status)) {
           if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_rangess_increase_by));
+          fll_program_print_error_parameter_empty_value(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_file_s);
 
           return;
         }
 
-        f_array_length_t i = 0; // For Ignores.
-        f_array_length_t j = 0; // For Objects/Contents.
-        f_array_length_t k = 0;
-        f_array_length_t total = 0;
-        f_array_length_t index = 0;
+        if (f_compare_dynamic(fss_read_delimit_mode_name_none_s, main->program.parameters.arguments.array[index]) == F_equal_to) {
+          main->setting.delimit_mode = fss_read_delimit_mode_none_e;
+        }
+        else if (f_compare_dynamic(fss_read_delimit_mode_name_all_s, main->program.parameters.arguments.array[index]) == F_equal_to) {
+          main->setting.delimit_mode = fss_read_delimit_mode_all_e;
+        }
+        else if (f_compare_dynamic(fss_read_delimit_mode_name_object_s, main->program.parameters.arguments.array[index]) == F_equal_to) {
+          switch (main->setting.delimit_mode) {
+            case fss_read_delimit_mode_auto_e:
+              main->setting.delimit_mode = fss_read_delimit_mode_object_e;
 
-        // Construct the array without allocating any more memory for the string data by setting this as a static string (used > 0, size = 0).
-        while (i < values_ignore->used) {
+              break;
 
-          // Determine the total Ignore associated with the given Object/Content.
-          for (total = 0; i + total < values_ignore->used && (j + 1 >= values_data->used || values_ignore->array[i + total] < values_data->array[j + 1]); ++total) {
-            // Do nothing.
-          } // for
+            case fss_read_delimit_mode_none_e:
+            case fss_read_delimit_mode_all_e:
+            case fss_read_delimit_mode_content_greater_object_e:
+            case fss_read_delimit_mode_content_lesser_object_e:
+            case fss_read_delimit_mode_object_e:
+              break;
 
-          if (!total) {
-            ++main->setting.ignoress.used;
+            case fss_read_delimit_mode_content_e:
+              main->setting.delimit_mode = fss_read_delimit_mode_content_object_e;
 
-            if (++j < values_data->used) continue;
+              break;
 
-            break;
-          }
+            case fss_read_delimit_mode_content_greater_e:
+              main->setting.delimit_mode = fss_read_delimit_mode_content_greater_object_e;
 
-          main->setting.state.status = f_string_ranges_increase_by(total, &main->setting.ignoress.array[j]);
+              break;
 
-          if (F_status_is_error(main->setting.state.status)) {
-            if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-              fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-            }
+            case fss_read_delimit_mode_content_lesser_e:
+              main->setting.delimit_mode = fss_read_delimit_mode_content_lesser_object_e;
 
-            fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_ranges_increase_by));
+              break;
 
-            return;
+            default:
+              break;
+          }
+        }
+        else {
+          if (!main->setting.delimit_mode) {
+            main->setting.delimit_mode = fss_read_delimit_mode_content_e;
+          }
+          else if (main->setting.delimit_mode == fss_read_delimit_mode_object_e) {
+            main->setting.delimit_mode = fss_read_delimit_mode_content_object_e;
           }
 
-          for (k = 0; k < total; ++k) {
-
-            index = values_ignore->array[i++];
-
-            main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &main->setting.ignoress.array[j].array[main->setting.ignoress.array[j].used].start);
-
-            if (F_status_is_error(main->setting.state.status)) {
-              if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-                fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+          if (main->program.parameters.arguments.array[index].string[length - 1] == fss_read_delimit_mode_name_greater_s.string[0]) {
+            if (!(main->setting.delimit_mode == fss_read_delimit_mode_none_e || main->setting.delimit_mode == fss_read_delimit_mode_all_e)) {
+              if (main->setting.delimit_mode == fss_read_delimit_mode_content_object_e) {
+                main->setting.delimit_mode = fss_read_delimit_mode_content_greater_object_e;
               }
-
-              fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_ignore_s, main->program.parameters.arguments.array[index]);
-
-              return;
-            }
-
-            index = values_ignore->array[i++];
-
-            main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &main->setting.ignoress.array[j].array[main->setting.ignoress.array[j].used].stop);
-
-            if (F_status_is_error(main->setting.state.status)) {
-              if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-                fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+              else {
+                main->setting.delimit_mode = fss_read_delimit_mode_content_greater_e;
               }
-
-              fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_ignore_s, main->program.parameters.arguments.array[index]);
-
-              return;
             }
 
-            if (main->setting.ignoress.array[j].array[main->setting.ignoress.array[j].used].stop > main->setting.ignoress.array[j].array[main->setting.ignoress.array[j].used].start) {
-              main->setting.state.status = F_status_set_error(F_parameter);
-
-              if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-                fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+            // Shorten the length to better convert the remainder to a number.
+            --length;
+          }
+          else if (main->program.parameters.arguments.array[index].string[length - 1] == fss_read_delimit_mode_name_lesser_s.string[0]) {
+            if (!(main->setting.delimit_mode == fss_read_delimit_mode_none_e || main->setting.delimit_mode == fss_read_delimit_mode_all_e)) {
+              if (main->setting.delimit_mode == fss_read_delimit_mode_content_object_e) {
+                main->setting.delimit_mode = fss_read_delimit_mode_content_lesser_object_e;
+              }
+              else {
+                main->setting.delimit_mode = fss_read_delimit_mode_content_lesser_e;
               }
-
-              fll_program_print_error_parameter_range_start_before_stop(
-                &main->program.error,
-                f_console_symbol_long_normal_s,
-                fss_read_long_ignore_s,
-                main->program.parameters.arguments.array[values_ignore->array[i - 1]],
-                main->program.parameters.arguments.array[index]
-              );
-
-              return;
-            }
-
-            ++main->setting.ignoress.array[j].used;
-          } // for
-        } // while
-
-        if (total) {
-          ++main->setting.ignoress.used;
-        }
-      }
-      else {
-
-        // Still validate the parameters, even if not being used.
-        f_array_length_t i = 0;
-        f_array_length_t index = 0;
-        f_string_range_t number = f_string_range_t_initialize;
-
-        while (i < main->program.parameters.array[fss_read_parameter_ignore_e].values.used) {
-
-          index = main->program.parameters.array[fss_read_parameter_ignore_e].values.array[i++];
-
-          main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &number.start);
-
-          if (F_status_is_error(main->setting.state.status)) {
-            if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-              fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
             }
 
-            fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_ignore_s, main->program.parameters.arguments.array[index]);
+            // Shorten the length to better convert the remainder to a number.
+            --length;
+          }
 
-            return;
+          if (length) {
+            main->setting.range.start = 0;
+            main->setting.range.stop = length - 1;
+          }
+          else {
+            main->setting.range.start = 1;
+            main->setting.range.stop = 0;
           }
 
-          index = main->program.parameters.array[fss_read_parameter_ignore_e].values.array[i++];
+          // Ignore leading plus sign.
+          if (main->program.parameters.arguments.array[index].string[0] == f_string_ascii_plus_s.string[0]) {
+            ++main->setting.range.start;
+          }
 
-          main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &number.stop);
+          main->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], main->setting.range, &main->setting.delimit_depth);
 
           if (F_status_is_error(main->setting.state.status)) {
             if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
               fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
             }
 
-            fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_ignore_s, main->program.parameters.arguments.array[index]);
+            fll_error_parameter_integer_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_partial_to_unsigned_detect), F_true, fss_read_long_delimit_s, main->program.parameters.arguments.array[index]);
 
             return;
           }
 
-          if (number.start > number.stop) {
-            main->setting.state.status = F_status_set_error(F_parameter);
-
-            if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-              fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+          // There can be nothing smaller than 0, so replace '0-' logic with just '0' logic.
+          if (main->setting.delimit_mode == fss_read_delimit_mode_content_lesser_e || main->setting.delimit_mode == fss_read_delimit_mode_content_lesser_object_e) {
+            if (!main->setting.delimit_depth) {
+              if (main->setting.delimit_mode == fss_read_delimit_mode_content_lesser_e) {
+                main->setting.delimit_mode = fss_read_delimit_mode_content_e;
+              }
+              else {
+                main->setting.delimit_mode = fss_read_delimit_mode_content_object_e;
+              }
             }
-
-            fll_program_print_error_parameter_range_start_before_stop(
-              &main->program.error,
-              f_console_symbol_long_normal_s,
-              fss_read_long_ignore_s,
-              main->program.parameters.arguments.array[main->program.parameters.array[fss_read_parameter_ignore_e].values.array[i - 1]],
-              main->program.parameters.arguments.array[index]
-            );
-
-            return;
           }
-        } // while
+        }
+      } // for
+
+      // Guarantee the default value is "all".
+      if (!main->setting.delimit_mode) {
+        main->setting.delimit_mode = fss_read_delimit_mode_all_e;
       }
     }
-    else if (main->program.parameters.array[fss_read_parameter_ignore_e].result & f_console_result_found_e) {
-      main->setting.state.status = F_status_set_error(F_parameter);
 
+    main->setting.state.status = fss_read_depth_process(main, &data);
+
+    if (F_status_is_error(main->setting.state.status) {
       if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
         fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
       }
 
-      fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_ignore_s);
+      fss_read_print_error(&main->program.error, macro_fss_read_f(fss_read_depth_process));
 
       return;
     }
-    else {
-
-      // There is no Object or Content, so remove ignores if set.
-      if (main->setting.flag & fss_read_main_flag_ignore_e) {
-        main->setting.flag -= fss_read_main_flag_ignore_e;
-      }
-    }
-
-    if (main->program.parameters.array[fss_read_parameter_partial_e].result & f_console_result_found_e) {
-      main->setting.flag |= fss_read_main_flag_partial_e;
-    }
-
-    {
-      const uint32_t has[] = {
-        fss_read_parameter_content_end_e,
-        fss_read_parameter_content_next_e,
-        fss_read_parameter_object_open_e,
-      };
-
-      const uint16_t has_flag[] = {
-        fss_read_main_flag_content_end_e,
-        fss_read_main_flag_content_next_e,
-        fss_read_main_flag_object_open_e,
-      };
-
-      const f_string_static_t has_string[] = {
-        fss_read_long_content_end_s,
-        fss_read_long_content_next_s,
-        fss_read_long_object_open_s,
-      };
-
-      const uint16_t has_cannots[][2] = {
-        { fss_read_parameter_content_next_e, fss_read_parameter_object_open_e },
-        { fss_read_parameter_content_end_e, fss_read_parameter_object_open_e },
-        { fss_read_parameter_content_end_e, fss_read_parameter_content_next_e },
-      };
 
-      const f_string_static_t has_cannots_string[][2] = {
-        { fss_read_long_content_next_s, fss_read_long_object_open_s },
-        { fss_read_long_content_end_s, fss_read_long_object_open_s },
-        { fss_read_long_content_end_s, fss_read_long_content_next_s },
-      };
+    // @todo: Some standards do not support nesting, so any depth greater than 0 can be predicted without processing the file, this check needs to happen in the program specific settings processing function.
+    // if (data.depths.array[0].depth) { ...
 
-      for (uint8_t i = 0; i < 3; ++i) {
-
-        if (main->program.parameters.array[has[i]].result & f_console_result_found_e) {
-          if (main->setting.flag & (fss_read_main_flag_object_e | fss_read_main_flag_content_e)) {
-            if (!(main->setting.flag & fss_read_main_flag_partial_e)) {
-              main->setting.state.status = F_status_set_error(F_parameter);
-
-              if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
-                fll_print_dynamic_raw(f_string_eol_s, main->program.error.to);
-              }
-
-              fll_program_print_error_parameter_cannot_use_with_without(
-                &main->program.error,
-                f_console_symbol_long_normal_s,
-                f_console_symbol_long_normal_s,
-                f_console_symbol_long_normal_s,
-                has_string[i],
-                (main->setting.flag & fss_read_main_flag_object_e)
-                  ? fss_read_long_object_s
-                  : fss_read_long_content_s,
-                fss_read_long_partial_s
-              );
-
-              return;
-            }
-          }
-
-          if (main->program.parameters.array[has_cannots[i][0]].result & f_console_result_found_e) {
-            main->setting.state.status = F_status_set_error(F_parameter);
-
-            if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-              fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-            }
-
-            fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][0]);
-
-            return;
-          }
-
-          if (main->program.parameters.array[has_cannots[i][1]].result & f_console_result_found_e) {
-            main->setting.state.status = F_status_set_error(F_parameter);
-
-            if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-              fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-            }
-
-            fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][1]);
-
-            return;
-          }
-
-          main->setting.flag |= has_flag[i];
-        }
-      } // for
-    }
-
-    if (main->setting.flag & (fss_read_main_flag_object_e | fss_read_main_flag_content_e)) {
-      if (main->setting.flag & fss_read_main_flag_object_e) {
-        if (main->setting.flag & fss_read_main_flag_content_multiple_e) {
-          if (main->program.parameters.array[fss_read_parameter_object_e].locations_sub.used > main->program.parameters.array[fss_read_parameter_content_e].locations_sub.used && !(main->setting.flag & fss_read_main_flag_partial_e)) {
-            main->setting.state.status = F_status_set_error(F_parameter);
-
-            if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-              fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-            }
-
-            fss_read_print_error_parameter_same_times_at_least(&main->program.error);
-
-            return;
-          }
-        }
-
-        if ((main->setting.flag & fss_read_main_flag_content_e) && (main->setting.flag & fss_read_main_flag_partial_e)) {
-          if (main->program.parameters.array[fss_read_parameter_content_e].result & f_console_result_value_e) {
-            main->setting.state.status = F_status_set_error(F_parameter);
-
-            if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
-              fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
-            }
-
-            fll_program_print_error_parameter_cannot_use_with_xor(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_read_long_partial_s, fss_read_long_object_s, fss_read_long_content_s);
+    if (main->parameters.array[fss_read_parameter_select_e].result & f_console_result_found_e) {
+      main->setting.state.status = F_status_set_error(F_parameter);
 
-            return;
-          }
-        }
+      if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+        fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
       }
-    }
-
-    main->setting.quote = f_fss_quote_double_s;
 
-    if (main->program.parameters.array[fss_read_parameter_double_e].result & f_console_result_found_e) {
-      if (main->program.parameters.array[fss_read_parameter_single_e].result & f_console_result_found_e) {
-        if (main->program.parameters.array[fss_read_parameter_double_e].location < main->program.parameters.array[fss_read_parameter_single_e].location) {
-          main->setting.quote = f_fss_quote_single_s;
-
-          if (main->program.parameters.array[fss_read_parameter_backtick_e].result & f_console_result_found_e) {
-            if (main->program.parameters.array[fss_read_parameter_single_e].location < main->program.parameters.array[fss_read_parameter_backtick_e].location) {
-              main->setting.quote = f_fss_quote_backtick_s;
-            }
-          }
-        }
-        else if (main->program.parameters.array[fss_read_parameter_backtick_e].result & f_console_result_found_e) {
-          if (main->program.parameters.array[fss_read_parameter_double_e].location < main->program.parameters.array[fss_read_parameter_backtick_e].location) {
-            main->setting.quote = f_fss_quote_backtick_s;
-          }
-        }
-      }
-      else if (main->program.parameters.array[fss_read_parameter_backtick_e].result & f_console_result_found_e) {
-        if (main->program.parameters.array[fss_read_parameter_double_e].location < main->program.parameters.array[fss_read_parameter_backtick_e].location) {
-          main->setting.quote = f_fss_quote_backtick_s;
-        }
-      }
-    }
-    else if (main->program.parameters.array[fss_read_parameter_single_e].result & f_console_result_found_e) {
-      main->setting.quote = f_fss_quote_single_s;
+      fll_program_print_error_parameter_integer_not_positive(&main->error, f_console_symbol_long_normal_s, fss_read_long_select_s);
 
-      if (main->program.parameters.array[fss_read_parameter_backtick_e].result & f_console_result_found_e) {
-        if (main->program.parameters.array[fss_read_parameter_single_e].location < main->program.parameters.array[fss_read_parameter_backtick_e].location) {
-          main->setting.quote = f_fss_quote_backtick_s;
-        }
-      }
-    }
-    else if (main->program.parameters.array[fss_read_parameter_backtick_e].result & f_console_result_found_e) {
-      main->setting.quote = f_fss_quote_backtick_s;
+      return;
     }
 
     if (main->program.parameters.array[fss_read_parameter_trim_e].result & f_console_result_found_e) {
       main->setting.flag |= fss_read_main_flag_trim_e;
     }
 
+    // @fixme this is from fss_write, but doing some sort of file check, such as no pipe and no files may be a good idea here. Replace this with such logic if deemed desirable.
     if (!(main->setting.flag & (fll_program_data_pipe_input_e | fss_read_main_flag_content_e | fss_read_parameter_object_e))) {
       main->setting.state.status = F_data_not;
     }
index c7324e0c57fa0214d74b4ed24be1a7c918565521..d2188fe6a1c0c1176b0b233d628a57eaa90c1fe5 100644 (file)
@@ -27,10 +27,10 @@ extern "C" {
  *   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:
+ *   This alters main.setting.range.
+ *
+ *   This alters main.setting.state.status:
  *     F_none on success.
  *     F_data_not on success but nothing was provided to operate with.
  *
index 8d93568c9590e1f4dc0edc04b5d03f752ed6f246..034dbb3e0dbe7a89f0ee413cc18f149a1fca242f 100644 (file)
@@ -21,20 +21,40 @@ extern "C" {
  *
  * fss_read_main_flag_*_e:
  *   - none:        No flags set.
+ *   - at:          The object at the given position is being selected (Think of this as select a row for some Object).
+ *   - columns:     The total columns found and selected is printed instead of the Content.
+ *   - content:     The Content is to be printed.
  *   - copyright:   Print copyright.
+ *   - empty:       Empty Content will be printed (Objects that have no Content will have their empty Content printed).
  *   - help:        Print help.
+ *   - line:        A specific Content at a given line is to be selected (Think of this as select a row for some Content).
+ *   - name:        A specific Object name has been requested.
+ *   - object:      The Object is to be printed.
+ *   - original:    Enable original printing, where the quotes are printed and no delimits are applied.
  *   - print_first: When set, print new line to message output on program begin after loading settings.
  *   - print_last:  When set, print new line to message output on program end.
- *   - trim:        Trim Object names.
+ *   - select:      A specific Content at a given position is to be selected (Think of this as select a column for some Content).
+ *   - total:       The total lines found and selected is printed instead of the Content.
+ *   - trim:        Empty space before and after Objects and Content will not be printed (They will be trimmed).
  *   - version:     Print version.
  */
 #ifndef _di_fss_read_main_flag_e_
   enum {
     fss_read_main_flag_none_e        = 0x0,
-    fss_read_main_flag_copyright_e   = 0x10,
-    fss_read_main_flag_help_e        = 0x40,
-    fss_read_main_flag_print_first_e = 0x1000,
-    fss_read_main_flag_print_last_e  = 0x2000,
+    fss_read_main_flag_at_d          = 0x1,
+    fss_read_main_flag_columns_d     = 0x2,
+    fss_read_main_flag_content_d     = 0x4,
+    fss_read_main_flag_copyright_e   = 0x8,
+    fss_read_main_flag_empty_d       = 0x10,
+    fss_read_main_flag_help_e        = 0x20,
+    fss_read_main_flag_line_d        = 0x40,
+    fss_read_main_flag_name_d        = 0x80,
+    fss_read_main_flag_object_d      = 0x100,
+    fss_read_main_flag_original_d    = 0x200,
+    fss_read_main_flag_print_first_e = 0x400,
+    fss_read_main_flag_print_last_e  = 0x800,
+    fss_read_main_flag_select_d      = 0x1000,
+    fss_read_main_flag_total_d       = 0x2000,
     fss_read_main_flag_trim_e        = 0x4000,
     fss_read_main_flag_version_e     = 0x8000,
   }; // enum
@@ -127,6 +147,8 @@ extern "C" {
  * FSS Delimit Parameter enumerations.
  *
  * fss_read_delimit_mode_*_e:
+ *   - auto:                   Delimit mode is automatically set.
+ *   - none:                   Delimit mode is set to none.
  *   - all:                    All delimits are to be applied.
  *   - content:                Content are to have delimits applied.
  *   - content_greater:        Content at this number or higher are to have delimits applied.
@@ -138,7 +160,8 @@ extern "C" {
  */
 #ifndef _di_fss_read_delimit_mode_e_
   enum {
-    fss_read_delimit_mode_none_e = 0,
+    fss_read_delimit_mode_auto_e = 0,
+    fss_read_delimit_mode_none_e,
     fss_read_delimit_mode_all_e,
     fss_read_delimit_mode_content_e,
     fss_read_delimit_mode_content_greater_e,
index 65862b97b3a89cf77ad5b21e6f8841bdf8a48b31..5b0dc166a1b78371f6122d99355b5b001b0c9f01 100644 (file)
@@ -24,6 +24,7 @@ extern "C" {
     "f_string_rangess_increase_by",
     "f_string_read_block_increase",
     "f_thread_create",
+    "fl_conversion_dynamic_partial_to_unsigned_detect",
     "fl_fss_basic_content_read",
     "fl_fss_basic_list_content_read",
     "fl_fss_basic_list_object_read",
@@ -38,6 +39,7 @@ extern "C" {
     "fll_program_parameter_process_context",
     "fll_program_parameter_process_verbosity",
     "fll_fss_payload_read",
+    "fss_read_depth_process",
   };
 #endif // _di_fss_read_f_a_
 
index f55bb143064251954e21074e87bb2d7f4cb9e499..7c63948101843afd48241851595255418224f979 100644 (file)
@@ -57,6 +57,7 @@ extern "C" {
     fss_read_f_f_string_rangess_increase_by_e,
     fss_read_f_f_string_read_block_increase_e,
     fss_read_f_f_thread_create_e,
+    fss_read_f_fl_conversion_dynamic_partial_to_unsigned_detect_e,
     fss_read_f_fl_fss_basic_content_read_e,
     fss_read_f_fl_fss_basic_list_content_read_e,
     fss_read_f_fl_fss_basic_list_object_read_e,
@@ -71,6 +72,7 @@ extern "C" {
     fss_read_f_fll_program_parameter_process_context_e,
     fss_read_f_fll_program_parameter_process_verbosity_e,
     fss_read_f_fll_fss_payload_read_e,
+    fss_rerad_f_fss_read_depth_process_e,
   }; // enum
 #endif // _di_fss_read_f_e_
 
index dcecf1c1761aa6b0a41a0abafc4a38cf3c50ff39..5f3af403b41287e0d6cabd3e51f29c1f87d568e2 100644 (file)
@@ -17,6 +17,47 @@ extern "C" {
 #endif
 
 /**
+ * A structure for designating where within the buffer a particular file exists, using a statically allocated array.
+ *
+ * name:  The name of the file representing the range.
+ * range: A range within the buffer representing the file.
+ */
+#ifndef _di_fss_read_file_t_
+  typedef struct {
+    f_string_static_t name;
+    f_string_range_t range;
+  } fss_read_file_t;
+
+  #define fss_read_file_t_initialize \
+    { \
+      f_string_static_t_initialize, \
+      f_string_range_t_initialize, \
+    }
+#endif // _di_fss_read_file_t_
+
+/**
+ * An array of files.
+ *
+ * This is intended to be defined and used statically allocated and as such no dynamic allocation or dynamic deallocation methods are provided.
+ *
+ * The STDIN pipe is reserved for index 0 and as such the first index must be reserved and the used should be set to at least 1.
+ *
+ * array: The array of depths.
+ * size:  Total amount of allocated space.
+ * used:  Total number of allocated spaces used.
+ */
+#ifndef _di_fss_read_files_t_
+  typedef struct {
+    fss_read_file_t *array;
+
+    f_array_length_t size;
+    f_array_length_t used;
+  } fss_read_files_t;
+
+  #define fss_read_files_t_initialize { 0, 0, 0 }
+#endif // _di_fss_read_files_t_
+
+/**
  * The fss read main program settings.
  *
  * This is passed to the program-specific main entry point to designate program settings.
@@ -24,28 +65,29 @@ extern "C" {
  *
  * For all function pointers on this structure, the main variable must be of type fss_read_main_t.
  *
- * flag: Flags passed to the main function.
+ * flag:         Flags passed to the main function.
+ * delimit_mode: The delimit mode.
  *
  * status_thread: A status used eclusively by the threaded signal handler.
  * state:         The state data used when processing the FSS data.
  *
- * range: A range used as a buffer during processing.
+ * delimit_depth: The delimit depth.
+ * select:        The Content to select (column number).
+ * line:          The Content to select (row number).
  *
- * quote:    This holds the quote used during processing.
- * standard: A human-friendly string describing the standard in use, such as "FSS-0000 (Basic)".
+ * range: A range used in conjunction with some buffer during processing.
  *
- * escaped: A buffer used for escaping strings during processing.
- * block:   A buffer used to storing one or more blocks while processing a file line by line.
- * buffer:  A buffer used during processing the file.
- * prepend: A string to prepend to each multi-line Content.
+ * files:  A statically allocated array of files for designating where in the buffer a file is represented.
+ * depths: The array of parameters for each given depth.
  *
- * ignoress:  An array of range sets passed as values to the "--ignore" parameter or via the input pipe.
- * objects:   An array of objects passed as values to the "--object" parameter or via the input pipe.
- * contentss: An array of content sets passed as values to the "--content" parameter or via the input pipe.
+ * standard: A human-friendly string describing the standard in use, such as "FSS-0000 (Basic)".
+ * buffer:   The buffer containing all loaded files (and STDIN pipe).
  *
- * object:   A pointer to a specific Object used during processing.
- * content:  A pointer to a specific Content used during processing.
- * contents: A pointer to a specific set of Content used during processing.
+ * objects:          The positions within the buffer representing Objects.
+ * contents:         The positions within the buffer representing Contents.
+ * delimits_object:  The positions within the buffer representing Object character delimits.
+ * delimits_content: The positions within the buffer representing Content character delimits.
+ * comments:         The positions within the buffer representing comments.
  *
  * process_content: Process a single Content.
  * process_help:    Process help (generally printing help).
@@ -57,28 +99,28 @@ extern "C" {
 #ifndef _di_fss_read_setting_t_
   typedef struct {
     uint16_t flag;
+    uint8_t delimit_mode;
 
     f_status_t status_thread;
     f_state_t state;
 
+    f_array_length_t delimit_depth;
+    f_number_unsigned_t select;
+    f_number_unsigned_t line;
+
     f_string_range_t range;
 
-    f_string_static_t quote;
-    f_string_static_t standard;
+    fss_read_files_t files;
+    fss_read_depths_t depths;
 
-    f_string_dynamic_t escaped;
-    f_string_dynamic_t block;
+    f_string_static_t standard;
     f_string_dynamic_t buffer;
-    f_string_dynamic_t prepend;
-
-    f_string_rangess_t ignoress;
-    f_string_dynamics_t objects;
-    f_string_dynamicss_t contentss;
 
-    f_string_ranges_t *ignores;
-    f_string_static_t *object;
-    f_string_static_t *content;
-    f_string_statics_t *contents;
+    f_fss_objects_t objects;
+    f_fss_contents_t contents;
+    f_fss_delimits_t delimits_object;
+    f_fss_delimits_t delimits_content;
+    f_fss_comments_t comments;
 
     void (*process_content)(void * const main, const bool last);
     void (*process_help)(void * const main);
@@ -91,22 +133,22 @@ extern "C" {
   #define fss_read_setting_t_initialize \
     { \
       fss_read_main_flag_none_e, \
+      fss_read_delimit_mode_all_e, \
       F_none, \
       macro_f_state_t_initialize_1(fss_read_allocation_large_d, fss_read_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0, 0), \
-      f_string_range_t_initialize, \
-      f_string_static_t_initialize, \
-      f_string_static_t_initialize, \
-      f_string_dynamic_t_initialize, \
-      f_string_dynamic_t_initialize, \
-      f_string_dynamic_t_initialize, \
-      f_string_dynamic_t_initialize, \
-      f_string_rangess_t_initialize, \
-      f_string_dynamics_t_initialize, \
-      f_string_dynamicss_t_initialize, \
-      0, \
       0, \
       0, \
       0, \
+      f_string_range_t_initialize, \
+      fss_read_files_t_initialize, \
+      fss_read_depths_t_initialize, \
+      f_string_static_t_initialize, \
+      f_string_dynamic_t_initialize, \
+      f_fss_objects_t_initialize, \
+      f_fss_contents_t_initialize, \
+      f_fss_delimits_t_initialize, \
+      f_fss_delimits_t_initialize, \
+      f_fss_comments_t_initialize, \
       0, \
       0, \
       0, \
index 9333887b5dc0ddb2fb4614cab0f00d28d0f74d2a..024bf133fae4de843cbfe640f7bae6617d7be50d 100644 (file)
@@ -50,6 +50,24 @@ extern "C" {
   }
 #endif // _di_fss_read_print_error_parameter_same_times_at_least_
 
+#ifndef _di_fss_read_print_error_parameter_requires_message_
+  f_status_t fss_read_print_error_parameter_requires_message(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t message) {
+
+    if (!print) return F_status_set_error(F_output_not);
+    if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print->to);
+
+    fl_print_format("%[%QThe parameter '%]", print->to, print->context, print->prefix, print->context);
+    fl_print_format("%[%r%r%]", print->to, print->notable, symbol, name, print->notable);
+    fl_print_format("%[' requires %s.%]%r", print->to, print->context, message, print->context, f_string_eol_s);
+
+    f_file_stream_unlock(print->to);
+
+    return F_none;
+  }
+#endif // _di_fss_read_print_error_parameter_requires_message_
+
 #ifndef _di_fss_read_print_error_one_content_only_
   f_status_t fss_read_print_error_one_content_only(fl_print_t * const print) {
 
index e8235601e4725a3d2c5581d3e905dfc4cbb0ed7f..1d1e115545657976d2763121849736f74bf4e72d 100644 (file)
@@ -86,6 +86,25 @@ extern "C" {
 #endif // _di_fss_read_print_error_parameter_same_times_at_least_
 
 /**
+ * Print an error message about the parameter requires something that is explained by the message parameter.
+ *
+ * @param print
+ *   The output structure to print to.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param symbol
+ *   The symbol string prepended to the first parameter.
+ *   This is usually f_console_symbol_long_normal_s.
+ * @param name
+ *   The parameter name.
+ * @param message
+ *   The message to print regarding why the message should be displayed.
+ */
+#ifndef _di_fss_read_print_error_parameter_requires_message_
+  extern f_status_t fss_read_print_error_parameter_requires_message(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t message);
+#endif // _di_fss_read_print_error_parameter_requires_message_
+
+/**
  * Print an message about a multiple Content being unsupported for a particular standard.
  *
  * @param print
index c4e339610454197f554abd1a7d937dcd7ff0a35e..26e2484a43babb244d194a2adc1cb9cc5e034451 100644 (file)
@@ -49,7 +49,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -70,7 +70,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
@@ -569,13 +569,13 @@ extern "C" {
     }
 
     {
-      const uint32_t has[] = {
+      static const uint32_t has[] = {
         fss_write_parameter_content_end_e,
         fss_write_parameter_content_next_e,
         fss_write_parameter_object_open_e,
       };
 
-      const uint16_t has_flag[] = {
+      static const uint16_t has_flag[] = {
         fss_write_main_flag_content_end_e,
         fss_write_main_flag_content_next_e,
         fss_write_main_flag_object_open_e,
@@ -587,7 +587,7 @@ extern "C" {
         fss_write_long_object_open_s,
       };
 
-      const uint16_t has_cannots[][2] = {
+      static const uint16_t has_cannots[][2] = {
         { fss_write_parameter_content_next_e, fss_write_parameter_object_open_e },
         { fss_write_parameter_content_end_e, fss_write_parameter_object_open_e },
         { fss_write_parameter_content_end_e, fss_write_parameter_content_next_e },
index 2985fea7b8141db8bb5d6ca5c06f9675b94e3f7f..4a290bd5251470eea941ad5bc46073a08e4aa2c7 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
  * status_thread: A status used eclusively by the threaded signal handler.
  * state:         The state data used when processing the FSS data.
  *
- * range: A range used as a buffer during processing.
+ * range: A range used in conjunction with some buffer during processing.
  *
  * quote:    This holds the quote used during processing.
  * standard: A human-friendly string describing the standard in use, such as "FSS-0000 (Basic)".
index 988f8474072d09724d6057cac12e5bd2ea641f78..29aa0886bd1a7ba56d9501955236ceff27ef2cd2 100644 (file)
@@ -49,7 +49,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -70,7 +70,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
@@ -447,7 +447,7 @@ extern "C" {
     }
 
     if (main->program.parameters.array[iki_read_parameter_literal_e].result & f_console_result_found_e) {
-      const uint8_t ids[3] = {
+      static const uint8_t ids[3] = {
         iki_read_parameter_object_e,
         iki_read_parameter_content_e,
         iki_read_parameter_total_e,
@@ -477,7 +477,7 @@ extern "C" {
       main->setting.flag |= iki_read_main_flag_literal_e;
     }
     else if (main->program.parameters.array[iki_read_parameter_object_e].result & f_console_result_found_e) {
-      const uint8_t ids[2] = {
+      static const uint8_t ids[2] = {
         iki_read_parameter_content_e,
         iki_read_parameter_total_e,
       };
index c6d7c03abb03df0fd0e772304dfe9e5e377de63d..cd0fc22c5d01786fc9e716a075bee7c60b0feef9 100644 (file)
@@ -49,7 +49,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -70,7 +70,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index c205e094ff02d26ca150e76dc6f09ec6c1cd94b0..e3fae1a8b9e894113a4aadef2c509d71c15de74b 100644 (file)
@@ -49,7 +49,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -70,7 +70,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
 
index 371d7997695274e3946970c46fa1c3775f85f047..f2aad016c529f1d2619d91030b3eb0c1e02479b9 100644 (file)
@@ -50,7 +50,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 3;
 
-        const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+        static const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
 
         main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
 
@@ -71,7 +71,7 @@ extern "C" {
         choices.array = choices_array;
         choices.used = 5;
 
-        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 };
+        static 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 };
 
         main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);