]> Kevux Git Server - fll/commitdiff
Progress: Continue program related work.
authorKevin Day <thekevinday@gmail.com>
Tue, 15 Nov 2022 03:10:10 +0000 (21:10 -0600)
committerKevin Day <thekevinday@gmail.com>
Tue, 15 Nov 2022 03:10:10 +0000 (21:10 -0600)
Lots of print related changes and improvements.

Primarily working on fss_payload_write changes.

80 files changed:
level_2/fll_program/c/program/print.c
level_2/fll_program/c/program/print.h
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/control/c/common.c
level_3/control/c/control.c
level_3/control/c/control.h
level_3/controller/c/common.c
level_3/controller/c/controller.c
level_3/controller/c/controller.h
level_3/fake/c/common.c
level_3/fake/c/fake.c
level_3/fake/c/fake.h
level_3/firewall/c/common.c
level_3/firewall/c/firewall.c
level_3/firewall/c/firewall.h
level_3/fss_basic_list_read/c/common.c
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_read/c/fss_basic_list_read.h
level_3/fss_basic_list_write/c/common.c
level_3/fss_basic_list_write/c/fss_basic_list_write.c
level_3/fss_basic_list_write/c/fss_basic_list_write.h
level_3/fss_basic_read/c/common.c
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/fss_basic_read.h
level_3/fss_basic_write/c/common.c
level_3/fss_basic_write/c/fss_basic_write.c
level_3/fss_basic_write/c/fss_basic_write.h
level_3/fss_embedded_list_read/c/common.c
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_write/c/common.c
level_3/fss_embedded_list_write/c/fss_embedded_list_write.c
level_3/fss_embedded_list_write/c/fss_embedded_list_write.h
level_3/fss_extended_list_read/c/common.c
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_write/c/common.c
level_3/fss_extended_list_write/c/fss_extended_list_write.c
level_3/fss_extended_list_write/c/fss_extended_list_write.h
level_3/fss_extended_read/c/common.c
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/fss_extended_read.h
level_3/fss_extended_write/c/common.c
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_extended_write/c/fss_extended_write.h
level_3/fss_identify/c/common.c
level_3/fss_identify/c/fss_identify.c
level_3/fss_identify/c/fss_identify.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/fss_payload_read.h
level_3/fss_payload_write/c/common.c
level_3/fss_payload_write/c/common.h
level_3/fss_payload_write/c/fss_payload_write.c
level_3/fss_payload_write/c/fss_payload_write.h
level_3/fss_payload_write/c/print.c
level_3/fss_payload_write/c/print.h
level_3/fss_payload_write/c/private-write.c
level_3/iki_read/c/common.c
level_3/iki_read/c/iki_read.c
level_3/iki_read/c/print.c
level_3/iki_read/c/print.h
level_3/iki_read/c/private-read.c
level_3/iki_write/c/common.c
level_3/iki_write/c/iki_write.c
level_3/iki_write/c/iki_write.h
level_3/iki_write/c/print.c
level_3/iki_write/c/print.h
level_3/iki_write/c/private-write.c
level_3/iki_write/c/private-write.h
level_3/status_code/c/common.c
level_3/status_code/c/print.c
level_3/status_code/c/print.h
level_3/utf8/c/common.c
level_3/utf8/c/print.c
level_3/utf8/c/print.h
level_3/utf8/c/utf8.c

index e429df0002862daa231f2d2cc4cd648e7f6a3989..c7e6075f5e7dac962eb36f01479bc115e9ab739b 100644 (file)
@@ -77,6 +77,44 @@ extern "C" {
   }
 #endif // _di_fll_program_print_error_parameter_cannot_use_with_
 
+#ifndef _di_fll_program_print_error_parameter_cannot_use_with_pipe_
+  f_status_t fll_program_print_error_parameter_cannot_use_with_pipe(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QCannot specify the '%]", print.to, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, parameter, print.set->notable);
+    fl_print_format("%[' when processing a pipe.%]%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_cannot_use_with_pipe_
+
+#ifndef _di_fll_program_print_error_parameter_cannot_use_with_xor_
+  f_status_t fll_program_print_error_parameter_cannot_use_with_xor(const fl_print_t print, const f_string_static_t symbol_first, const f_string_static_t symbol_second, const f_string_static_t symbol_third, const f_string_static_t first, const f_string_static_t second, const f_string_static_t third) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%r%[%QThe '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_first, first, print.set->notable);
+    fl_print_format("%[' parameter only allows either the '%]", print.to, print.set->error, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_second, second, print.set->notable);
+    fl_print_format("%[' parameter or the '%]", print.to, print.set->error, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_third, third, print.set->notable);
+    fl_print_format("%[' parameter, but not both.%]%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_cannot_use_with_xor_
+
 #ifndef _di_fll_program_print_error_parameter_integer_not_
   f_status_t fll_program_print_error_parameter_integer_not(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter, const f_string_static_t value) {
 
index 95d8478828cdf26a1e3bc9b5116333d60bce0cb8..77342351128373aad1e0244eb77e48bb06e770d3 100644 (file)
@@ -124,6 +124,76 @@ extern "C" {
 #endif // _di_fll_program_print_error_parameter_cannot_use_with_
 
 /**
+ * Print message about one parameter not being allowed to be used when processing a pipe.
+ *
+ * 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 the first parameter.
+ *   This is usually f_console_symbol_long_enable_s.
+ * @param parameter
+ *   The parameter name.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_parameter_cannot_use_with_pipe_
+  extern f_status_t fll_program_print_error_parameter_cannot_use_with_pipe(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter);
+#endif // _di_fll_program_print_error_parameter_cannot_use_with_pipe_
+
+/**
+ * Print message about two parameters not being allowed to be used together with another specified parameter.
+ *
+ * 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_first
+ *   The symbol string prepended to the first parameter.
+ *   This is usually f_console_symbol_long_enable_s.
+ * @param symbol_second
+ *   The symbol string prepended to the second parameter.
+ *   This is usually f_console_symbol_long_enable_s.
+ * @param symbol_third
+ *   The symbol string prepended to the third parameter.
+ *   This is usually f_console_symbol_long_enable_s.
+ * @param first
+ *   The first parameter name.
+ *
+ *   This represents the parameter that imposes the exclusive or relation on the second and third parameters.
+ * @param second
+ *   The second parameter name.
+ *
+ *   This represents the parameter that is an exclusive or with the third parameter.
+ * @param third
+ *   The second parameter name.
+ *
+ *   This represents the parameter that is an exclusive or with the second parameter.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_parameter_allows_either_xor_
+  extern f_status_t fll_program_print_error_parameter_cannot_use_with_xor(const fl_print_t print, const f_string_static_t symbol_first, const f_string_static_t symbol_second, const f_string_static_t symbol_third, const f_string_static_t first, const f_string_static_t second, const f_string_static_t third);
+#endif // _di_fll_program_print_error_parameter_allows_either_xor_
+
+/**
  * Print message about parameter not being a valid integer.
  *
  * This is only printed when verbosity is not set to quiet.
index 855b679c119459f1e2f61b7fbcf80fe1f321ed8e..70f7be34c4827ee57738708037701fdbe5b57661 100644 (file)
@@ -30,7 +30,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          byte_dump_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          byte_dump_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -47,7 +49,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          byte_dump_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          byte_dump_print_line_last_locked(setting, main->error);
 
           return;
         }
index cd798c7a01762e187ec382731a3143dff30e7a11..b117547754baa6a8aa33a17835494651163b9f45 100644 (file)
@@ -48,6 +48,7 @@
 
 // Byte Dump includes.
 #include <program/byte_dump/common.h>
+#include <program/byte_dump/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 34dc117f7903ed00c5caa6d904ebd5108f6cb6cf..9b991e22f05d7ac0999fbcf34ab9323977bb3799 100644 (file)
@@ -83,7 +83,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->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", F_true);
+      byte_dump_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -100,8 +107,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          byte_dump_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          byte_dump_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -132,8 +140,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          byte_dump_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          byte_dump_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -152,6 +161,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[byte_dump_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 6a57dda44de677b61a64b1775a00f95a9b14f085..8e2ad1e1a9386fbdb80984c41ad91077fb582fe2 100644 (file)
@@ -186,7 +186,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      control_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      control_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -203,8 +210,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          control_print_line_first(setting, main->error, F_true);
+          control_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          control_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -235,8 +243,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          control_print_line_first(setting, main->error, F_true);
+          control_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          control_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -255,6 +264,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[control_parameter_strip_invalid_e].result == f_console_result_found_e) {
index a1dec4f07f93a0ceba0243829bf5e0b90a59685b..f4ddb02528c1728a7cfc43b55a035d416260bc8e 100644 (file)
@@ -31,7 +31,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          control_print_line_first_locked(setting, main->error)
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          control_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -48,7 +50,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          control_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          control_print_line_last_locked(setting, main->error);
 
           return;
         }
index 980be6c9ca665acff200e6d12fe403dbffdc46cd..0c6407b086c946b6730d0c046358c303a4b4b59b 100644 (file)
@@ -52,6 +52,7 @@
 
 // Control includes.
 #include <program/control/common.h>
+#include <program/control/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 07b5523f9f60bfeec5c948a6df617447579e768d..4d5fbdf765a65aad32b2713c10d2a727d4cc7f8a 100644 (file)
@@ -618,7 +618,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      controller_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      controller_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -635,8 +642,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          controller_print_line_first(setting, main->error, F_true);
+          controller_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          controller_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -667,8 +675,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          controller_print_line_first(setting, main->error, F_true);
+          controller_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          controller_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -687,6 +696,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[controller_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 5f6f70fb5f5a8e94fb1e29f987c93ca2be9ba742..2e598b10419df6d5042b2099a64d7884307d791f 100644 (file)
@@ -36,7 +36,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          controller_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          controller_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -53,7 +55,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          controller_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          controller_print_line_last_locked(setting, main->error);
 
           return;
         }
index d3ae9b568434d3af3cb46d604910c96c48ac1885..25a6c4e24df75ce5fd6520446e2523ab5d427b47 100644 (file)
@@ -76,6 +76,7 @@
 
 // Controller includes.
 #include <program/controller/common.h>
+#include <program/controller/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index ecbf20d462f4141e496f80ac1784933a5d053a94..28de632fd1bd7810af76d9af9c0fb97f5049fa49 100644 (file)
@@ -131,7 +131,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      fake_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      fake_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -148,8 +155,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fake_print_line_first(setting, main->error, F_true);
+          fake_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          fake_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -180,8 +188,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fake_print_line_first(setting, main->error, F_true);
+          fake_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          fake_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -200,6 +209,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fake_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 7e48ba12621e7be7dbdba67f721c29cd39163a12..ddefbbdcfcb6533758ad58b80c8df0c439383819 100644 (file)
@@ -37,7 +37,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fake_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fake_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -54,7 +56,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fake_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fake_print_line_last_locked(setting, main->error);
 
           return;
         }
index 972d3268ad07a9ae07430f953d1ea7c4b347f7b1..254ce0a1305e38d0a63c56a6526ae9aa0764cbcf 100644 (file)
@@ -91,6 +91,7 @@
 
 // Featureless Make includes.
 #include <program/fake/common.h>
+#include <program/fake/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 759827b79d83a59942d74ec76c0d351aa3823e86..5e6058d39146b0cbcd346815f02800b72db14bb0 100644 (file)
@@ -119,7 +119,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      firewall_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      firewall_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -136,8 +143,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          firewall_print_line_first(setting, main->error, F_true);
+          firewall_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          firewall_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -168,8 +176,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          firewall_print_line_first(setting, main->error, F_true);
+          firewall_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          firewall_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -188,6 +197,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[firewall_parameter_strip_invalid_e].result == f_console_result_found_e) {
index d89c92e52aff59ce84471c91bd2f24562543f140..0e8489b70b0c083a05b05cd240582d307630c5f9 100644 (file)
@@ -38,7 +38,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          firewall_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          firewall_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -55,7 +57,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          firewall_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          firewall_print_line_last_locked(setting, main->error);
 
           return;
         }
index b05ec3ca28213fad19c98dd778cb9bf3d1138060..3fc3b5f18686d4e92466b3547bd1233effe393e2 100644 (file)
@@ -49,6 +49,7 @@
 
 // Firewall includes.
 #include <program/firewall/common.h>
+#include <program/firewall/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 2afe8bfa74798663852e3327bbc42c1946b85902..84863142938e92d32555cbac22fa5823d3db1162 100644 (file)
@@ -77,7 +77,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->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", F_true);
+      fss_basic_list_read_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -94,8 +101,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_basic_list_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_basic_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -126,8 +134,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_basic_list_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_basic_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -146,6 +155,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_basic_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
index e06f4952a2e33b8e8f1b072eeab53188f4084138..a73a06f73e33535b1cb645f9532274b432a45a12 100644 (file)
@@ -31,7 +31,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_basic_list_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_basic_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -48,7 +50,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_basic_list_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_basic_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
index d6bc982b7a6152831a1742e7ffe9da946462da3d..2433f82e30ee54d92753478a7c77d59f638f6ba2 100644 (file)
@@ -49,6 +49,7 @@
 
 // FSS Basic List Read includes.
 #include <program/fss_basic_list_read/common.h>
+#include <program/fss_basic_list_read/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index beb3a6f0eda9afc3d81410a78ff62e541916e2b3..e96ab732f02f06bf812cb8ae58885b6c460d3087 100644 (file)
@@ -58,7 +58,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      fss_basic_list_write_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      fss_basic_list_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -75,8 +82,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_basic_list_write_print_line_first(setting, main->error, F_true);
+          fss_basic_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          fss_basic_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -107,8 +115,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_basic_list_write_print_line_first(setting, main->error, F_true);
+          fss_basic_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          fss_basic_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -127,6 +136,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_basic_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
index cb43de2a1621871e309d8558dad455ef91c332d4..ef8e535fae06b4c2a131546921a01fcbb55604d5 100644 (file)
@@ -30,7 +30,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_basic_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_basic_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -47,7 +49,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_basic_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_basic_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
index 251c71942cb1e58622552e7ef9973f7e36e2fd0f..1c6a804c0521a2d71554f5dcc68eac77c203718b 100644 (file)
@@ -41,6 +41,7 @@
 
 // FSS Basic List Write includes.
 #include <program/fss_basic_list_write/common.h>
+#include <program/fss_basic_list_write/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index c275f869aa904e02283a63d3c23ceacb4fbf1a05..ba9d8e499654d7830208d7dd12be39156bb2b51d 100644 (file)
@@ -76,7 +76,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->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", F_true);
+      fss_basic_read_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -93,8 +100,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_basic_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_basic_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -125,8 +133,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_basic_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_basic_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -145,6 +154,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_basic_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 3978cda7c8abd98c31f2763a39d45350702a9c9b..b114faa52898ea88087a35fac4aace540a5410f1 100644 (file)
@@ -31,7 +31,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_basic_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_basic_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -48,7 +50,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_basic_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_basic_read_print_line_last_locked(setting, main->error);
 
           return;
         }
index acc481f0958a60d7b8dc5b86a8f6d8d57e1e770e..eb30e3ece852780604a2689429afc9c4ce8404db 100644 (file)
@@ -49,6 +49,7 @@
 
 // FSS Basic Read includes.
 #include <program/fss_basic_read/common.h>
+#include <program/fss_basic_read/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 2a5fef93fe31e639fb5405c5b11fa01289a36ca3..5a0d36bc76f7a8cb322e8cffa3385e45f7e4c0c5 100644 (file)
@@ -58,7 +58,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      fss_basic_write_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      fss_basic_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -75,8 +82,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_basic_write_print_line_first(setting, main->error, F_true);
+          fss_basic_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          fss_basic_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -107,8 +115,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_basic_write_print_line_first(setting, main->error, F_true);
+          fss_basic_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          fss_basic_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -127,6 +136,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_basic_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 44397a1e10e67fce5d867d811d9726c979969c95..8ba09d5d91a1c18c76ca13c819834e0bdb758b78 100644 (file)
@@ -30,7 +30,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_basic_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_basic_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -47,7 +49,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_basic_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_basic_write_print_line_last_locked(setting, main->error);
 
           return;
         }
index f9b32946ae491c6ceb0de6d3bfaa32614a941475..c39d88a8a4b8be6f9ed3cfd4755e4923c2caa78a 100644 (file)
@@ -42,6 +42,7 @@
 
 // FSS Basic Write includes.
 #include <program/fss_basic_write/common.h>
+#include <program/fss_basic_write/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index f7353dac910fd1a6c235dbe287d4ab4a438c9a6f..9f07442b9120d336b51770618ca5b4bcd5b1a781 100644 (file)
@@ -75,7 +75,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->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", F_true);
+      fss_embedded_list_read_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -92,8 +99,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_embedded_list_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_embedded_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -124,8 +132,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_embedded_list_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_embedded_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -144,6 +153,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_embedded_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
index b170ba08af959990fa2c12d9b95d76a13643f772..4eb69bc464cce048e8bc973527d9932bd9b63da8 100644 (file)
@@ -31,7 +31,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_embedded_list_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_embedded_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -48,7 +50,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_embedded_list_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_embedded_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
index 01450670fe2c8f2be3320f2720a16e129c745886..d203715c2a9e6c45f7bf39a193fb262898a8db14 100644 (file)
@@ -49,6 +49,7 @@
 
 // FSS Embedded List Read includes.
 #include <program/fss_embedded_list_read/common.h>
+#include <program/fss_embedded_list_read/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 11bfc9ecc179257a32eee7b1f00329bd868899ef..d79cb192277ee52894e19aff3c55c1f6b4dddb0a 100644 (file)
@@ -58,7 +58,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      fss_embedded_list_write_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      fss_embedded_list_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -75,8 +82,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_embedded_list_write_print_line_first(setting, main->error, F_true);
+          fss_embedded_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          fss_embedded_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -107,8 +115,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_embedded_list_write_print_line_first(setting, main->error, F_true);
+          fss_embedded_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          fss_embedded_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -127,6 +136,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_embedded_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 83a188b07f423029aaba5b8455d2784b8f3be5c3..e33b6be1791d13abcfb75cf86bad3248c1ef2c75 100644 (file)
@@ -30,7 +30,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_embedded_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_embedded_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -47,7 +49,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_embedded_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_embedded_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
index 4347d39cab1b2a6bb9d1e9fbabb02309eb6a8585..8f10b928d7d25f94f62eddd67464e2825b042d10 100644 (file)
@@ -42,6 +42,7 @@
 
 // FSS Embedded List Write includes.
 #include <program/fss_embedded_list_write/common.h>
+#include <program/fss_embedded_list_write/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 727047c7aab558a069f49de37ef5927b09ebfe5e..bfd366f83e315f310bcf76f2ca9a5a05d269b830 100644 (file)
@@ -83,7 +83,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->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", F_true);
+      fss_extended_list_read_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -100,8 +107,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_extended_list_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_extended_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -132,8 +140,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_extended_list_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_extended_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -152,6 +161,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_extended_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 5d4dddcc4a9521243cee266816c4c56140dabde1..0798799c6772c8fdc183ca3ae5c49fc8ff945420 100644 (file)
@@ -31,7 +31,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_extended_list_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_extended_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -48,7 +50,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_extended_list_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_extended_list_read_print_line_last_locked(setting, main->error);
 
           return;
         }
index b2b6cc5fdbb55bdf4490e7830ff3cc3af5a6c0e0..e77afb930dd30d52c8aaa2f8ff65f45640121ccd 100644 (file)
@@ -49,6 +49,7 @@
 
 // FSS Extended List Read includes.
 #include <program/fss_extended_list_read/common.h>
+#include <program/fss_extended_list_read/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 6043faf0fe17fa39ca40c7d2dec3fbb0daa6acc9..74f14e507b8c8b024d2a4adec450dd4d0da3a7e9 100644 (file)
@@ -65,7 +65,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      fss_extended_list_write_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      fss_extended_list_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -82,8 +89,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_extended_list_write_print_line_first(setting, main->error, F_true);
+          fss_extended_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          fss_extended_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -114,8 +122,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_extended_list_write_print_line_first(setting, main->error, F_true);
+          fss_extended_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          fss_extended_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -134,6 +143,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_extended_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 2024196a86f9d30ef2bb880fd51d17382f9274a4..1705cc20b8a295763e3d9efe0fcd5e69d9224c29 100644 (file)
@@ -30,7 +30,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_extended_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_extended_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -47,7 +49,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_extended_list_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_extended_list_write_print_line_last_locked(setting, main->error);
 
           return;
         }
index 64f3df75f2db19e588647d8394cef818226c53e5..6dea20d0e5aebc70b481705ed3f0659acda4da16 100644 (file)
@@ -42,6 +42,7 @@
 
 // FSS Extended List Write includes.
 #include <program/fss_extended_list_write/common.h>
+#include <program/fss_extended_list_write/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 518f301adb5af15adb8edf764d73c8dc859365c3..e27274481756b280a5a3612ef6865c835f3632e7 100644 (file)
@@ -76,7 +76,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->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", F_true);
+      fss_extended_read_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -93,8 +100,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_extended_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_extended_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -125,8 +133,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_extended_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_extended_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -145,6 +154,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_extended_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 24d76c049d3570e83d0227bd1b0586e672cf6f65..ee116491577fa36ab0913e874e601e48f578470a 100644 (file)
@@ -31,7 +31,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_extended_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_extended_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -48,7 +50,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_extended_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_extended_read_print_line_last_locked(setting, main->error);
 
           return;
         }
index 9d28801cca9053fd093e70cbe86d61274ec58b26..be4fe40b20cffc3de97ea052a326977e4af6dd51 100644 (file)
@@ -49,6 +49,7 @@
 
 // FSS Extended Read includes.
 #include <program/fss_extended_read/common.h>
+#include <program/fss_extended_read/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index c8dbc479b75bd5fe8250987c317c392caf789912..0d1084cb9650f0d133448bd7ed788d2ada3489c7 100644 (file)
@@ -58,7 +58,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      fss_extended_write_print_line_first_locked(setting, main->error);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      fss_extended_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -75,8 +82,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_extended_write_print_line_first(setting, main->error, F_true);
+          fss_extended_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          fss_extended_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -107,8 +115,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_extended_write_print_line_first(setting, main->error, F_true);
+          fss_extended_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          fss_extended_write_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -127,6 +136,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_extended_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 23c3e27b95ec0674e9c9e8cbbba180e45711f35b..fa47b62452d5c5d3677ffad96ab9aa25b5258799 100644 (file)
@@ -47,7 +47,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_extended_write_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_extended_write_print_line_last_locked(setting, main->error);
 
           return;
         }
index e1da061a5d10dd19dd40e172a393880a0e091966..8f1ea51fba95dc71dd544a19efb4b7d818893be4 100644 (file)
@@ -42,6 +42,7 @@
 
 // FSS Extended Write includes.
 #include <program/fss_extended_write/common.h>
+#include <program/fss_extended_write/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 06971ea03769680878a9c2c38d0a794ce02382f3..91485b90f7abc982349d18807de3666a4e66d0cc 100644 (file)
@@ -43,7 +43,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->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", F_true);
+      fss_identify_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -60,8 +67,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_identify_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_identify_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -92,8 +100,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_identify_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_identify_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -112,6 +121,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_identify_parameter_strip_invalid_e].result == f_console_result_found_e) {
index faa490cf2d49a91742283bddaf902e8c6506ec1e..fe85174909d27e7b50332055c46dc03f05447779 100644 (file)
@@ -30,7 +30,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_identify_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_identify_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -47,7 +49,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_identify_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_identify_print_line_last_locked(setting, main->error);
 
           return;
         }
index a7750e6e79f11ef3a272ad750780b8a5305f3942..a30d43c06c73d6193edbecf9f0d4f980039e9f6b 100644 (file)
@@ -47,6 +47,7 @@
 
 // FSS Identify includes.
 #include <program/fss_identify/common.h>
+#include <program/fss_identify/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 2b51e5cc262b04085cfa9f9a29c32707907de5ba..9657bd1e14f1294daa8c42e85c1fa516e25ec797 100644 (file)
@@ -4,6 +4,15 @@
 extern "C" {
 #endif
 
+#ifndef _di_fss_payload_read_program_version_
+  const f_string_static_t fss_payload_read_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_version_s, 0, FSS_PAYLOAD_READ_program_version_s_length);
+#endif // _di_fss_payload_read_program_version_
+
+#ifndef _di_fss_payload_read_program_name_
+  const f_string_static_t fss_payload_read_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_s, 0, FSS_PAYLOAD_READ_program_name_s_length);
+  const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length);
+#endif // _di_fss_payload_read_program_name_
+
 #ifndef _di_fss_payload_read_defines_
   const f_string_static_t fss_payload_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_name_s, 0, FSS_PAYLOAD_READ_pipe_name_s_length);
 
@@ -68,7 +77,14 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->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", F_true);
+      fss_payload_read_print_line_last_locked(setting, main->error);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -85,8 +101,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_payload_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_payload_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -117,8 +134,9 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_payload_read_print_line_first(setting, main->error, F_true);
+          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", F_true);
+          fss_payload_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -137,6 +155,10 @@ extern "C" {
       }
     }
 
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_payload_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
index 9076ed66b542559ea093fe5311d27ed2ac597549..d5465e01a629afb4cf8061bdc470ed6c2baf3fce 100644 (file)
@@ -291,27 +291,39 @@ extern "C" {
  * Flags used to represent flags passed to the main function.
  *
  * fss_payload_read_main_flag_*_e:
- *   - none:          No modes in use.
- *   - file_from:     Using a specified source file.
- *   - file_to:       Using a specified destination file.
- *   - help:          Print help.
- *   - header:        Enable printing of headers.
- *   - separate:      Enable printing of separators.
- *   - strip_invalid: Using strip invalid character mode.
- *   - verify:        Using verify mode.
- *   - version:       Print version.
+ *   - none:       No modes in use.
+ *   - at:         Selecting at a specific index.
+ *   - content:    Print Contents.
+ *   - help:       Print help.
+ *   - literal:    Print as literal data (printing entire variable).
+ *   - line:       Selecting at a specific line.
+ *   - name:       Selecting using a specific Vocabulary name.
+ *   - object:     Print Objects.
+ *   - replace:    Using re-assignments.
+ *   - replace:    Using replacements.
+ *   - substitute: Using substitutions.
+ *   - total:      Enable printing of "total" count.
+ *   - version:    Print version.
+ *   - whole:      Print all data.
+ *   - wrap:       Using wrapping.
  */
 #ifndef _di_fss_payload_read_main_flag_e_
   enum {
-    fss_payload_read_main_flag_none_e          = 0x0,
-    fss_payload_read_main_flag_file_from_e     = 0x1,
-    fss_payload_read_main_flag_file_to_e       = 0x2,
-    fss_payload_read_main_flag_header_e        = 0x4,
-    fss_payload_read_main_flag_help_e          = 0x8,
-    fss_payload_read_main_flag_separate_e      = 0x10,
-    fss_payload_read_main_flag_strip_invalid_e = 0x20,
-    fss_payload_read_main_flag_verify_e        = 0x40,
-    fss_payload_read_main_flag_version_e       = 0x80,
+    fss_payload_read_main_flag_none_e       = 0x0,
+    fss_payload_read_main_flag_at_e         = 0x1,
+    fss_payload_read_main_flag_content_e    = 0x2,
+    fss_payload_read_main_flag_help_e       = 0x4,
+    fss_payload_read_main_flag_literal_e    = 0x8,
+    fss_payload_read_main_flag_line_e       = 0x10,
+    fss_payload_read_main_flag_name_e       = 0x20,
+    fss_payload_read_main_flag_object_e     = 0x40,
+    fss_payload_read_main_flag_reassign_e   = 0x80,
+    fss_payload_read_main_flag_replace_e    = 0x100,
+    fss_payload_read_main_flag_substitute_e = 0x200,
+    fss_payload_read_main_flag_total_e      = 0x400,
+    fss_payload_read_main_flag_version_e    = 0x800,
+    fss_payload_read_main_flag_whole_e      = 0x1000,
+    fss_payload_read_main_flag_wrap_e       = 0x2000,
   };
 #endif // _di_fss_payload_read_main_flag_e_
 
index ff74d55fa5a4e36f56ff70b4331fe7c7e2a16f26..40523efb1f0e24097a8b855f86ddfd1186fbbe70 100644 (file)
@@ -7,15 +7,6 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_payload_read_program_version_
-  const f_string_static_t fss_payload_read_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_version_s, 0, FSS_PAYLOAD_READ_program_version_s_length);
-#endif // _di_fss_payload_read_program_version_
-
-#ifndef _di_fss_payload_read_program_name_
-  const f_string_static_t fss_payload_read_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_s, 0, FSS_PAYLOAD_READ_program_name_s_length);
-  const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length);
-#endif // _di_fss_payload_read_program_name_
-
 #ifndef _di_fss_payload_read_main_
   f_status_t fss_payload_read_main(fll_program_data_t * const main, fss_payload_read_setting_t * const setting) {
 
@@ -40,7 +31,9 @@ extern "C" {
         status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_payload_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+          fss_payload_read_print_line_last_locked(setting, main->error);
 
           return;
         }
@@ -57,7 +50,9 @@ extern "C" {
         status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(status)) {
+          fss_payload_read_print_line_first_locked(setting, main->error);
           fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+          fss_payload_read_print_line_last_locked(setting, main->error);
 
           return;
         }
index 237c49c1a378aefb7622ead5c720c0cce151c953..914df7404abb1cd8ebaa0282dd15e2724d1ca2cd 100644 (file)
@@ -50,6 +50,7 @@
 
 // FSS Payload Read includes.
 #include <program/fss_payload_read/common.h>
+#include <program/fss_payload_read/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 6af79f4d0ae035a71811817fd2baf6f3fd85defd..5c53e90d9a384c8954ce4753c547eb8a719ef6ce 100644 (file)
@@ -4,6 +4,15 @@
 extern "C" {
 #endif
 
+#ifndef _di_fss_payload_write_program_version_
+  const f_string_static_t fss_payload_write_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_version_s, 0, FSS_PAYLOAD_WRITE_program_version_s_length);
+#endif // _di_fss_payload_write_program_version_
+
+#ifndef _di_fss_payload_write_program_name_
+  const f_string_static_t fss_payload_write_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_s, 0, FSS_PAYLOAD_WRITE_program_name_s_length);
+  const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length);
+#endif // _di_fss_payload_write_program_name_
+
 #ifndef _di_fss_payload_write_defines_
   const f_string_static_t fss_payload_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_end_s, 0, FSS_PAYLOAD_WRITE_pipe_content_end_s_length);
   const f_string_static_t fss_payload_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_ignore_s, 0, FSS_PAYLOAD_WRITE_pipe_content_ignore_s_length);
@@ -37,6 +46,15 @@ extern "C" {
 
     if (!setting) return F_status_set_error(F_parameter);
 
+    f_string_dynamic_resize(0, &setting->escaped);
+    f_string_dynamic_resize(0, &setting->buffer);
+    f_string_dynamic_resize(0, &setting->object);
+    f_string_dynamic_resize(0, &setting->content);
+    f_string_dynamic_resize(0, &setting->prepend);
+
+    f_string_dynamics_resize(0, &setting->objects);
+    f_string_dynamics_resize(0, &setting->contents);
+
     return F_none;
   }
 #endif // _di_fss_payload_write_setting_delete_
@@ -48,7 +66,12 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      fss_payload_write_print_error(setting, main->error, "f_console_parameter_process");
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -65,8 +88,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_payload_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+          fss_payload_write_print_error(setting, main->error, "fll_program_parameter_process_context");
 
           return;
         }
@@ -97,8 +119,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          fss_payload_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+          fss_payload_write_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
 
           return;
         }
@@ -117,10 +138,271 @@ extern "C" {
       }
     }
 
-    f_string_static_t * const args = main->parameters.arguments.array;
+    main->output.to.id = F_type_descriptor_output_d;
+    main->output.to.stream = F_type_output_d;
+    main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+
+    if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_additional_e && main->parameters.array[fss_payload_write_parameter_file_e].values.used) {
+      if (main->parameters.array[fss_payload_write_parameter_file_e].values.used > 1) {
+        setting->status = F_status_set_error(F_parameter);
+
+        fss_payload_write_print_line_first_locked(setting, main->error);
+        fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
+        fss_payload_write_print_line_last_locked(setting, main->error);
+
+        return;
+      }
+
+      const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_file_e].values.array[0];
+
+      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);
+
+      if (F_status_is_error(setting->status)) {
+        fss_payload_write_print_error_file(setting, main->error, "f_file_stream_open", main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
+
+        return;
+      }
+
+      setting->flag |= fss_payload_write_main_flag_file_to_e;
+    }
+    else if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_found_e) {
+      setting->status = F_status_set_error(F_parameter);
+
+      fss_payload_write_print_line_first_locked(setting, main->error);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
+      fss_payload_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
+
+    if (main->parameters.array[fss_payload_write_parameter_object_e].result == f_console_result_additional_e && main->parameters.array[fss_payload_write_parameter_object_e].values.used) {
+      f_array_lengths_t * const values = &main->parameters.array[fss_payload_write_parameter_object_e].values;
+
+      setting->objects.used = 0;
+
+      setting->status = f_string_dynamics_resize(values->used, &setting->objects);
+
+      if (F_status_is_error(setting->status)) {
+        fss_payload_write_print_error(setting, main->error, "f_string_dynamics_resize");
+
+        return;
+      }
+
+      // Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0).
+      for (f_array_length_t index = 0; setting->objects.used < values->used; ) {
+
+        index = values->array[setting->objects.used];
+
+        setting->objects.array[setting->objects.used].string = main->parameters.arguments.array[index].string;
+        setting->objects.array[setting->objects.used].used = main->parameters.arguments.array[index].used;
+        setting->objects.array[setting->objects.used++].size = 0;
+      } // for
+
+      setting->flag |= fss_payload_write_main_flag_object_e;
+    }
+    else if (main->parameters.array[fss_payload_write_parameter_object_e].result == f_console_result_found_e) {
+      setting->status = F_status_set_error(F_parameter);
+
+      fss_payload_write_print_line_first_locked(setting, main->error);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_object_s);
+      fss_payload_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
+
+    if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e && main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
+      f_array_lengths_t * const values = &main->parameters.array[fss_payload_write_parameter_content_e].values;
+
+      setting->contents.used = 0;
+
+      setting->status = f_string_dynamics_resize(values->used, &setting->contents);
+
+      if (F_status_is_error(setting->status)) {
+        fss_payload_write_print_error(setting, main->error, "f_string_dynamics_resize");
+
+        return;
+      }
+
+      // Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0).
+      for (f_array_length_t index = 0; setting->contents.used < values->used; ) {
+
+        index = values->array[setting->contents.used];
+
+        setting->contents.array[setting->contents.used].string = main->parameters.arguments.array[index].string;
+        setting->contents.array[setting->contents.used].used = main->parameters.arguments.array[index].used;
+        setting->contents.array[setting->contents.used++].size = 0;
+      } // for
+
+      setting->flag |= fss_payload_write_main_flag_content_e;
+    }
+    else if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_found_e) {
+      setting->status = F_status_set_error(F_parameter);
+
+      fss_payload_write_print_line_first_locked(setting, main->error);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
+      fss_payload_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
+
+    if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e && main->parameters.array[fss_payload_write_parameter_prepend_e].values.used) {
+      const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
+
+      setting->prepend.used = 0;
+
+      setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->prepend);
+
+      if (F_status_is_error(setting->status)) {
+        fss_payload_write_print_error(setting, main->error, "f_string_dynamic_append_nulless");
+
+        return;
+      }
+
+      if (main->parameters.arguments.array[index].used) {
+        f_string_range_t range = macro_f_string_range_t_initialize2(main->parameters.arguments.array[index].used);
+        f_state_t state = f_state_t_initialize;
+
+        for (; range.start < main->parameters.arguments.array[index].used; range.start++) {
+
+          setting->status = f_fss_is_space(state, main->parameters.arguments.array[index], range);
+
+          if (F_status_is_error(setting->status)) {
+            fss_payload_write_print_error(setting, main->error, "f_fss_is_space");
+
+            return;
+          }
+
+          if (status == F_false) {
+            setting->status = F_status_set_error(F_parameter);
+
+            fss_payload_write_print_error_prepend_only_whitespace(setting, main->error);
+
+            return;
+          }
+        } // for
+      }
+
+      setting->flag |= fss_payload_write_main_flag_prepend_e;
+    }
+    else if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_found_e) {
+      setting->status = F_status_set_error(F_parameter);
+
+      fss_payload_write_print_line_first_locked(setting, main->error);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s);
+      fss_payload_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
+
+    if (main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_found_e) {
+      setting->flag |= fss_payload_write_main_flag_partial_e;
+    }
+
+    if (setting->flag & (fss_payload_write_main_flag_object_e | fss_payload_write_main_flag_content_e)) {
+      if (setting->flag & fss_payload_write_main_flag_object_e) {
+        if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_object_e].values.used) {
+          setting->status = F_status_set_error(F_parameter);
+
+          fss_payload_write_print_line_first_locked(setting, main->error);
+          fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_object_s);
+          fss_payload_write_print_line_last_locked(setting, main->error);
+
+          return;
+        }
+
+        if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
+          setting->status = F_status_set_error(F_parameter);
+
+          fss_payload_write_print_line_first_locked(setting, main->error);
+          fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
+          fss_payload_write_print_line_last_locked(setting, main->error);
+
+          return;
+        }
+
+        if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].locations.used && !(setting->flag & fss_payload_write_main_flag_partial_e)) {
+          setting->status = F_status_set_error(F_parameter);
+
+          fss_payload_write_print_line_first_locked(setting, main->error);
+          fss_payload_write_error_parameter_same_times_print(main);
+          fss_payload_write_print_line_last_locked(setting, main->error);
 
-    if (main->parameters.array[fss_payload_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
-      setting->flag |= fss_payload_write_main_flag_strip_invalid_e;
+          return;
+        }
+
+        if ((setting->flag & fss_payload_write_main_flag_content_e) && (setting->flag & fss_payload_write_main_flag_partial_e)) {
+          if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) {
+            setting->status = F_status_set_error(F_parameter);
+
+            fss_payload_write_print_line_first_locked(setting, main->error);
+            fll_program_print_error_parameter_cannot_use_with_xor(main->error, f_console_symbol_long_enable_s, f_console_symbol_long_enable_s, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, fss_payload_write_long_object_s, fss_payload_write_long_content_s);
+            fss_payload_write_print_line_last_locked(setting, main->error);
+
+            return;
+          }
+        }
+
+        if (setting->flag & fss_payload_write_main_flag_content_e) {
+          f_array_length_t location_object = 0;
+          f_array_length_t location_content = 0;
+          f_array_length_t location_sub_object = 0;
+          f_array_length_t location_sub_content = 0;
+
+          for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].locations.used; ++i) {
+
+            location_object = main->parameters.array[fss_payload_write_parameter_object_e].locations.array[i];
+            location_content = main->parameters.array[fss_payload_write_parameter_content_e].locations.array[i];
+            location_sub_object = main->parameters.array[fss_payload_write_parameter_object_e].locations_sub.array[i];
+            location_sub_content = main->parameters.array[fss_payload_write_parameter_content_e].locations_sub.array[i];
+
+            if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) {
+              setting->status = F_status_set_error(F_parameter);
+
+              fss_payload_write_print_line_first_locked(setting, main->error);
+              fss_payload_write_print_error_object_not_before_content(setting, main->error);
+              fss_payload_write_print_line_last_locked(setting, main->error);
+
+              break;
+            }
+          } // for
+        }
+      }
+    }
+
+    setting->quote = f_iki_syntax_quote_double_s;
+
+    if (main->parameters.array[fss_payload_write_parameter_double_e].result == f_console_result_found_e) {
+      if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) {
+        if (main->parameters.array[fss_payload_write_parameter_double_e].location < main->parameters.array[fss_payload_write_parameter_single_e].location) {
+          setting->quote = f_iki_syntax_quote_single_s;
+        }
+      }
+    }
+    else if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) {
+      setting->quote = f_iki_syntax_quote_single_s;
+    }
+
+    if (main->parameters.array[fss_payload_write_parameter_trim_e].result == f_console_result_found_e) {
+      setting->flag |= fss_payload_write_main_flag_trim_e;
+    }
+
+    if (main->pipe & fll_program_data_pipe_input_e) {
+      // @fixme why is this not allowed?
+      if (setting->flag & fss_payload_write_main_flag_partial_e) {
+        setting->status = F_status_set_error(F_parameter);
+
+        fss_payload_write_print_line_first_locked(setting, main->error);
+        fll_program_print_error_parameter_cannot_use_with_pipe(setting, main->error);
+        fss_payload_write_print_line_last_locked(setting, main->error);
+
+        return;
+      }
+    }
+    else if (!(setting->flag & (fss_payload_write_main_flag_content_e | fss_payload_write_parameter_object_e))) {
+      setting->status = F_data_not;
     }
   }
 #endif // _di_fss_payload_write_setting_load_
index 0377ec966b0d9866c5ddaeb8b6e97ef2a9ccd0d4..a22a4a051ea195ebf24cd199ac433221116adf01 100644 (file)
@@ -200,27 +200,33 @@ extern "C" {
  * Flags used to represent flags passed to the main function.
  *
  * fss_payload_write_main_flag_*_e:
- *   - none:          No modes in use.
- *   - file_from:     Using a specified source file.
- *   - file_to:       Using a specified destination file.
- *   - help:          Print help.
- *   - header:        Enable printing of headers.
- *   - separate:      Enable printing of separators.
- *   - strip_invalid: Using strip invalid character mode.
- *   - verify:        Using verify mode.
- *   - version:       Print version.
+ *   - none:    No modes in use.
+ *   - content: The Content being written is specified.
+ *   - double:  Operate using double quotes.
+ *   - file_to: Using a specified destination file.
+ *   - help:    Print help.
+ *   - ignore:  Ignore a given range within a Content.
+ *   - object:  The Object being written is specified.
+ *   - partial: Do not write end of Object/Content character.
+ *   - prepend: Prepend the given white space characters to the start of each multi-line Content.
+ *   - single:  Operate using single quotes.
+ *   - trim:    Trim Object names.
+ *   - version: Print version.
  */
 #ifndef _di_fss_payload_write_main_flag_e_
   enum {
-    fss_payload_write_main_flag_none_e          = 0x0,
-    fss_payload_write_main_flag_file_from_e     = 0x1,
-    fss_payload_write_main_flag_file_to_e       = 0x2,
-    fss_payload_write_main_flag_header_e        = 0x4,
-    fss_payload_write_main_flag_help_e          = 0x8,
-    fss_payload_write_main_flag_separate_e      = 0x10,
-    fss_payload_write_main_flag_strip_invalid_e = 0x20,
-    fss_payload_write_main_flag_verify_e        = 0x40,
-    fss_payload_write_main_flag_version_e       = 0x80,
+    fss_payload_write_main_flag_none_e    = 0x0,
+    fss_payload_write_main_flag_content_e = 0x1,
+    fss_payload_write_main_flag_double_e  = 0x2,
+    fss_payload_write_main_flag_file_to_e = 0x4,
+    fss_payload_write_main_flag_help_e    = 0x8,
+    fss_payload_write_main_flag_ignore_e  = 0x10,
+    fss_payload_write_main_flag_object_e  = 0x20,
+    fss_payload_write_main_flag_partial_e = 0x40,
+    fss_payload_write_main_flag_prepend_e = 0x80,
+    fss_payload_write_main_flag_single_e  = 0x100,
+    fss_payload_write_main_flag_trim_e    = 0x200,
+    fss_payload_write_main_flag_version_e = 0x400,
   };
 #endif // _di_fss_payload_write_main_flag_e_
 
@@ -236,6 +242,17 @@ extern "C" {
  *
  * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
  * line_last:  A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
+ *
+ * quote: This holds the quote used during processing.
+ *
+ * escaped: A buffer used for escaping strings during processing.
+ * buffer:  A buffer used during processing the file.
+ * object:  A buffer used to hold an Object during processing.
+ * content: A buffer used to hold a Content during processing.
+ * prepend: A string to prepend to each multi-line Content.
+ *
+ * objects:  An array of objects passed as values to the "--object" parameter.
+ * contents: An array of objects passed as values to the "--content" parameter and must match the length of objects.
  */
 #ifndef _di_fss_payload_write_setting_t_
   typedef struct {
@@ -245,6 +262,17 @@ extern "C" {
 
     f_string_static_t line_first;
     f_string_static_t line_last;
+
+    f_string_static_t quote;
+
+    f_string_dynamic_t escaped;
+    f_string_dynamic_t buffer;
+    f_string_dynamic_t object;
+    f_string_dynamic_t content;
+    f_string_dynamic_t prepend;
+
+    f_string_dynamics_t objects;
+    f_string_dynamics_t contents;
   } fss_payload_write_setting_t;
 
   #define fss_payload_write_setting_t_initialize \
@@ -253,6 +281,13 @@ extern "C" {
       F_none, \
       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_dynamic_t_initialize, \
+      f_string_dynamics_t_initialize, \
+      f_string_dynamics_t_initialize, \
     }
 #endif // _di_fss_payload_write_setting_t_
 
@@ -289,12 +324,19 @@ extern "C" {
  *
  *   This alters setting.status:
  *     F_none on success.
+ *     F_data_not on success but nothing was provided to operate with.
  *
  *     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().
  *
  * @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_fss_payload_write_setting_load_
   extern void fss_payload_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_payload_write_setting_t * const setting);
index caf37b90ac54f4d5394786d08dc860ba9b2b21b3..0e5c0f7ed2d3c9beda59f75b3e0b1807e46cc1a6 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_fss_payload_write_program_version_
-  const f_string_static_t fss_payload_write_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_version_s, 0, FSS_PAYLOAD_WRITE_program_version_s_length);
-#endif // _di_fss_payload_write_program_version_
+#ifndef _di_fss_payload_write_main_
+  void fss_payload_write_main(fll_program_data_t * const main, fss_payload_write_setting_t * const setting) {
 
-#ifndef _di_fss_payload_write_program_name_
-  const f_string_static_t fss_payload_write_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_s, 0, FSS_PAYLOAD_WRITE_program_name_s_length);
-  const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length);
-#endif // _di_fss_payload_write_program_name_
+    if (!main || !setting || F_status_is_error(setting->status)) return;
 
-#ifndef _di_fss_payload_write_main_
-  f_status_t fss_payload_write_main(fll_program_data_t * const main, fss_payload_write_setting_t * const setting) {
+    setting->status = F_none;
 
-    f_status_t status = F_none;
+    if (setting->flag & fss_payload_write_main_flag_help_e) {
+      fss_payload_write_print_help(setting, main->message);
 
-    // Load parameters.
-    setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+      return;
+    }
 
-    {
-      f_array_length_t choice = 0;
-      f_uint16s_t choices = f_uint16s_t_initialize;
+    if (setting->flag & fss_payload_write_main_flag_version_e) {
+      fll_program_print_version(main->message, fss_payload_write_program_version_s);
 
-      // Identify and prioritize "color context" parameters.
-      {
-        uint16_t choices_array[3] = { fss_payload_write_parameter_no_color_e, fss_payload_write_parameter_light_e, fss_payload_write_parameter_dark_e };
-        choices.array = choices_array;
-        choices.used = 3;
+      return;
+    }
 
-        const uint8_t modes[3] = { f_color_mode_color_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+    setting->escaped.used = 0;
 
-        status = fll_program_parameter_process_context(choices, modes, F_true, main);
+    if (main->pipe & fll_program_data_pipe_input_e) {
+      bool object_ended = F_false;
 
-        if (F_status_is_error(status)) {
-          fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+      f_array_length_t previous = 0;
+      f_string_range_t range = f_string_range_t_initialize;
+      f_status_t status = F_none;
+      f_file_t pipe = f_file_t_initialize;
 
-          return;
-        }
-      }
+      pipe.id = F_type_descriptor_input_d;
+      pipe.size_read = 1;
 
-      // Identify and prioritize "verbosity" parameters.
-      {
-        uint16_t choices_array[5] = { fss_payload_write_parameter_verbosity_quiet_e, fss_payload_write_parameter_verbosity_error_e, fss_payload_write_parameter_verbosity_verbose_e, fss_payload_write_parameter_verbosity_debug_e, fss_payload_write_parameter_verbosity_normal_e };
-        choices.array = choices_array;
-        choices.used = 5;
+      setting->buffer.used = 0;
+      setting->object.used = 0;
+      setting->content.used = 0;
 
-        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 };
+      range.start = 0;
 
-        status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+      do {
+        if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+          if (fll_program_standard_signal_received(main)) {
+            setting->status = F_status_set_error(F_interrupt);
 
-        if (F_status_is_error(status)) {
-          fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+            return;
+          }
 
-          return;
+          main->signal_check = 0;
         }
-      }
-    }
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
+        if (status != F_none_eof) {
+          status = f_file_read(pipe, &setting->buffer);
 
-    status = F_none;
+          if (F_status_is_error(status)) {
+            setting->status = F_status_set_error(F_pipe);
 
-    if (main->parameters.array[fss_payload_write_parameter_help_e].result == f_console_result_found_e) {
-      fss_payload_write_print_help(setting, main->message);
+            fss_payload_write_print_error_file(setting, main->error, "f_file_read", f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
 
-      return status;
-    }
+            return;
+          }
 
-    if (main->parameters.array[fss_payload_write_parameter_version_e].result == f_console_result_found_e) {
-      fll_program_print_version(main->message, fss_payload_write_program_version_s);
+          if (!setting->buffer.used) {
+            setting->status = F_status_set_error(F_parameter);
 
-      return status;
-    }
+            fss_payload_write_print_line_first_locked(setting, main->error);
+            fll_program_print_error_pipe_missing_content(main->error);
+            fss_payload_write_print_line_last_locked(setting, main->error);
 
-    f_file_t output = f_file_t_initialize;
+            return;
+          }
 
-    output.id = F_type_descriptor_output_d;
-    output.stream = main->output.to;
-    output.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
-    output.size_read = main->output.to.size_read;
-    output.size_write = main->output.to.size_write;
+          range.stop = setting->buffer.used - 1;
+        }
 
-    if (F_status_is_error_not(status)) {
-      if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_additional_e) {
-        if (main->parameters.array[fss_payload_write_parameter_file_e].values.used > 1) {
-          if (main->error.verbosity < f_console_verbosity_normal_e) {
-            fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
-          }
+        previous = range.start;
+        setting->status = f_string_dynamic_seek_to(setting->buffer, f_string_ascii_feed_form_s.string[0], &range);
 
-          status = F_status_set_error(F_parameter);
+        if (setting->status == F_data_not_stop) {
+          setting->status = F_status_set_error(F_parameter);
         }
-        else {
-          const f_array_length_t location = main->parameters.array[fss_payload_write_parameter_file_e].values.array[0];
 
-          output.id = -1;
-          output.stream = 0;
-          status = f_file_stream_open(argv[location], f_string_empty_s, &output);
+        if (F_status_is_error(setting->status)) {
+          fss_payload_write_print_error(setting, main->error, "f_string_dynamic_seek_to");
 
-          if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[location], f_file_operation_open_s, fll_error_file_type_file_e);
-          }
+          return;
         }
-      }
-      else if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_found_e) {
-        fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
-        status = F_status_set_error(F_parameter);
-      }
-    }
 
-    if (F_status_is_error_not(status)) {
-      if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used || main->parameters.array[fss_payload_write_parameter_content_e].locations.used) {
-        if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used) {
-          if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_object_e].values.used) {
-            fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_object_s);
-            status = F_status_set_error(F_parameter);
-          }
-          else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
-            fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
-            status = F_status_set_error(F_parameter);
-          }
-          else if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].locations.used && main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_none_e) {
-            fss_payload_write_error_parameter_same_times_print(main);
-            status = F_status_set_error(F_parameter);
-          }
-          else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used && main->parameters.array[fss_payload_write_parameter_partial_e].locations.used) {
-            if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) {
-              if (main->error.verbosity > f_console_verbosity_quiet_e) {
-                f_file_stream_lock(main->error.to);
+        if (object_ended && previous == range.start) {
+          setting->status = F_status_set_error(F_parameter);
 
-                fl_print_format("%r%[%QThe '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-                fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
-                fl_print_format("%[' parameter only allows either the '%]", main->error.to, main->error.context, main->error.context);
-                fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
-                fl_print_format("%[' parameter or the '%]", main->error.to, main->error.context, main->error.context);
-                fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
-                fl_print_format("%[' parameter, but not both.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
+          fss_payload_write_print_line_first_locked(setting, main->error);
+          fll_program_print_error_pipe_invalid_form_feed(main->error);
+          fss_payload_write_print_line_last_locked(setting, main->error);
 
-                f_file_stream_unlock(main->error.to);
-              }
+          return;
+        }
 
-              status = F_status_set_error(F_parameter);
-            }
-          }
+        range.stop = range.start - 1;
+        range.start = previous;
 
-          if (F_status_is_error_not(status)) {
-            if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) {
-              f_array_length_t location_object = 0;
-              f_array_length_t location_content = 0;
-              f_array_length_t location_sub_object = 0;
-              f_array_length_t location_sub_content = 0;
-
-              for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].locations.used; ++i) {
-                location_object = main->parameters.array[fss_payload_write_parameter_object_e].locations.array[i];
-                location_content = main->parameters.array[fss_payload_write_parameter_content_e].locations.array[i];
-                location_sub_object = main->parameters.array[fss_payload_write_parameter_object_e].locations_sub.array[i];
-                location_sub_content = main->parameters.array[fss_payload_write_parameter_content_e].locations_sub.array[i];
-
-                if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) {
-                  if (main->error.verbosity > f_console_verbosity_quiet_e) {
-                    f_file_stream_lock(main->error.to);
-
-                    fl_print_format("%r%[%QEach '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-                    fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
-                    fl_print_format("%[' parameter must be specified before a '%]", main->error.to, main->error.context, main->error.context);
-                    fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
-                    fl_print_format("%[' parameter.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
-
-                    f_file_stream_unlock(main->error.to);
-                  }
-
-                  status = F_status_set_error(F_parameter);
-                  break;
-                }
-              } // for
+        if (object_ended) {
+          setting->content.used = 0;
+
+          if (setting->buffer.used) {
+            setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->content);
+
+            if (F_status_is_error(setting->status)) {
+              fss_payload_write_print_error(setting, main->error, "f_string_dynamic_partial_append_nulless");
+
+              return;
             }
           }
+
+          setting->status = fss_payload_write_process(main, setting, setting->object, setting->content);
+          if (F_status_is_error(setting->status)) return;
+
+          fll_print_dynamic_raw(f_string_eol_s, main->output.to);
+
+          object_ended = F_false;
         }
-        else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used) {
-          if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
-            fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
-            status = F_status_set_error(F_parameter);
-          }
-          else if (!main->parameters.array[fss_payload_write_parameter_partial_e].locations.used) {
-            fss_payload_write_error_parameter_same_times_print(main);
-            status = F_status_set_error(F_parameter);
+        else {
+          setting->object.used = 0;
+
+          setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->object);
+
+          if (F_status_is_error(setting->status)) {
+            fss_payload_write_print_error(setting, main->error, "f_string_dynamic_partial_append_nulless");
+
+            return;
           }
+
+          object_ended = F_true;
         }
-      }
-      else if (!(main->pipe & fll_program_data_pipe_input_e)) {
-        if (main->error.verbosity > f_console_verbosity_quiet_e) {
-          f_file_stream_lock(main->error.to);
 
-          fl_print_format("%r%[%QThis requires either piped data or the use of the '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-          fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
-          fl_print_format("%[' parameter with the '%]", main->error.to, main->error.context, main->error.context);
-          fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
-          fl_print_format("%[' parameter.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
+        // Restore the range, positioned after the new line.
+        range.start = range.stop + 2;
+        range.stop = setting->buffer.used - 1;
 
-          f_file_stream_unlock(main->error.to);
+        // Only clear the buffer and reset the start when the entire buffer has been processed.
+        if (range.start > range.stop) {
+          range.start = 0;
+          setting->buffer.used = 0;
         }
 
-        status = F_status_set_error(F_parameter);
-      }
+      } while (status != F_none_eof || setting->buffer.used || object_ended);
 
-      if (F_status_is_error_not(status) && (main->pipe & fll_program_data_pipe_input_e)) {
-        if (main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_found_e) {
-          if (main->error.verbosity > f_console_verbosity_quiet_e) {
-            f_file_stream_lock(main->error.to);
-
-            fl_print_format("%r%[%QThis '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-            fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
-            fl_print_format("%[' parameter cannot be used when processing a pipe.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
+      if (object_ended) {
+        setting->status = F_status_set_error(F_parameter);
 
-            f_file_stream_unlock(main->error.to);
-          }
+        fss_payload_write_print_line_first_locked(setting, main->error);
+        fll_program_print_error_pipe_object_without_content(main->error);
+        fss_payload_write_print_line_last_locked(setting, main->error);
 
-          status = F_status_set_error(F_parameter);
-        }
+        return;
       }
     }
 
-    if (F_status_is_error_not(status)) {
-      if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_found_e) {
-        if (main->error.verbosity > f_console_verbosity_quiet_e) {
-          f_file_stream_lock(main->error.to);
+    for (f_array_length_t i = 0; i < setting->objects.used; ++i) {
 
-          fl_print_format("%r%[%QThe parameter '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-          fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
-          fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
+      if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          setting->status = F_status_set_error(F_interrupt);
 
-          f_file_stream_unlock(main->error.to);
+          return;
         }
 
-        status = F_status_set_error(F_parameter);
+        main->signal_check = 0;
       }
-      else if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
+
+      setting->status = fss_payload_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
+      if (F_status_is_error(setting->status)) return;
+
+      fll_print_dynamic_raw(f_string_eol_s, main->output.to);
+    } // for
+
+    // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
+    fss_payload_write_print_line_last_locked(setting, main->message);
+
+
+    // xxxxxxxxxxx
+
+    if (F_status_is_error_not(status)) {
+      if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
         const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
 
         if (argv[index].used) {
@@ -264,6 +211,7 @@ extern "C" {
               }
 
               status = F_status_set_error(F_parameter);
+
               break;
             }
           } // for
index 1f640190c9c108c7c785d6896a931059e0c06919..3ddeceee6cabb939fba1306f7b93effd6e04faca 100644 (file)
@@ -42,6 +42,7 @@
 
 // FSS Payload Write includes.
 #include <program/fss_payload_write/common.h>
+#include <program/fss_payload_write/print.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -72,7 +73,7 @@ extern "C" {
  *     F_parameter (with error bit) if main is NULL or setting is NULL.
  */
 #ifndef _di_fss_payload_write_main_
-  extern f_status_t fss_payload_write_main(fll_program_data_t * const main, fss_payload_write_setting_t * const setting);
+  extern void fss_payload_write_main(fll_program_data_t * const main, fss_payload_write_setting_t * const setting);
 #endif // _di_fss_payload_write_main_
 
 #ifdef __cplusplus
index 00eba02dccf1d2dfc70e144368c369e58f17ef9b..bf6343cf75b197075237df85eec5cacb9df4b880 100644 (file)
@@ -5,6 +5,68 @@
 extern "C" {
 #endif
 
+#ifndef _di_fss_payload_write_print_error_
+  f_status_t fss_payload_write_print_error(fss_payload_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    fss_payload_write_print_line_first_locked(setting, print);
+    fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+    fss_payload_write_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_fss_payload_write_print_error_
+
+#ifndef _di_fss_payload_write_print_error_file_
+  f_status_t fss_payload_write_print_error_file(fss_payload_write_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 (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    fss_payload_write_print_line_first_locked(setting, print);
+    fll_error_file_print(print, F_status_set_fine(setting->status), function, F_true, name, operation, type);
+    fss_payload_write_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_fss_payload_write_print_error_file_
+
+#ifndef _di_fss_payload_write_print_error_object_not_before_content_
+  f_status_t fss_payload_write_print_error_object_not_before_content(fss_payload_write_setting_t * const setting, const fl_print_t print) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%r%[%QEach '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, print.set->notable);
+    fl_print_format("%[' parameter must be specified before a '%]", print.to, print.set->error, print.set->error);
+    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, print.set->notable);
+    fl_print_format("%[' parameter.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_fss_payload_write_print_error_object_not_before_content_
+
+#ifndef _fss_payload_write_print_error_prepend_only_whitespace_
+  f_status_t fss_payload_write_print_error_prepend_only_whitespace(fss_payload_write_setting_t * const setting, const fl_print_t print) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%r%[%QThe value for the parameter '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, print.set->notable);
+    fl_print_format("%[' must only contain white space.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _fss_payload_write_print_error_prepend_only_whitespace_
+
 #ifndef _di_fss_payload_write_print_help_
   f_status_t fss_payload_write_print_help(fss_payload_write_setting_t * const setting, const fl_print_t print) {
 
index 854a25fd9579637ca3bdd836ab7b179aea00d3db..7f4218117eb91df299f219a24a07cf8df156538f 100644 (file)
@@ -13,6 +13,91 @@ extern "C" {
 #endif
 
 /**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.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.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_fss_payload_write_print_error_
+  extern f_status_t fss_payload_write_print_error(fss_payload_write_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_fss_payload_write_print_error_
+
+/**
+ * Print file related error or warning messages.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.status.
+ * @param print
+ *   Designates how printing is to be performed.
+ * @param function
+ *   The name of the function where the error happened.
+ *   Set to 0 to disable.
+ * @param name
+ *   The name of the file or directory.
+ * @param operation
+ *   The operation that fails, such as 'create' or 'access'.
+ * @param type
+ *   A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_fss_payload_write_print_error_file_
+  extern f_status_t fss_payload_write_print_error_file(fss_payload_write_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);
+#endif // _di_fss_payload_write_print_error_file_
+
+/**
+ * Print error message about each Object parameter not being specified before a Content parameter.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.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.
+ */
+#ifndef _di_fss_payload_write_print_error_object_not_before_content_
+  extern f_status_t fss_payload_write_print_error_object_not_before_content(fss_payload_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_payload_write_print_error_object_not_before_content_
+
+/**
+ * Print error when prepend parameter has something other than white space.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.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.
+ */
+#ifndef _fss_payload_write_print_error_prepend_only_whitespace_
+  extern f_status_t fss_payload_write_print_error_prepend_only_whitespace(fss_payload_write_setting_t * const setting, const fl_print_t print);
+#endif // _fss_payload_write_print_error_prepend_only_whitespace_
+
+/**
  * Print help.
  *
  * @param setting
index b91cf3d9704de2b7c1a7be302dd67cf2080e346c..e847547d6412ff264bc55a2b6e52879d58239ea1 100644 (file)
@@ -9,9 +9,7 @@ extern "C" {
 #ifndef _di_fss_payload_write_error_parameter_same_times_print_
   void fss_payload_write_error_parameter_same_times_print(fll_program_data_t * const main) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) {
-      return;
-    }
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
     f_file_stream_lock(main->error.to);
 
@@ -30,9 +28,7 @@ extern "C" {
 #ifndef _di_fss_payload_write_error_parameter_unsupported_eol_print_
   void fss_payload_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) {
-      return;
-    }
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
     f_file_stream_lock(main->error.to);
 
@@ -49,9 +45,7 @@ extern "C" {
 #ifndef _di_fss_payload_write_error_parameter_value_missing_print_
   void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) {
-      return;
-    }
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
     f_file_stream_lock(main->error.to);
 
@@ -104,7 +98,7 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          fll_error_print(main->error, F_status_set_fine(status), "fll_fss_payload_write", F_true);
+          fss_payload_write_print_error(setting, main->error, "fll_fss_payload_write");
 
           return status;
         }
@@ -139,7 +133,7 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          fll_error_print(main->error, F_status_set_fine(status), "fl_fss_basic_list_object_write", F_true);
+          fss_payload_write_print_error(setting, main->error, "fl_fss_basic_list_object_write");
 
           return status;
         }
@@ -161,7 +155,7 @@ extern "C" {
         status = fl_fss_basic_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, state, &range, buffer);
 
         if (F_status_is_error(status)) {
-          fll_error_print(main->error, F_status_set_fine(status), "fl_fss_payload_content_write", F_true);
+          fss_payload_write_print_error(setting, main->error, "fl_fss_payload_content_write");
 
           return status;
         }
@@ -172,7 +166,7 @@ extern "C" {
       status = f_string_dynamic_append(f_string_eol_s, buffer);
 
       if (F_status_is_error(status)) {
-        fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
+        fss_payload_write_print_error(setting, main->error, "f_string_dynamic_append");
 
         return status;
       }
@@ -229,7 +223,7 @@ extern "C" {
         status_pipe = f_file_read_block(input, &block);
 
         if (F_status_is_error(status_pipe)) {
-          fll_error_print(main->error, F_status_set_fine(status_pipe), "f_file_read_block", F_true);
+          fss_payload_write_print_error(setting, main->error, "f_file_read_block");
 
           status_pipe = F_status_set_error(F_pipe);
 
@@ -254,7 +248,7 @@ extern "C" {
           status = f_string_dynamic_increase_by(block.used, &object);
 
           if (F_status_is_error(status)) {
-            fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+            fss_payload_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
             break;
           }
@@ -313,7 +307,7 @@ extern "C" {
             status = f_string_dynamic_increase_by(total, &content);
 
             if (F_status_is_error(status)) {
-              fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+              fss_payload_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
               break;
             }
@@ -336,7 +330,7 @@ extern "C" {
           status = f_string_dynamic_increase_by(total, &content);
 
           if (F_status_is_error(status)) {
-            fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+            fss_payload_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
             break;
           }
@@ -388,7 +382,7 @@ extern "C" {
           status = f_string_dynamic_increase_by(block.used, &content);
 
           if (F_status_is_error(status)) {
-            fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+            fss_payload_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
             break;
           }
index a9dd4d78fc298f3f34e43140d13a0fe9b4f8d3db..50716c9188af220cb5894f3ea844f2ebdd142a88 100644 (file)
@@ -81,7 +81,12 @@ extern "C" {
 
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(setting->status)) return;
+
+    if (F_status_is_error(setting->status)) {
+      iki_read_print_error(setting, main->error, "f_console_parameter_process");
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -98,9 +103,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
-          iki_read_print_line_last_locked(setting, main->error);
+          iki_read_print_error(setting, main->error, "fll_program_parameter_process_context");
 
           return;
         }
@@ -131,9 +134,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
-          iki_read_print_line_last_locked(setting, main->error);
+          iki_read_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
 
           return;
         }
@@ -236,9 +237,7 @@ extern "C" {
       setting->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)) {
-        iki_read_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_increase_by", F_true);
-        iki_read_print_line_last_locked(setting, main->error);
+        iki_read_print_error(setting, main->error, "f_string_dynamics_increase_by");
 
         return;
       }
@@ -269,9 +268,7 @@ extern "C" {
       } // for
 
       if (F_status_is_error(setting->status)) {
-        iki_read_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_append", F_true);
-        iki_read_print_line_last_locked(setting, main->error);
+        iki_read_print_error(setting, main->error, "f_string_dynamics_append");
 
         return;
       }
@@ -304,9 +301,7 @@ extern "C" {
       setting->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)) {
-        iki_read_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_maps_increase_by", F_true);
-        iki_read_print_line_last_locked(setting, main->error);
+        iki_read_print_error(setting, main->error, "f_string_maps_increase_by");
 
         return;
       }
@@ -340,9 +335,7 @@ extern "C" {
         }
 
         if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_resize", F_true);
-          iki_read_print_line_last_locked(setting, main->error);
+          iki_read_print_error(setting, main->error, "f_string_dynamic_resize");
 
           return;
         }
@@ -393,9 +386,7 @@ extern "C" {
       setting->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)) {
-        iki_read_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_triples_increase_by", F_true);
-        iki_read_print_line_last_locked(setting, main->error);
+        iki_read_print_error(setting, main->error, "f_string_triples_increase_by");
 
         return;
       }
@@ -433,9 +424,7 @@ extern "C" {
         }
 
         if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_resize", F_true);
-          iki_read_print_line_last_locked(setting, main->error);
+          iki_read_print_error(setting, main->error, "f_string_dynamic_resize");
 
           return;
         }
@@ -560,9 +549,7 @@ extern "C" {
       setting->status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->files);
 
       if (F_status_is_error(setting->status)) {
-        iki_read_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_resize", F_true);
-        iki_read_print_line_last_locked(setting, main->error);
+        iki_read_print_error(setting, main->error, "f_string_dynamics_resize");
 
         return;
       }
@@ -576,9 +563,7 @@ extern "C" {
           setting->status = f_string_dynamic_resize(0, &setting->files.array[setting->files.used]);
 
           if (F_status_is_error(setting->status)) {
-            iki_read_print_line_first_locked(setting, main->error);
-            fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_resize", F_true);
-            iki_read_print_line_last_locked(setting, main->error);
+            iki_read_print_error(setting, main->error, "f_string_dynamic_resize");
 
             return;
           }
@@ -624,9 +609,7 @@ extern "C" {
     setting->status = f_string_triples_increase_by(parameter.values.used / 3, triple);
 
     if (F_status_is_error(setting->status)) {
-      iki_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_triples_increase_by", F_true);
-      iki_read_print_line_last_locked(setting, main->error);
+      iki_read_print_error(setting, main->error, "f_string_triples_increase_by");
 
       return F_false;
     }
@@ -666,9 +649,7 @@ extern "C" {
       }
 
       if (F_status_is_error(setting->status)) {
-        iki_read_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_resize", F_true);
-        iki_read_print_line_last_locked(setting, main->error);
+        iki_read_print_error(setting, main->error, "f_string_dynamic_resize");
 
         return F_false;
       }
index 2277dd58931fcc729e7d01e36b891bcc433c9d44..842b0c12a99d6d869b0850fe4fe7ab0515db33e0 100644 (file)
@@ -35,9 +35,7 @@ extern "C" {
       setting->status = f_file_read(file, &setting->buffer);
 
       if (F_status_is_error(setting->status)) {
-        iki_read_print_line_first_locked(setting, main->error);
-        fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_read", F_true, f_string_ascii_minus_s, f_file_operation_process_s, fll_error_file_type_file_e);
-        iki_read_print_line_last_locked(setting, main->error);
+        iki_read_print_error_file(setting, main->error, "f_file_read", f_string_ascii_minus_s, f_file_operation_process_s, fll_error_file_type_file_e);
       }
       else {
         iki_read_process_buffer(main, setting);
@@ -71,9 +69,7 @@ extern "C" {
         setting->status = f_file_stream_open(setting->files.array[i], f_string_empty_s, &file);
 
         if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first_locked(setting, main->error);
-          fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", F_true, setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
-          iki_read_print_line_last_locked(setting, main->error);
+          iki_read_print_error_file(setting, main->error, "f_file_stream_open", setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
 
           return;
         }
@@ -81,9 +77,7 @@ extern "C" {
         setting->status = f_file_descriptor(&file);
 
         if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first_locked(setting, main->error);
-          fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_descriptor", F_true, setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
-          iki_read_print_line_last_locked(setting, main->error);
+          iki_read_print_error_file(setting, main->error, "f_file_descriptor", setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
 
           return;
         }
@@ -93,9 +87,7 @@ extern "C" {
         setting->status = f_file_size_by_id(file, &size_file);
 
         if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first_locked(setting, main->error);
-          fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_size_by_id", F_true, setting->files.array[i], f_file_operation_analyze_s, fll_error_file_type_file_e);
-          iki_read_print_line_last_locked(setting, main->error);
+          iki_read_print_error_file(setting, main->error, "f_file_size_by_id", setting->files.array[i], f_file_operation_analyze_s, fll_error_file_type_file_e);
 
           break;
         }
@@ -122,9 +114,7 @@ extern "C" {
         setting->status = f_string_dynamic_increase_by(size_file + 1, &setting->buffer);
 
         if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first_locked(setting, main->error);
-          fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_increase_by", F_true, setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
-          iki_read_print_line_last_locked(setting, main->error);
+          iki_read_print_error_file(setting, main->error, "f_string_dynamic_increase_by", setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
 
           break;
         }
@@ -146,9 +136,7 @@ extern "C" {
 
         if (F_status_is_error(setting->status)) {
           if (F_status_set_fine(setting->status) != F_interrupt) {
-            iki_read_print_line_first_locked(setting, main->error);
-            fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_read_until", F_true, setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
-            iki_read_print_line_last_locked(setting, main->error);
+            iki_read_print_error_file(setting, main->error, "f_file_stream_read_until", setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
           }
 
           break;
index c18c8d71a39914ab988a98622859cae925e0da5e..f951f2f2ccf8daf6f1752d9006f630fcebfae81d 100644 (file)
@@ -5,6 +5,32 @@
 extern "C" {
 #endif
 
+#ifndef _di_iki_read_print_error_
+  f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    iki_read_print_line_first_locked(setting, print);
+    fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+    iki_read_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_iki_read_print_error_
+
+#ifndef _di_iki_read_print_error_file_
+  f_status_t iki_read_print_error_file(iki_read_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 (print.verbosity == f_console_verbosity_quiet_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, F_true, name, operation, type);
+    iki_read_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_iki_read_print_error_file_
+
 #ifndef _di_iki_read_print_help_
   f_status_t iki_read_print_help(iki_read_setting_t * const setting, const fl_print_t print) {
 
index 55dea8af084308f25ecf01963c8638754e0f4fbf..7d1dc4cdf054aef4a7ef2c6d495be339850841d8 100644 (file)
@@ -13,6 +13,55 @@ extern "C" {
 #endif
 
 /**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.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.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_iki_read_print_error_
+  extern f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_iki_read_print_error_
+
+/**
+ * Print file related error or warning messages.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.status.
+ * @param print
+ *   Designates how printing is to be performed.
+ * @param function
+ *   The name of the function where the error happened.
+ *   Set to 0 to disable.
+ * @param name
+ *   The name of the file or directory.
+ * @param operation
+ *   The operation that fails, such as 'create' or 'access'.
+ * @param type
+ *   A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_iki_read_print_error_file_
+  extern f_status_t iki_read_print_error_file(iki_read_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);
+#endif // _di_iki_read_print_error_file_
+
+/**
  * Print help.
  *
  * @param setting
index 22354e47d7aa74d3289d993a78dd1875d28b2aaa..b25f2c683435c9505d9f089fdbb36c378d392205 100644 (file)
@@ -169,9 +169,7 @@ extern "C" {
     }
 
     if (F_status_is_error(setting->status)) {
-      iki_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "fl_iki_read", F_true);
-      iki_read_print_line_last_locked(setting, main->error);
+      iki_read_print_error(setting, main->error, "fl_iki_read");
 
       return;
     }
@@ -284,9 +282,7 @@ extern "C" {
     }
 
     if (F_status_is_error(setting->status)) {
-      iki_read_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "fl_iki_read", F_true);
-      iki_read_print_line_last_locked(setting, main->error);
+      iki_read_print_error(setting, main->error, "fl_iki_read");
 
       return;
     }
@@ -400,7 +396,7 @@ extern "C" {
     }
 
     if (F_status_is_error(setting->status)) {
-      fll_error_print(main->error, F_status_set_fine(setting->status), "fl_iki_read", F_true);
+      iki_read_print_error(setting, main->error, "fl_iki_read");
 
       return;
     }
@@ -442,7 +438,7 @@ extern "C" {
         setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &name);
 
         if (F_status_is_error(setting->status)) {
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
+          iki_read_print_error(setting, main->error, "f_string_dynamic_append_nulless");
 
           f_string_dynamic_resize(0, &name);
 
index 04285e3deb5d81b275fa63af6b4c71eecb6434d5..5303521be73e0cfbc8f9e939f21381338425f6e0 100644 (file)
@@ -57,9 +57,7 @@ extern "C" {
     setting->status = f_console_parameter_process(arguments, &main->parameters);
 
     if (F_status_is_error(setting->status)) {
-      iki_write_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
-      iki_write_print_line_last_locked(setting, main->error);
+      iki_write_print_error(setting, main->error, "f_console_parameter_process");
 
       return;
     }
@@ -79,9 +77,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          iki_write_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
-          iki_write_print_line_last_locked(setting, main->error);
+          iki_write_print_error(setting, main->error, "fll_program_parameter_process_context");
 
           return;
         }
@@ -112,9 +108,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          iki_write_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
-          iki_write_print_line_last_locked(setting, main->error);
+          iki_write_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
 
           return;
         }
@@ -137,7 +131,7 @@ extern "C" {
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
-    if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_e) {
+    if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_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);
 
@@ -183,9 +177,7 @@ extern "C" {
       setting->status = f_string_dynamics_resize(values->used, &setting->objects);
 
       if (F_status_is_error(setting->status)) {
-        iki_write_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_resize", F_true);
-        iki_write_print_line_last_locked(setting, main->error);
+        iki_write_print_error(setting, main->error, "f_string_dynamics_resize");
 
         return;
       }
@@ -220,9 +212,7 @@ extern "C" {
       setting->status = f_string_dynamics_resize(values->used, &setting->contents);
 
       if (F_status_is_error(setting->status)) {
-        iki_write_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_resize", F_true);
-        iki_write_print_line_last_locked(setting, main->error);
+        iki_write_print_error(setting, main->error, "f_string_dynamics_resize");
 
         return;
       }
index bcdc4a1abe72decea359e92c9dc3a8ba4080e308..136f7ef006b7da3e76aa845df9e295831f21ff56 100644 (file)
@@ -61,9 +61,7 @@ extern "C" {
           if (F_status_is_error(status)) {
             setting->status = F_status_set_error(F_pipe);
 
-            iki_write_print_line_first_locked(setting, main->error);
-            fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
-            iki_write_print_line_last_locked(setting, main->error);
+            iki_write_print_error_file(setting, main->error, "f_file_read", f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
 
             return;
           }
@@ -89,9 +87,7 @@ extern "C" {
         }
 
         if (F_status_is_error(setting->status)) {
-          iki_write_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_seek_to", F_true);
-          iki_write_print_line_last_locked(setting, main->error);
+          iki_write_print_error(setting, main->error, "f_string_dynamic_seek_to");
 
           return;
         }
@@ -116,15 +112,13 @@ extern "C" {
             setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->content);
 
             if (F_status_is_error(setting->status)) {
-              iki_write_print_line_first_locked(setting, main->error);
-              fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_partial_append_nulless", F_true);
-              iki_write_print_line_last_locked(setting, main->error);
+              iki_write_print_error(setting, main->error, "f_string_dynamic_partial_append_nulless");
 
               return;
             }
           }
 
-          setting->status = iki_write_process(main, setting, setting->object, setting->content);
+          iki_write_process(main, setting, setting->object, setting->content);
           if (F_status_is_error(setting->status)) return;
 
           fll_print_dynamic_raw(f_string_eol_s, main->output.to);
@@ -137,9 +131,7 @@ extern "C" {
           setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->object);
 
           if (F_status_is_error(setting->status)) {
-            iki_write_print_line_first_locked(setting, main->error);
-            fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_partial_append_nulless", F_true);
-            iki_write_print_line_last_locked(setting, main->error);
+            iki_write_print_error(setting, main->error, "f_string_dynamic_partial_append_nulless");
 
             return;
           }
@@ -182,7 +174,7 @@ extern "C" {
         main->signal_check = 0;
       }
 
-      setting->status = iki_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
+      iki_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
       if (F_status_is_error(setting->status)) return;
 
       fll_print_dynamic_raw(f_string_eol_s, main->output.to);
index 6857588e21f48d5583e79f4084b99ec32dd3250a..67027cdedfab949e5d911064f4d5ef3a5214651e 100644 (file)
@@ -80,7 +80,14 @@ extern "C" {
  *     F_false on success when performing verification and verify failed.
  *     F_interrupt on (exit) signal received.
  *
+ *     F_failure (with error bit) on processing failure.
  *     F_parameter (with error bit) if main is NULL or setting is NULL.
+ *
+ *     Errors (with error bit) from: f_iki_object_is().
+ *     Errors (with error bit) from: fll_iki_content_escape().
+ *
+ * @see f_iki_object_is()
+ * @see fll_iki_content_escape()
  */
 #ifndef _di_iki_write_main_
   extern void iki_write_main(fll_program_data_t * const main, iki_write_setting_t * const setting);
index d411935c0ae0e3c741e429a11990af6c5a2033bf..ebb169c76de6e330a4a21b82b78884a11e991d03 100644 (file)
@@ -5,6 +5,72 @@
 extern "C" {
 #endif
 
+#ifndef _di_iki_write_print_error_
+  f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    iki_write_print_line_first_locked(setting, print);
+    fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+    iki_write_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_iki_write_print_error_
+
+#ifndef _di_iki_write_print_error_file_
+  f_status_t iki_write_print_error_file(iki_write_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 (print.verbosity == f_console_verbosity_quiet_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, F_true, name, operation, type);
+    iki_write_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_iki_write_print_error_file_
+
+#ifndef _di_iki_write_print_error_main_missing_
+  f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QNo main provided, either pipe the main data or use the '%]", print.to, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_object_s, print.set->notable);
+    fl_print_format("%[' and the '%]", print.to, print.set->error, print.set->error);
+    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_content_s, print.set->notable);
+    fl_print_format("%[' parameters.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_iki_write_print_error_main_missing_
+
+#ifndef _di_iki_write_print_error_object_not_valid_
+  f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    iki_write_print_line_first_unlocked(setting, print);
+
+    fl_print_format("%[%QThe object '%]", print.to, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%]", print.to, print.set->notable, object, print.set->notable);
+    fl_print_format("%[' is not a valid IKI Object.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+    iki_write_print_line_last_unlocked(setting, print);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_iki_write_print_error_object_not_valid_
+
 #ifndef _di_iki_write_print_help_
   f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print) {
 
@@ -115,42 +181,6 @@ extern "C" {
   }
 #endif // _di_iki_write_print_line_last_unlocked_
 
-#ifndef _di_iki_write_print_error_main_missing_
-  f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print) {
-
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
-    f_file_stream_lock(print.to);
-
-    fl_print_format("%[%QNo main provided, either pipe the main data or use the '%]", print.to, print.set->error, print.prefix, print.set->error);
-    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_object_s, print.set->notable);
-    fl_print_format("%[' and the '%]", print.to, print.set->error, print.set->error);
-    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_content_s, print.set->notable);
-    fl_print_format("%[' parameters.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
-
-    f_file_stream_unlock(print.to);
-
-    return F_none;
-  }
-#endif // _di_iki_write_print_error_main_missing_
-
-#ifndef _di_iki_write_print_error_object_not_valid_
-  f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object) {
-
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
-    f_file_stream_lock(print.to);
-
-    fl_print_format("%[%QThe object '%]", print.to, print.set->error, print.prefix, print.set->error);
-    fl_print_format("%[%Q%]", print.to, print.set->notable, object, print.set->notable);
-    fl_print_format("%[' is not a valid IKI Object.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
-
-    f_file_stream_unlock(print.to);
-
-    return F_none;
-  }
-#endif // _di_iki_write_print_error_object_not_valid_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 99fdf842aaf56a6e8e94e5b7ab89b10d72d9de7f..6fa4a6d86d13c9ddeae1fad2c02b208f22c5553d 100644 (file)
@@ -13,29 +13,56 @@ extern "C" {
 #endif
 
 /**
- * Print help.
+ * Print generic error message regarding a function failing in some way.
  *
  * @param setting
  *   The main program settings.
  *
  *   This does not alter setting.status.
  * @param print
- *   The output structure to print to.
+ *   Designates the how and where to print.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
  */
-#ifndef _di_iki_write_print_help_
-  extern f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_help_
+#ifndef _di_iki_write_print_error_
+  extern f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_iki_write_print_error_
 
 /**
- * Print first new line, unless verbosity says otherwise.
+ * Print file related error or warning messages.
  *
- * This is generally either the first line in the program or the first line printed before an error message.
+ * @param setting
+ *   The main program settings.
  *
- * This function locks and then unlocks the input stream when printing.
+ *   This does not alter setting.status.
+ * @param print
+ *   Designates how printing is to be performed.
+ * @param function
+ *   The name of the function where the error happened.
+ *   Set to 0 to disable.
+ * @param name
+ *   The name of the file or directory.
+ * @param operation
+ *   The operation that fails, such as 'create' or 'access'.
+ * @param type
+ *   A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_iki_write_print_error_file_
+  extern f_status_t iki_write_print_error_file(iki_write_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);
+#endif // _di_iki_write_print_error_file_
+
+/**
+ * Print error message about "main" Object being missing.
  *
  * @param setting
  *   The main program settings.
@@ -48,36 +75,52 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
-#ifndef _di_iki_write_print_line_first_locked_
-  extern f_status_t iki_write_print_line_first_locked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_locked_
+#ifndef _di_iki_write_print_error_main_missing_
+  extern f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_error_main_missing_
 
 /**
- * Print first new line, unless verbosity says otherwise.
+ * Print error message about an Object not being valid.
  *
- * This is generally either the first line in the program or the first line printed before an error message.
+ * @param setting
+ *   The main program settings.
  *
- * This function neither locks nor unlocks the input stream.
+ *   This does not alter setting.status.
+ * @param print
+ *   Designates the how and where to print.
+ * @param object
+ *   The a string representing the object that is missing.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_iki_write_print_error_object_not_valid_
+  extern f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object);
+#endif // _di_iki_write_print_error_object_not_valid_
+
+/**
+ * Print help.
  *
  * @param setting
  *   The main program settings.
  *
  *   This does not alter setting.status.
  * @param print
- *   Designates the how and where to print.
+ *   The output structure to print to.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
-#ifndef _di_iki_write_print_line_first_unlocked_
-  extern f_status_t iki_write_print_line_first_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_unlocked_
+#ifndef _di_iki_write_print_help_
+  extern f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_help_
 
 /**
- * Print last new line when the main is complete, unless verbosity says otherwise.
+ * Print first new line, unless verbosity says otherwise.
  *
- * This is generally the very last line printed in the program.
+ * This is generally either the first line in the program or the first line printed before an error message.
  *
  * This function locks and then unlocks the input stream when printing.
  *
@@ -92,14 +135,14 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
-#ifndef _di_iki_write_print_line_last_locked_
-  extern f_status_t iki_write_print_line_last_locked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_locked_
+#ifndef _di_iki_write_print_line_first_locked_
+  extern f_status_t iki_write_print_line_first_locked(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_first_locked_
 
 /**
- * Print last new line when the main is complete, unless verbosity says otherwise.
+ * Print first new line, unless verbosity says otherwise.
  *
- * This is generally the very last line printed in the program.
+ * This is generally either the first line in the program or the first line printed before an error message.
  *
  * This function neither locks nor unlocks the input stream.
  *
@@ -114,12 +157,16 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
-#ifndef _di_iki_write_print_line_last_unlocked_
-  extern f_status_t iki_write_print_line_last_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_unlocked_
+#ifndef _di_iki_write_print_line_first_unlocked_
+  extern f_status_t iki_write_print_line_first_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_first_unlocked_
 
 /**
- * Print error message about "main" Object being missing.
+ * Print last new line when the main is complete, unless verbosity says otherwise.
+ *
+ * This is generally the very last line printed in the program.
+ *
+ * This function locks and then unlocks the input stream when printing.
  *
  * @param setting
  *   The main program settings.
@@ -132,12 +179,16 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
-#ifndef _di_iki_write_print_error_main_missing_
-  extern f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_error_main_missing_
+#ifndef _di_iki_write_print_line_last_locked_
+  extern f_status_t iki_write_print_line_last_locked(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_last_locked_
 
 /**
- * Print error message about an Object not being valid.
+ * Print last new line when the main is complete, unless verbosity says otherwise.
+ *
+ * This is generally the very last line printed in the program.
+ *
+ * This function neither locks nor unlocks the input stream.
  *
  * @param setting
  *   The main program settings.
@@ -145,16 +196,14 @@ extern "C" {
  *   This does not alter setting.status.
  * @param print
  *   Designates the how and where to print.
- * @param object
- *   The a string representing the object that is missing.
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
-#ifndef _di_iki_write_print_error_object_not_valid_
-  extern f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object);
-#endif // _di_iki_write_print_error_object_not_valid_
+#ifndef _di_iki_write_print_line_last_unlocked_
+  extern f_status_t iki_write_print_line_last_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_last_unlocked_
 
 #ifdef __cplusplus
 } // extern "C"
index eacb58508b8f0396942a52906d86c4eaeb2881d0..75311313d7a42b9832f268ba03b74570e6367c40 100644 (file)
@@ -7,41 +7,47 @@ extern "C" {
 #endif
 
 #ifndef _di_iki_write_process_
-  f_status_t 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) {
+  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) {
-      fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
+      setting->status = F_status_set_error(F_failure);
 
-      return F_status_set_error(F_failure);
+      if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        iki_write_print_line_first_locked(setting, main->error);
+        fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
+        iki_write_print_line_last_locked(setting, main->error);
+      }
+
+      return;
     }
 
-    f_status_t status = f_iki_object_is(object);
+    setting->status = f_iki_object_is(object);
+
+    if (setting->status == F_false) {
+      setting->status = F_status_set_error(F_failure);
 
-    if (status == F_false) {
       iki_write_print_error_object_not_valid(setting, main->error, object);
 
-      return F_status_set_error(F_failure);
+      return;
     }
 
-    if (F_status_is_error(status)) {
-      fll_error_print(main->error, F_status_set_fine(status), "f_iki_object_is", F_true);
+    if (F_status_is_error(setting->status)) {
+      iki_write_print_error(setting, main->error, "f_iki_object_is");
 
-      return F_status_set_error(F_failure);
+      return;
     }
 
     setting->escaped.used = 0;
 
-    status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
+    setting->status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
 
-    if (F_status_is_error(status)) {
-      fll_error_print(main->error, F_status_set_fine(status), "fll_iki_content_escape", F_true);
+    if (F_status_is_error(setting->status)) {
+      iki_write_print_error(setting, main->error, "fll_iki_content_escape");
 
-      return F_status_set_error(F_failure);
+      return;
     }
 
     fl_print_format("%Q%r%r%Q%r", main->output.to, object, f_iki_syntax_separator_s, setting->quote, setting->escaped, setting->quote);
-
-    return F_none;
   }
 #endif // _di_iki_write_process_
 
index 41587cd8582961088e8ae608426cc4b9ad6e329e..55051d41e6420207ee28ad1c4af6fd217a00f556 100644 (file)
@@ -19,18 +19,24 @@ extern "C" {
  *   The main program data.
  * @param setting
  *   The main program settings.
+ *
+ *   This alters setting.status:
+ *     F_none on success.
+ *
+ *     Errors (with error bit) from: f_iki_object_is().
+ *     Errors (with error bit) from: fll_iki_content_escape().
+ *
+ *     F_failure (with error bit) for any other failure.
  * @param object
  *   The object to validate and print.
  * @param content
  *   The content to escape and print.
  *
- * @return
- *   F_none on success.
- *
- *   F_failure (with error bit) for any other failure.
+ * @see f_iki_object_is()
+ * @see fll_iki_content_escape()
  */
 #ifndef _di_iki_write_process_
-  extern f_status_t 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) F_attribute_visibility_internal_d;
+  extern 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) F_attribute_visibility_internal_d;
 #endif // _di_iki_write_process_
 
 #ifdef __cplusplus
index b21cf92c26efb03727191f5b4fb1b41c504d5df2..d51637fe1ce091c32e3d9846ce73b1dc85957430 100644 (file)
@@ -57,9 +57,7 @@ extern "C" {
     setting->status = f_console_parameter_process(arguments, &main->parameters);
 
     if (F_status_is_error(setting->status)) {
-      status_code_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
-      status_code_print_line_last_locked(setting, main->error);
+      status_code_print_error(setting, main->error, "f_console_parameter_process");
 
       return;
     }
@@ -79,9 +77,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          status_code_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
-          status_code_print_line_last_locked(setting, main->error);
+          status_code_print_error(setting, main->error, "fll_program_parameter_process_context");
 
           return;
         }
@@ -112,9 +108,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          status_code_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
-          status_code_print_line_last_locked(setting, main->error);
+          status_code_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
 
           return;
         }
index e457d5ac971aa6820889bdacc2cc0ddd69aaa4d7..c1c9637052bb7463218acbaf78dddabec476d002 100644 (file)
@@ -6,6 +6,19 @@
 extern "C" {
 #endif
 
+#ifndef _di_status_code_print_error_
+  f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    status_code_print_line_first_locked(setting, print);
+    fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+    status_code_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_status_code_print_error_
+
 #ifndef _di_status_code_print_error_cannot_error_warning_number_
   f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print) {
 
index 97a0a13faef235e8833d1571eb772b3a1ff47265..3caab2682f60ea613f40056752a52f28504e2396 100644 (file)
@@ -13,6 +13,26 @@ extern "C" {
 #endif
 
 /**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.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.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_status_code_print_error_
+  extern f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_status_code_print_error_
+
+/**
  * Print an error message when error parameter and warning parameter are specified without number parameter.
  *
  * @param setting
index 35301bd5595882aed5170d82ed3b0c5733e74e23..9f4b685bdfe1ec46ef63ad25a5ba18fea4d859ff 100644 (file)
@@ -96,9 +96,7 @@ extern "C" {
     setting->status = f_console_parameter_process(arguments, &main->parameters);
 
     if (F_status_is_error(setting->status)) {
-      utf8_print_line_first_locked(setting, main->error);
-      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
-      utf8_print_line_last_locked(setting, main->error);
+      utf8_print_error(setting, main->error, "f_console_parameter_process");
 
       return;
     }
@@ -118,9 +116,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          utf8_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
-          utf8_print_line_last_locked(setting, main->error);
+          utf8_print_error(setting, main->error, "fll_program_parameter_process_context");
 
           return;
         }
@@ -151,9 +147,7 @@ extern "C" {
         setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->status)) {
-          utf8_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
-          utf8_print_line_last_locked(setting, main->error);
+          utf8_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
 
           return;
         }
@@ -180,9 +174,7 @@ extern "C" {
         setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
 
         if (F_status_is_error(setting->status)) {
-          utf8_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-          utf8_print_line_last_locked(setting, main->error);
+          utf8_print_error(setting, main->error, "f_console_parameter_prioritize_right");
 
           return;
         }
@@ -213,9 +205,7 @@ extern "C" {
         setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
 
         if (F_status_is_error(setting->status)) {
-          utf8_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-          utf8_print_line_last_locked(setting, main->error);
+          utf8_print_error(setting, main->error, "f_console_parameter_prioritize_right");
 
           return;
         }
@@ -301,9 +291,7 @@ extern "C" {
         setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
 
         if (F_status_is_error(setting->status)) {
-          utf8_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_increase_by", F_true);
-          utf8_print_line_last_locked(setting, main->error);
+          utf8_print_error(setting, main->error, "f_string_dynamics_increase_by");
 
           return;
         }
@@ -313,9 +301,7 @@ extern "C" {
         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]);
 
         if (F_status_is_error(setting->status)) {
-          utf8_print_line_first_locked(setting, main->error);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
-          utf8_print_line_last_locked(setting, main->error);
+          utf8_print_error(setting, main->error, "f_string_dynamic_append_nulless");
 
           return;
         }
@@ -325,9 +311,7 @@ extern "C" {
         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);
 
         if (F_status_is_error(setting->status)) {
-          utf8_print_line_first_locked(setting, main->error);
-          fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", F_true, 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);
-          utf8_print_line_last_locked(setting, main->error);
+          utf8_print_error_file(setting, main->error, "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;
         }
@@ -367,9 +351,7 @@ extern "C" {
       setting->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)) {
-        utf8_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_increase_by", F_true);
-        utf8_print_line_last_locked(setting, main->error);
+        utf8_print_error(setting, main->error, "f_string_dynamics_increase_by");
 
         return;
       }
@@ -440,9 +422,7 @@ extern "C" {
       setting->status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->remaining);
 
       if (F_status_is_error(setting->status)) {
-        utf8_print_line_first_locked(setting, main->error);
-        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
-        utf8_print_line_last_locked(setting, main->error);
+        utf8_print_error(setting, main->error, "f_string_dynamic_append_nulless");
 
         return;
       }
index b7f742d0d05932c1bf3af64860be79accc47c6b4..4105f6817d25a6d1324f7ce4f158c8f674c3513c 100644 (file)
@@ -5,6 +5,32 @@
 extern "C" {
 #endif
 
+#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 (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    utf8_print_line_first_locked(setting, print);
+    fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+    utf8_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_utf8_print_error_
+
+#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 (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    utf8_print_line_first_locked(setting, print);
+    fll_error_file_print(print, F_status_set_fine(setting->status), function, F_true, name, operation, type);
+    utf8_print_line_last_locked(setting, print);
+
+    return F_none;
+  }
+#endif // _di_utf8_print_error_file_
+
 #ifndef _di_utf8_print_bytesequence_
   f_status_t utf8_print_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
 
index d690ab05313f711fee8b60bb021f0cf8f1446e71..8a656e65fe43f96bfc36ca6c5396b7cdfb9f32f5 100644 (file)
@@ -13,6 +13,55 @@ extern "C" {
 #endif
 
 /**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.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.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_utf8_print_error_
+  extern f_status_t utf8_print_error(utf8_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_utf8_print_error_
+
+/**
+ * Print file related error or warning messages.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.status.
+ * @param print
+ *   Designates how printing is to be performed.
+ * @param function
+ *   The name of the function where the error happened.
+ *   Set to 0 to disable.
+ * @param name
+ *   The name of the file or directory.
+ * @param operation
+ *   The operation that fails, such as 'create' or 'access'.
+ * @param type
+ *   A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_utf8_print_error_file_
+  extern 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);
+#endif // _di_utf8_print_error_file_
+
+/**
  * Print the byte sequence character (such as '豸').
  *
  * @param main
index 84a3712059c7d59118a095286ace5e8f67813878..a26997b19a835056cb73a5869ff899b97ea3779c 100644 (file)
@@ -53,7 +53,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) {
-        fll_error_file_print(main->error, F_status_set_fine(setting->status), setting->mode & utf8_mode_from_bytesequence_e ? "utf8_process_file_bytesequence" : "utf8_process_file_codepoint", F_true, f_string_empty_s, f_file_operation_process_s, fll_error_file_type_pipe_e);
+        utf8_print_error_file(setting, main->error, setting->mode & utf8_mode_from_bytesequence_e ? "utf8_process_file_bytesequence" : "utf8_process_file_codepoint", f_string_empty_s, f_file_operation_process_s, fll_error_file_type_pipe_e);
       }
     }
 
@@ -78,7 +78,7 @@ extern "C" {
         setting->status = f_file_stream_open(setting->path_files_from.array[i], f_string_empty_s, &file);
 
         if (F_status_is_error(setting->status)) {
-          fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", F_true, setting->path_files_from.array[i], f_file_operation_open_s, fll_error_file_type_file_e);
+          utf8_print_error_file(setting, main->error, "f_file_stream_open", setting->path_files_from.array[i], f_file_operation_open_s, fll_error_file_type_file_e);
 
           break;
         }
@@ -118,7 +118,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) {
-          fll_error_file_print(main->error, F_status_set_fine(setting->status), setting->mode & utf8_mode_from_bytesequence_e ? "utf8_process_file_bytesequence" : "utf8_process_file_codepoint", F_true, setting->path_files_from.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
+          utf8_print_error_file(setting, main->error, setting->mode & utf8_mode_from_bytesequence_e ? "utf8_process_file_bytesequence" : "utf8_process_file_codepoint", setting->path_files_from.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
 
           break;
         }