]> Kevux Git Server - fll/commitdiff
Progress: Continue program related work.
authorKevin Day <thekevinday@gmail.com>
Thu, 1 Sep 2022 02:19:05 +0000 (21:19 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 1 Sep 2022 02:19:05 +0000 (21:19 -0500)
Slight restructuring of memory allocation:
- Add or move double free and and unnecessary free checks.
- If amount 0 for increase functions, then do nothing.
- When resizing, perform a stale check in case strings point to a static string.
- The private_f_memory_structure_resize() should properly return the error response.

Remove fll_program_parameter_long_print_cannot_use_with().

The fll_program_standard_set_down() needs to check both the stream and the descriptors when closing rather than one or the other.

Explicitly set signal_received to uint32_t rather than int.
- The signal needs to also be uint32_t rather than f_status_t.

Add several new print functions for common print messages used by the programs.

Switch from flockfile() to f_file_stream_lock() and from funlockfile() to f_file_stream_unlock().
- There are still a lot more cases where these changes need to be made.

Add more function documentation.

Use "greater than" rather than "not equal to" for console verbosity checks.

More changes to these programs:
- fss_status_code
- iki_write
- status_code
- utf8

101 files changed:
level_0/f_console/c/console/common.h
level_0/f_memory/c/memory/structure.c
level_0/f_memory/c/private-memory.c
level_2/fll_program/c/program.c
level_2/fll_program/c/program.h
level_2/fll_program/c/program/common.h
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/common.c
level_3/byte_dump/c/private-byte_dump.c
level_3/control/c/common.c
level_3/control/c/control.c
level_3/control/c/private-control.c
level_3/control/c/private-print.c
level_3/controller/c/common.c
level_3/controller/c/controller.c
level_3/controller/c/controller/private-controller.c
level_3/controller/c/entry/private-entry.c
level_3/controller/c/rule/private-rule.c
level_3/controller/c/thread/private-thread.c
level_3/controller/c/thread/private-thread_entry.c
level_3/controller/c/thread/private-thread_process.c
level_3/fake/c/common.c
level_3/fake/c/fake.c
level_3/fake/c/private-build-load.c
level_3/fake/c/private-build-objects.c
level_3/fake/c/private-build.c
level_3/fake/c/private-fake.c
level_3/fake/c/private-make-load_fakefile.c
level_3/fake/c/private-make-operate.c
level_3/fake/c/private-make-operate_process_type.c
level_3/fake/c/private-make.c
level_3/fake/c/private-print.c
level_3/fake/c/private-skeleton.c
level_3/firewall/c/common.c
level_3/firewall/c/firewall.c
level_3/firewall/c/private-firewall.c
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/private-read.c
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/private-write.c
level_3/fss_basic_read/c/common.c
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/private-read.c
level_3/fss_basic_write/c/common.c
level_3/fss_basic_write/c/fss_basic_write.c
level_3/fss_basic_write/c/private-write.c
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_write/c/common.c
level_3/fss_embedded_list_write/c/fss_embedded_list_write.c
level_3/fss_embedded_list_write/c/private-write.c
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/private-read.c
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/private-write.c
level_3/fss_extended_read/c/common.c
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/private-read.c
level_3/fss_extended_write/c/common.c
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_extended_write/c/private-write.c
level_3/fss_identify/c/common.c
level_3/fss_identify/c/fss_identify.c
level_3/fss_payload_read/c/common.c
level_3/fss_payload_read/c/fss_payload_read.c
level_3/fss_payload_read/c/private-read.c
level_3/fss_payload_write/c/common.c
level_3/fss_payload_write/c/fss_payload_write.c
level_3/fss_payload_write/c/private-write.c
level_3/fss_status_code/c/common.c
level_3/fss_status_code/c/fss_status_code.c
level_3/fss_status_code/c/print.c
level_3/fss_status_code/c/print.h
level_3/iki_read/c/common.c
level_3/iki_read/c/iki_read.c
level_3/iki_write/c/common.c
level_3/iki_write/c/common.h
level_3/iki_write/c/iki_write.c
level_3/iki_write/c/iki_write.h
level_3/iki_write/c/main.c
level_3/iki_write/c/print.c
level_3/iki_write/c/print.h
level_3/iki_write/c/private-common.c
level_3/iki_write/c/private-common.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/status_code/c/status_code.c
level_3/utf8/c/common.c
level_3/utf8/c/common.h
level_3/utf8/c/print.c
level_3/utf8/c/print.h
level_3/utf8/c/utf8.c

index c459873b4ebead6240a6093b5f715a9e858ad8f8..011f993664b5839396fb80ab20fdab9826decc3b 100644 (file)
@@ -247,6 +247,8 @@ extern "C" {
  *
  * Intended to be used for the basic/standard verbosity modes for all programs following this practice.
  *
+ * These are expected to be in numeric order such that the smallest number is the least verbose and the highest number is the most verbose.
+ *
  * f_console_verbosity_*:
  *   - quiet:   Verbosity is set to quiet.
  *   - error:   Verbosity is set to error.
index 22dc2636bf45726d3cb4a7f0fe8c79d5dc39a616..2a73b44e16df63e1e2fb8f3cfbfcfbda1b403e35 100644 (file)
@@ -14,6 +14,9 @@ extern "C" {
       if (!size) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
+    // Prevent double-frees and unnecessary frees.
+    if (!*structure && !length_new || *size == length_new) return F_data_not;
+
     return private_f_memory_structure_adjust(length_new, type_size, structure, used, size);
   }
 #endif // _di_f_memory_structure_adjust_
@@ -89,7 +92,7 @@ extern "C" {
       if (!size) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
-    if (*used + amount > *size) {
+    if (amount && *used + amount > *size) {
       if (*used + amount > F_array_length_t_size_d) {
         return F_status_set_error(F_array_too_large);
       }
@@ -110,6 +113,9 @@ extern "C" {
       if (!size) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
+    // Prevent double-frees and unnecessary frees.
+    if (!*structure && !length_new || *size == length_new) return F_data_not;
+
     return private_f_memory_structure_resize(length_new, type_size, structure, used, size);
   }
 #endif // _di_f_memory_structure_resize_
index 8838c77a769552f870484334aaf11bba00260bc0..11c1d4877548c2fad70b6f6fb961e84f0d1428e8 100644 (file)
@@ -8,7 +8,10 @@ extern "C" {
 #if !defined(_di_f_memory_adjust_) || !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
   f_status_t private_f_memory_adjust(const size_t length_old, const size_t length_new, const size_t type_size, void ** const pointer) {
 
-    if (length_old == length_new) return F_data_not;
+    // When old length is 0 and the pointer is not NULL, then consider this pointer stale and reset it to NULL.
+    if (!length_old && *pointer) {
+      *pointer = 0;
+    }
 
     if (*pointer) {
       if (length_old) {
@@ -60,6 +63,11 @@ extern "C" {
 #if !defined(_di_f_memory_resize_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
   f_status_t private_f_memory_resize(const size_t length_old, const size_t length_new, const size_t type_size, void ** const pointer) {
 
+    // When old length is 0 and the pointer is not NULL, then consider this pointer stale and reset it to NULL.
+    if (!length_old && *pointer) {
+      *pointer = 0;
+    }
+
     if (*pointer) {
       if (length_new) {
         void * const new_pointer = realloc(*pointer, type_size * length_new);
@@ -119,15 +127,16 @@ extern "C" {
   f_status_t private_f_memory_structure_resize(const size_t length_new, const size_t type_size, void ** const structure, f_array_length_t * const used, f_array_length_t * const size) {
 
     const f_status_t status = private_f_memory_resize(*size, length_new, type_size, structure);
-    if (F_status_is_error(status)) return status;
 
-    *size = length_new;
+    if (F_status_is_error_not(status)) {
+      *size = length_new;
 
-    if (*used > *size) {
-      *used = *size;
+      if (*used > *size) {
+        *used = *size;
+      }
     }
 
-    return F_none;
+    return status;
   }
 #endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
 
index d3afb00ee52900be1640498dc21de3b4c79c109e..dc55a0b3cef64e1ff6e5497c0389ceeb83db4aa5 100644 (file)
@@ -243,23 +243,6 @@ extern "C" {
   }
 #endif // _di_fll_program_parameter_additional_rip_mash_
 
-#ifndef _di_fll_program_parameter_long_print_cannot_use_with_
-  f_status_t fll_program_parameter_long_print_cannot_use_with(const fl_print_t print, const f_string_static_t first, const f_string_static_t second) {
-
-    f_file_stream_lock(print.to);
-
-    fl_print_format("%[%QCannot specify the '%]", print.to.stream, print.context, print.prefix, print.context);
-    fl_print_format("%[%r%r%]", print.to.stream, print.notable, f_console_symbol_long_enable_s, first, print.notable);
-    fl_print_format("%[' parameter with the '%]", print.to.stream, print.context, print.context);
-    fl_print_format("%[%r%r%]", print.to.stream, print.notable, f_console_symbol_long_enable_s, second, print.notable);
-    fl_print_format("%[' parameter.%]%r", print.to.stream, print.context, print.context, f_string_eol_s);
-
-    f_file_stream_unlock(print.to);
-
-    return F_none;
-  }
-#endif // _di_fll_program_parameter_long_print_cannot_use_with_
-
 #ifndef _di_fll_program_standard_set_down_
   f_status_t fll_program_standard_set_down(fll_program_data_t * const main) {
     #ifndef _di_level_2_parameter_checking_
@@ -267,19 +250,20 @@ extern "C" {
     #endif // _di_level_2_parameter_checking_
 
     // The fclose() calls have undefined behavior when closing an already closed file.
-    // Avoid this by explicitly checking every permutation to make sure each descriptor is not a duplicat descriptor.
+    // Avoid this by explicitly checking every permutation to make sure each descriptor is not a duplicate descriptor.
     // 0x1 = message stream, 0x2 = output stream, 0x4 = error stream, 0x8 = warning stream, 0x10 = debug stream.
     // 0x20 = message descriptor, 0x40 = output descriptor, 0x80 = error descriptor, 0x100 = warning descriptor, 0x200 = debug descriptor.
     uint16_t flag = 0;
 
-    if (main->message.to.id == -1) {
-      if (main->message.to.stream != 0 && main->message.to.stream != F_type_error_d && main->message.to.stream != F_type_input_d && main->message.to.stream != F_type_output_d) {
+    if (main->message.to.stream) {
+      if (main->message.to.stream != F_type_error_d && main->message.to.stream != F_type_input_d && main->message.to.stream != F_type_output_d) {
         f_file_stream_flush(main->message.to);
 
         flag |= 0x1;
       }
     }
-    else {
+
+    if (main->message.to.id == -1) {
       if (main->message.to.id != F_type_descriptor_error_d && main->message.to.id != F_type_descriptor_input_d && main->message.to.id != F_type_descriptor_output_d) {
         f_file_flush(main->message.to);
 
@@ -287,8 +271,8 @@ extern "C" {
       }
     }
 
-    if (main->output.to.id == -1) {
-      if (main->output.to.stream && main->output.to.stream != main->message.to.stream) {
+    if (main->output.to.stream) {
+      if (main->output.to.stream != main->message.to.stream) {
         if (main->output.to.stream != F_type_error_d && main->output.to.stream != F_type_input_d && main->output.to.stream != F_type_output_d) {
           f_file_stream_flush(main->output.to);
 
@@ -296,16 +280,19 @@ extern "C" {
         }
       }
     }
-    else if (main->output.to.id != main->message.to.id) {
-      if (main->output.to.id != F_type_descriptor_error_d && main->output.to.id != F_type_descriptor_input_d && main->output.to.id != F_type_descriptor_output_d) {
-        f_file_flush(main->output.to);
 
-        flag |= 0x40;
+    if (main->error.to.id != -1) {
+      if (main->output.to.id != main->message.to.id) {
+        if (main->output.to.id != F_type_descriptor_error_d && main->output.to.id != F_type_descriptor_input_d && main->output.to.id != F_type_descriptor_output_d) {
+          f_file_flush(main->output.to);
+
+          flag |= 0x40;
+        }
       }
     }
 
-    if (main->error.to.id == -1) {
-      if (main->error.to.stream && main->error.to.stream != main->message.to.stream && main->error.to.stream != main->output.to.stream) {
+    if (main->error.to.stream) {
+      if (main->error.to.stream != main->message.to.stream && main->error.to.stream != main->output.to.stream) {
         if (main->error.to.stream != F_type_error_d && main->error.to.stream != F_type_input_d && main->error.to.stream != F_type_output_d) {
           f_file_stream_flush(main->error.to);
 
@@ -313,16 +300,19 @@ extern "C" {
         }
       }
     }
-    else if (main->error.to.id != main->message.to.id && main->error.to.id != main->output.to.id) {
-      if (main->error.to.id != F_type_descriptor_error_d && main->error.to.id != F_type_descriptor_input_d && main->error.to.id != F_type_descriptor_output_d) {
-        f_file_flush(main->error.to);
 
-        flag |= 0x80;
+    if (main->error.to.id != -1) {
+      if (main->error.to.id != main->message.to.id && main->error.to.id != main->output.to.id) {
+        if (main->error.to.id != F_type_descriptor_error_d && main->error.to.id != F_type_descriptor_input_d && main->error.to.id != F_type_descriptor_output_d) {
+          f_file_flush(main->error.to);
+
+          flag |= 0x80;
+        }
       }
     }
 
-    if (main->warning.to.id == -1) {
-      if (main->warning.to.stream && main->warning.to.stream != main->message.to.stream && main->warning.to.stream != main->output.to.stream && main->warning.to.stream != main->error.to.stream) {
+    if (main->warning.to.stream) {
+      if (main->warning.to.stream != main->message.to.stream && main->warning.to.stream != main->output.to.stream && main->warning.to.stream != main->error.to.stream) {
         if (main->warning.to.stream != F_type_error_d && main->warning.to.stream != F_type_input_d && main->warning.to.stream != F_type_output_d) {
           f_file_stream_flush(main->warning.to);
 
@@ -330,17 +320,20 @@ extern "C" {
         }
       }
     }
-    else if (main->warning.to.id != main->message.to.id && main->warning.to.id != main->output.to.id && main->warning.to.id != main->error.to.id) {
-      if (main->warning.to.id != F_type_descriptor_error_d && main->warning.to.id != F_type_descriptor_input_d && main->warning.to.id != F_type_descriptor_output_d) {
-        f_file_flush(main->warning.to);
 
-        flag |= 0x100;
+    if (main->warning.to.id != -1) {
+      if (main->warning.to.id != main->message.to.id && main->warning.to.id != main->output.to.id && main->warning.to.id != main->error.to.id) {
+        if (main->warning.to.id != F_type_descriptor_error_d && main->warning.to.id != F_type_descriptor_input_d && main->warning.to.id != F_type_descriptor_output_d) {
+          f_file_flush(main->warning.to);
+
+          flag |= 0x100;
+        }
       }
     }
 
 
-    if (main->debug.to.id == -1) {
-      if (main->debug.to.stream && main->debug.to.stream != main->message.to.stream && main->debug.to.stream != main->output.to.stream && main->debug.to.stream != main->error.to.stream && main->debug.to.stream != main->warning.to.stream) {
+    if (main->debug.to.stream) {
+      if (main->debug.to.stream != main->message.to.stream && main->debug.to.stream != main->output.to.stream && main->debug.to.stream != main->error.to.stream && main->debug.to.stream != main->warning.to.stream) {
         if (main->debug.to.stream != F_type_error_d && main->debug.to.stream != F_type_input_d && main->debug.to.stream != F_type_output_d) {
           f_file_stream_flush(main->debug.to);
 
@@ -348,11 +341,14 @@ extern "C" {
         }
       }
     }
-    else if (main->debug.to.id != main->message.to.id && main->debug.to.id != main->output.to.id && main->debug.to.id != main->error.to.id && main->debug.to.id != main->warning.to.id) {
-      if (main->debug.to.id != F_type_descriptor_error_d && main->debug.to.id != F_type_descriptor_input_d && main->debug.to.id != F_type_descriptor_output_d) {
-        f_file_flush(main->debug.to);
 
-        flag |= 0x200;
+    if (main->debug.to.id != -1) {
+      if (main->debug.to.id != main->message.to.id && main->debug.to.id != main->output.to.id && main->debug.to.id != main->error.to.id && main->debug.to.id != main->warning.to.id) {
+        if (main->debug.to.id != F_type_descriptor_error_d && main->debug.to.id != F_type_descriptor_input_d && main->debug.to.id != F_type_descriptor_output_d) {
+          f_file_flush(main->debug.to);
+
+          flag |= 0x200;
+        }
       }
     }
 
index ccda4f8e8225d0f7745b74b904d439ce8a650488..c53f57a80fd8dd4c0b1708e05060692a77fe0009 100644 (file)
@@ -248,25 +248,6 @@ extern "C" {
 #endif // _di_fll_program_parameter_additional_rip_mash_
 
 /**
- * Print message about two long parameters not being allowed to be used together.
- *
- * This assumes both of the long parameters use f_console_symbol_long_enable_s.
- *
- * @param print
- *   The output structure.
- * @param first
- *   The first string.
- * @param second
- *   The second string.
- *
- * @return
- *   F_none on success.
- */
-#ifndef _di_fll_program_parameter_long_print_cannot_use_with_
-  extern f_status_t fll_program_parameter_long_print_cannot_use_with(const fl_print_t print, const f_string_static_t first, const f_string_static_t second);
-#endif // _di_fll_program_parameter_long_print_cannot_use_with_
-
-/**
  * This provides a standard program set down operations used by FLL programs.
  *
  * This does the following:
index 283a6696cf983a2ef04c182e32a6adc913035e11..a0a6a8ad427b66555375644268dd142eb4f555f8 100644 (file)
@@ -84,7 +84,7 @@ extern "C" {
     int child;
     uint8_t pipe;
 
-    int signal_received;
+    uint32_t signal_received;
     uint16_t signal_check;
     f_signal_t signal;
 
index 285cebb9248493bf4bb743f3eb71e87f44e0bd5e..5dfee1a88d985cd9e8fcd73123a2c4ffbadf4c78 100644 (file)
@@ -5,6 +5,157 @@
 extern "C" {
 #endif
 
+#ifndef _di_fll_program_print_error_missing_variable_not_zero_
+  f_status_t fll_program_print_error_missing_variable_not_zero(const fl_print_t print, const f_string_static_t variable) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QThe %]", print.to.stream, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%]", print.to.stream, print.set->notable, variable, print.set->notable);
+    fl_print_format("%[ is missing or has a length of %]", print.to.stream, print.set->error, print.set->error);
+    fl_print_format("%[0%]", print.to.stream, print.set->notable, print.set->notable);
+    fl_print_format("%[.%]%r", print.to.stream, 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_missing_variable_not_zero_
+
+#ifndef _di_fll_program_print_error_parameter_both_specified_same_amount_
+  f_status_t fll_program_print_error_parameter_both_specified_same_amount(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t first, const f_string_static_t second) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QThe '%]", print.to.stream, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to.stream, print.set->notable, symbol, first, print.set->notable);
+    fl_print_format("%[' parameter and the '%]", print.to.stream, print.set->error, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to.stream, print.set->notable, symbol, second, print.set->notable);
+    fl_print_format("%[' parameter must be specified the same number of times.%]%r", print.to.stream, 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_both_specified_same_amount_
+
+#ifndef _di_fll_program_print_error_parameter_cannot_use_with_
+  f_status_t fll_program_print_error_parameter_cannot_use_with(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t first, const f_string_static_t second) {
+
+    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.stream, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to.stream, print.set->notable, symbol, first, print.set->notable);
+    fl_print_format("%[' parameter with the '%]", print.to.stream, print.set->error, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to.stream, print.set->notable, symbol, second, print.set->notable);
+    fl_print_format("%[' parameter.%]%r", print.to.stream, 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_
+
+#ifndef _di_fll_program_print_error_parameter_missing_value_
+  f_status_t fll_program_print_error_parameter_missing_value(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);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_fll_program_print_error_parameter_missing_value_
+
+#ifndef _di_fll_program_print_error_parameter_must_specify_once_
+  f_status_t fll_program_print_error_parameter_must_specify_once(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("%[%QThe parameter '%]", print.to.stream, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to.stream, print.set->notable, symbol, parameter, print.set->notable);
+    fl_print_format("%[' may only be specified once.%]%r", print.to.stream, 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_must_specify_once_
+
+#ifndef _di_fll_program_print_error_parameter_must_specify_once_value_
+  f_status_t fll_program_print_error_parameter_must_specify_once_value(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter, const f_string_static_t value) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QThe value '%]", print.to.stream, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to.stream, print.set->notable, symbol, value, print.set->notable);
+    fl_print_format("%[' may only be specified once for the parameter '%]", print.to.stream, print.set->error, print.set->error);
+    fl_print_format("%[%Q%Q%]", print.to.stream, print.set->notable, symbol, parameter, print.set->notable);
+    fl_print_format("%['.%]%r", print.to.stream, 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_must_specify_once_value_
+
+#ifndef _di_fll_program_print_error_pipe_invalid_form_feed_
+  f_status_t fll_program_print_error_pipe_invalid_form_feed(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("%[%QThe pipe has incorrectly placed form-feed characters (\\f).%]%r", print.to.stream, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_fll_program_print_error_pipe_invalid_form_feed_
+
+#ifndef _di_fll_program_print_error_pipe_missing_content_
+  f_status_t fll_program_print_error_pipe_missing_content(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("%[%QThe pipe has no content.%]%r", print.to.stream, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_fll_program_print_error_pipe_missing_content_
+
+#ifndef _di_fll_program_print_error_pipe_object_without_content_
+  f_status_t fll_program_print_error_pipe_object_without_content(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("%[%QThe pipe has an Object without Content.%]%r", print.to.stream, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_fll_program_print_error_pipe_object_without_content_
+
 #ifndef _di_fll_program_print_help_header_
   f_status_t fll_program_print_help_header(const fl_print_t print, const f_string_static_t name, const f_string_static_t version) {
 
@@ -65,7 +216,7 @@ extern "C" {
 #ifndef _di_fll_program_print_help_usage_
   f_status_t fll_program_print_help_usage(const fl_print_t print, const f_string_static_t name, const f_string_static_t parameters) {
 
-    fl_print_format("%r%r %[Usage:%]%r", print.to.stream, f_string_eol_s, f_string_eol_s, print.set->important, print.set->important, f_string_eol_s);
+    fl_print_format(" %[Usage:%]%r", print.to.stream, print.set->important, print.set->important, f_string_eol_s);
 
     fl_print_format("  %[%Q%]", print.to.stream, print.set->standout, name, print.set->standout);
     fl_print_format(" %[[%] options %[]%]", print.to.stream, print.set->notable, print.set->notable, print.set->notable, print.set->notable);
@@ -81,22 +232,22 @@ extern "C" {
 #endif // _di_fll_program_print_help_usage_
 
 #ifndef _di_fll_program_print_signal_received_
-  f_status_t fll_program_print_signal_received(const fl_print_t print, const f_string_static_t line_first, const f_status_t signal) {
+  f_status_t fll_program_print_signal_received(const fl_print_t print, const f_string_static_t line_first, const uint32_t signal) {
 
     if (print.verbosity != f_console_verbosity_verbose_e && print.verbosity != f_console_verbosity_debug_e) {
       return F_output_not;
     }
 
-    flockfile(print.to.stream);
+    f_file_stream_lock(print.to);
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     f_file_stream_flush(print.to);
 
     fl_print_format("%]%r%[Received signal code %]", print.to.stream, print.set->reset, line_first, print.set->warning, print.set->warning);
-    fl_print_format("%[%i%]", print.to.stream, print.set->notable, signal, print.set->notable);
+    fl_print_format("%[%u%]", print.to.stream, print.set->notable, signal, print.set->notable);
     fl_print_format("%[.%]%r", print.to.stream, print.set->warning, print.set->warning, f_string_eol_s);
 
-    funlockfile(print.to.stream);
+    f_file_stream_unlock(print.to);
 
     return F_none;
   }
index 7568fb9ac9bf24e5e38894d417369983a76ca317..4030de75850df3c2b37501a4fda3014ffdd2e8b9 100644 (file)
@@ -17,12 +17,249 @@ extern "C" {
 #endif
 
 /**
+ * Print an error message a variable not being defined or the variable has a length is 0.
+ *
+ * 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 variable
+ *   The name of the variable that is not defined or has a length of 0.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_missing_variable_not_zero_
+  extern f_status_t fll_program_print_error_missing_variable_not_zero(const fl_print_t print, const f_string_static_t variable);
+#endif // _di_fll_program_print_error_missing_variable_not_zero_
+
+/**
+ * Print an error message about two parameters being required to be specified the same number of times.
+ *
+ * This is only printed when verbosity is not set to quiet.
+ *
+ * This uses the following:
+ *   - print.set->error: For the error context.
+ *   - print.set->strong: For the highlighting context
+ *   - print.prefix: For the prefixing a string to the message (such as "ERROR:").
+ *
+ * @param print
+ *   The output structure.
+ *   This locks, uses, and unlocks the file stream.
+ * @param symbol
+ *   The symbol string prepended to both parameters.
+ *   This is usually f_console_symbol_long_enable_s.
+ * @param first
+ *   The first parameter name.
+ * @param second
+ *   The second parameter name.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_parameter_both_specified_same_amount_
+  extern f_status_t fll_program_print_error_parameter_both_specified_same_amount(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t first, const f_string_static_t second);
+#endif // _di_fll_program_print_error_parameter_both_specified_same_amount_
+
+/**
+ * Print message about two parameters not being allowed to be used together.
+ *
+ * This is only printed when verbosity is not set to quiet.
+ *
+ * This uses the following:
+ *   - print.set->error: For the error context.
+ *   - print.set->strong: For the highlighting context
+ *   - print.prefix: For the prefixing a string to the message (such as "ERROR:").
+ *
+ * @param print
+ *   The output structure.
+ *   This locks, uses, and unlocks the file stream.
+ * @param symbol
+ *   The symbol string prepended to both parameters.
+ *   This is usually f_console_symbol_long_enable_s.
+ * @param first
+ *   The first parameter name.
+ * @param second
+ *   The second 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_
+  extern f_status_t fll_program_print_error_parameter_cannot_use_with(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t first, const f_string_static_t second);
+#endif // _di_fll_program_print_error_parameter_cannot_use_with_
+
+/**
+ * Print message about parameter not have the required value associated with this.
+ *
+ * This is only printed when verbosity is not set to quiet.
+ *
+ * This uses the following:
+ *   - print.set->error: For the error context.
+ *   - print.set->strong: For the highlighting context
+ *   - print.prefix: For the prefixing a string to the message (such as "ERROR:").
+ *
+ * @param print
+ *   The output structure.
+ *   This locks, uses, and unlocks the file stream.
+ * @param symbol
+ *   The symbol string prepended to both parameters.
+ *   This locks, uses, and unlocks the file stream.
+ *   This is usually f_console_symbol_long_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_missing_value_
+  f_status_t fll_program_print_error_parameter_missing_value(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter);
+#endif // _di_fll_program_print_error_parameter_missing_value_
+
+/**
+ * Print message about parameter only being allowed to be used once.
+ *
+ * This is only printed when verbosity is not set to quiet.
+ *
+ * This uses the following:
+ *   - print.set->error: For the error context.
+ *   - print.set->strong: For the highlighting context
+ *   - print.prefix: For the prefixing a string to the message (such as "ERROR:").
+ *
+ * @param print
+ *   The output structure.
+ *   This locks, uses, and unlocks the file stream.
+ * @param symbol
+ *   The symbol string prepended to both parameters.
+ *   This locks, uses, and unlocks the file stream.
+ *   This is usually f_console_symbol_long_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_must_specify_once_
+  extern f_status_t fll_program_print_error_parameter_must_specify_once(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter);
+#endif // _di_fll_program_print_error_parameter_must_specify_once_
+
+/**
+ * Print message about a specific value only being allowed to be used once for the 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
+ *   The symbol string prepended to both parameters.
+ *   This locks, uses, and unlocks the file stream.
+ *   This is usually f_console_symbol_long_enable_s.
+ * @param parameter
+ *   The parameter name.
+ * @param value
+ *   The value.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_parameter_must_specify_once_value_
+  extern f_status_t fll_program_print_error_parameter_must_specify_once_value(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter, const f_string_static_t value);
+#endif // _di_fll_program_print_error_parameter_must_specify_once_value_
+
+/**
+ * Print a message about the pipe having an invalid form-feed character '\f' (U+000C).
+ *
+ * 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.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_pipe_invalid_form_feed_
+  extern f_status_t fll_program_print_error_pipe_invalid_form_feed(const fl_print_t print);
+#endif // _di_fll_program_print_error_pipe_invalid_form_feed_
+
+/**
+ * Print a message about the pipe not having any content.
+ *
+ * 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.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_pipe_missing_content_
+  extern f_status_t fll_program_print_error_pipe_missing_content(const fl_print_t print);
+#endif // _di_fll_program_print_error_pipe_missing_content_
+
+/**
+ * Print a message about the pipe having an Object without Content.
+ *
+ * This generally refers to an FSS Object and an FSS Content.
+ *
+ * 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.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_pipe_object_without_content_
+  extern f_status_t fll_program_print_error_pipe_object_without_content(const fl_print_t print);
+#endif // _di_fll_program_print_error_pipe_object_without_content_
+
+/**
  * Print standard help header.
  *
  * This print function does not use locking, be sure something like flockfile() and funlockfile() are appropriately called.
  *
  * @param print
  *   The output structure to print to.
+ *   This uses but does not lock or unlock file stream.
  *   This requires print.set to be non-NULL.
  * @param name
  *   The name of the program.
@@ -31,6 +268,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see f_print_terminated()
  * @see fl_print_format()
@@ -46,6 +284,7 @@ extern "C" {
  *
  * @param print
  *   The output structure to print to.
+ *   This uses but does not lock or unlock file stream.
  *   This requires print.set to be non-NULL.
  * @param option_short
  *   The short name of the option.
@@ -60,6 +299,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see f_print_terminated()
  * @see fl_print_format()
@@ -75,6 +315,7 @@ extern "C" {
  *
  * @param print
  *   The output structure to print to.
+ *   This uses but does not lock or unlock file stream.
  *   This requires print.set to be non-NULL.
  * @param option_long
  *   The long name of the option.
@@ -85,6 +326,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see f_print_terminated()
  * @see fl_print_format()
@@ -100,6 +342,7 @@ extern "C" {
  *
  * @param print
  *   The output structure to print to.
+ *   This uses but does not lock or unlock file stream.
  *   This requires print.set to be non-NULL.
  * @param option_other
  *   The other name of the option.
@@ -108,6 +351,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see f_print_terminated()
  * @see fl_print_format()
@@ -122,13 +366,15 @@ extern "C" {
  * This print function does not use locking, be sure something like flockfile() and funlockfile() are appropriately called.
  *
  * @param print
- *   The output structure to print to.
+ *   The output structure to print to
+ *   This uses but does not lock or unlock file stream.
  *   This requires print.set to be non-NULL.
  * @param context
  *   The color context.
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see f_print_terminated()
  * @see fl_print_format()
@@ -144,6 +390,7 @@ extern "C" {
  *
  * @param print
  *   The output structure to print to.
+ *   This uses but does not lock or unlock file stream.
  *   This requires print.set to be non-NULL.
  * @param name
  *   The name of the program.
@@ -154,6 +401,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see f_print_terminated()
  * @see fl_print_format()
@@ -169,6 +417,7 @@ extern "C" {
  *
  * @param print
  *   The output structure to print to.
+ *   This locks, uses, and unlocks the file stream.
  *   This requires print.set to be non-NULL.
  * @param line_first
  *   The first line character, which is expected to be set to either f_string_eol_s or f_string_empty_s.
@@ -180,22 +429,22 @@ extern "C" {
  *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_fll_program_print_signal_received_
-  extern f_status_t fll_program_print_signal_received(const fl_print_t print, const f_string_static_t line_first, const f_status_t signal);
+  extern f_status_t fll_program_print_signal_received(const fl_print_t print, const f_string_static_t line_first, const uint32_t signal);
 #endif // _di_fll_program_print_signal_received_
 
 /**
  * Print the program version.
  *
- * This print function does not use locking, be sure something like flockfile() and funlockfile() are appropriately called.
- *
  * @param print
  *   The output structure to print to.
+ *   This uses but does not lock or unlock file stream.
  *   This requires print.set to be non-NULL.
  * @param version
  *   The version number of the program.
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see fl_print_format()
  */
index f23e81163861517d6cc0c9ccd2b026a54894beff..76ed28069402d682f5177e5fd92ba8c90974f416 100644 (file)
@@ -154,13 +154,13 @@ extern "C" {
 
     if (main->parameters.remaining.used || (main->pipe & fll_program_data_pipe_input_e)) {
       if (main->parameters.array[byte_dump_parameter_width_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_width_s, main->context.set.notable);
         fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         return F_status_set_error(F_parameter);
       }
@@ -172,7 +172,7 @@ extern "C" {
         status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data.argv[index], &number);
 
         if (F_status_is_error(status) || number < 1 || number >= 0xfb) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_width_s, main->context.set.notable);
@@ -182,7 +182,7 @@ extern "C" {
           fl_print_format("%[250%]", main->error.to.stream, main->context.set.notable, main->context.set.notable);
           fl_print_format("%[.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           if (F_status_is_error(status)) return status;
 
@@ -193,13 +193,13 @@ extern "C" {
       }
 
       if (main->parameters.array[byte_dump_parameter_first_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
         fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         return F_status_set_error(F_parameter);
       }
@@ -211,7 +211,7 @@ extern "C" {
         status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data.argv[index], &number);
 
         if (F_status_is_error(status) || number > F_number_t_size_unsigned_d) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
@@ -221,7 +221,7 @@ extern "C" {
           fl_print_format("%[%un%]", main->error.to.stream, main->context.set.notable, F_number_t_size_unsigned_d, main->context.set.notable);
           fl_print_format("%[.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           if (F_status_is_error(status)) return status;
 
@@ -232,13 +232,13 @@ extern "C" {
       }
 
       if (main->parameters.array[byte_dump_parameter_last_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
         fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         return F_status_set_error(F_parameter);
       }
@@ -250,7 +250,7 @@ extern "C" {
         status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data.argv[index], &number);
 
         if (F_status_is_error(status) || number < 0 || number > F_number_t_size_unsigned_d) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
@@ -260,7 +260,7 @@ extern "C" {
           fl_print_format("%[%un%]", main->error.to.stream, main->context.set.notable, F_number_t_size_unsigned_d, main->context.set.notable);
           fl_print_format("%[.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           if (F_status_is_error(status)) return status;
 
@@ -272,7 +272,7 @@ extern "C" {
 
       if (main->parameters.array[byte_dump_parameter_first_e].result == f_console_result_additional_e && main->parameters.array[byte_dump_parameter_last_e].result == f_console_result_additional_e) {
         if (data.first > data.last) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
@@ -280,7 +280,7 @@ extern "C" {
           fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
           fl_print_format("%[' value.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           return F_status_set_error(F_parameter);
         }
@@ -406,13 +406,13 @@ extern "C" {
 
               // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
               if (main->output.verbosity != f_console_verbosity_quiet_e) {
-                fflush(main->output.to.stream);
+                f_file_stream_flush(main->output.to);
 
                 fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
               }
             }
             else {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_error_file_print(main->error, F_status_set_fine(status), "byte_dump_file", F_true, data.argv[main->parameters.remaining.array[counter]], f_file_operation_process_s, fll_error_file_type_file_e);
               }
             }
index 53e56aa2ea5ad4f8bf54c373770615d2ebd45046..34dc117f7903ed00c5caa6d904ebd5108f6cb6cf 100644 (file)
@@ -150,261 +150,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { byte_dump_parameter_from_bytesequence_e, byte_dump_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          byte_dump_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == byte_dump_parameter_from_bytesequence_e) {
-          if (setting->mode & byte_dump_mode_from_codepoint_e) {
-            setting->mode -= byte_dump_mode_from_codepoint_e;
-          }
-
-          setting->mode |= byte_dump_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == byte_dump_parameter_from_codepoint_e) {
-          if (setting->mode & byte_dump_mode_from_bytesequence_e) {
-            setting->mode -= byte_dump_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= byte_dump_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { byte_dump_parameter_to_bytesequence_e, byte_dump_parameter_to_codepoint_e, byte_dump_parameter_to_combining_e, byte_dump_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          byte_dump_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == byte_dump_parameter_to_bytesequence_e) {
-          if (setting->mode & byte_dump_mode_to_codepoint_e) {
-            setting->mode -= byte_dump_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & byte_dump_mode_to_combining_e) {
-            setting->mode -= byte_dump_mode_to_combining_e;
-          }
-
-          if (setting->mode & byte_dump_mode_to_width_e) {
-            setting->mode -= byte_dump_mode_to_width_e;
-          }
-
-          setting->mode |= byte_dump_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == byte_dump_parameter_to_codepoint_e) {
-          if (setting->mode & byte_dump_mode_to_bytesequence_e) {
-            setting->mode -= byte_dump_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & byte_dump_mode_to_combining_e) {
-            setting->mode -= byte_dump_mode_to_combining_e;
-          }
-
-          if (setting->mode & byte_dump_mode_to_width_e) {
-            setting->mode -= byte_dump_mode_to_width_e;
-          }
-
-          setting->mode |= byte_dump_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == byte_dump_parameter_to_combining_e) {
-          if (setting->mode & byte_dump_mode_to_bytesequence_e) {
-            setting->mode -= byte_dump_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & byte_dump_mode_to_codepoint_e) {
-            setting->mode -= byte_dump_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[byte_dump_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= byte_dump_mode_to_width_e;
-          }
-
-          setting->mode |= byte_dump_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == byte_dump_parameter_to_width_e) {
-          if (setting->mode & byte_dump_mode_to_bytesequence_e) {
-            setting->mode -= byte_dump_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & byte_dump_mode_to_codepoint_e) {
-            setting->mode -= byte_dump_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[byte_dump_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= byte_dump_mode_to_combining_e;
-          }
-
-          setting->mode |= byte_dump_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[byte_dump_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[byte_dump_parameter_to_file_e].values.used > 1) {
-        byte_dump_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[byte_dump_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[byte_dump_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[byte_dump_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[byte_dump_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= byte_dump_main_flag_file_to_e;
-      }
-      else {
-        byte_dump_print_error_parameter_file_name_empty(main, setting, main->parameters.array[byte_dump_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[byte_dump_parameter_to_file_e].result == f_console_result_found_e) {
-      byte_dump_print_error_no_value(main, setting, byte_dump_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & byte_dump_main_flag_file_to_e) {
-        setting->flag -= byte_dump_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[byte_dump_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[byte_dump_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[byte_dump_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[byte_dump_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            byte_dump_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          byte_dump_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= byte_dump_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[byte_dump_parameter_from_file_e].result == f_console_result_found_e) {
-      byte_dump_print_error_no_value(main, setting, byte_dump_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & byte_dump_main_flag_file_from_e) {
-        setting->flag -= byte_dump_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[byte_dump_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      byte_dump_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & byte_dump_mode_to_bytesequence_e)) {
-      if (main->parameters.array[byte_dump_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[byte_dump_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = byte_dump_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[byte_dump_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= byte_dump_main_flag_header_e;
-    }
-
-    if (main->parameters.array[byte_dump_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= byte_dump_main_flag_separate_e;
-    }
-
     if (main->parameters.array[byte_dump_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= byte_dump_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_byte_dump_setting_load_
 
index d72dac89501db257e2ec70b9a2702f1ac871146d..d41f09d0a831efb5d43d2f8394522e6ba2f1c593 100644 (file)
@@ -314,7 +314,7 @@ extern "C" {
     fflush(data->main->output.to.stream);
 
     if (found_invalid_utf) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%[Invalid UTF-8 codes were detected for file '%]", data->main->error.to.stream, data->main->context.set.error, data->main->context.set.error);
@@ -326,7 +326,7 @@ extern "C" {
     }
 
     if (ferror(file.stream)) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%[%Qread() failed for '%]", data->main->error.to.stream, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
index 550fde8b9fa41022716ed56f84e6fd78479644ee..6a57dda44de677b61a64b1775a00f95a9b14f085 100644 (file)
@@ -253,261 +253,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { control_parameter_from_bytesequence_e, control_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          control_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == control_parameter_from_bytesequence_e) {
-          if (setting->mode & control_mode_from_codepoint_e) {
-            setting->mode -= control_mode_from_codepoint_e;
-          }
-
-          setting->mode |= control_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == control_parameter_from_codepoint_e) {
-          if (setting->mode & control_mode_from_bytesequence_e) {
-            setting->mode -= control_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= control_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { control_parameter_to_bytesequence_e, control_parameter_to_codepoint_e, control_parameter_to_combining_e, control_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          control_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == control_parameter_to_bytesequence_e) {
-          if (setting->mode & control_mode_to_codepoint_e) {
-            setting->mode -= control_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & control_mode_to_combining_e) {
-            setting->mode -= control_mode_to_combining_e;
-          }
-
-          if (setting->mode & control_mode_to_width_e) {
-            setting->mode -= control_mode_to_width_e;
-          }
-
-          setting->mode |= control_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == control_parameter_to_codepoint_e) {
-          if (setting->mode & control_mode_to_bytesequence_e) {
-            setting->mode -= control_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & control_mode_to_combining_e) {
-            setting->mode -= control_mode_to_combining_e;
-          }
-
-          if (setting->mode & control_mode_to_width_e) {
-            setting->mode -= control_mode_to_width_e;
-          }
-
-          setting->mode |= control_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == control_parameter_to_combining_e) {
-          if (setting->mode & control_mode_to_bytesequence_e) {
-            setting->mode -= control_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & control_mode_to_codepoint_e) {
-            setting->mode -= control_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[control_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= control_mode_to_width_e;
-          }
-
-          setting->mode |= control_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == control_parameter_to_width_e) {
-          if (setting->mode & control_mode_to_bytesequence_e) {
-            setting->mode -= control_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & control_mode_to_codepoint_e) {
-            setting->mode -= control_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[control_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= control_mode_to_combining_e;
-          }
-
-          setting->mode |= control_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[control_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[control_parameter_to_file_e].values.used > 1) {
-        control_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[control_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[control_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[control_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[control_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= control_main_flag_file_to_e;
-      }
-      else {
-        control_print_error_parameter_file_name_empty(main, setting, main->parameters.array[control_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[control_parameter_to_file_e].result == f_console_result_found_e) {
-      control_print_error_no_value(main, setting, control_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & control_main_flag_file_to_e) {
-        setting->flag -= control_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[control_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[control_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[control_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[control_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            control_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          control_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= control_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[control_parameter_from_file_e].result == f_console_result_found_e) {
-      control_print_error_no_value(main, setting, control_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & control_main_flag_file_from_e) {
-        setting->flag -= control_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[control_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      control_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & control_mode_to_bytesequence_e)) {
-      if (main->parameters.array[control_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[control_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = control_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[control_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= control_main_flag_header_e;
-    }
-
-    if (main->parameters.array[control_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= control_main_flag_separate_e;
-    }
-
     if (main->parameters.array[control_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= control_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_control_setting_load_
 
index 4c2864b2aaba1f3a0a8d0faf10f04d21d3871e35..c14e04ad317e54f0ef49a165291fb74a74368cac 100644 (file)
@@ -199,7 +199,7 @@ extern "C" {
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
     if (main->output.verbosity != f_console_verbosity_quiet_e) {
       if (F_status_is_error(status)) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
         fflush(main->error.to.stream);
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
index 3b6d494b20f48cca39d9d5978d1d1bd225b68869..03850043a0bf67f206e1b7dbd03293b23cafd2d5 100644 (file)
@@ -733,7 +733,7 @@ extern "C" {
         if (F_status_is_error(status)) {
           fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, data->cache.small, f_file_operation_find_s, fll_error_file_type_directory_e);
 
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->error.to.stream);
           }
         }
@@ -802,7 +802,7 @@ extern "C" {
               if (F_status_is_error(status)) {
                 fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, data->cache.small, f_file_operation_find_s, fll_error_file_type_directory_e);
 
-                if (main->error.verbosity != f_console_verbosity_quiet_e) {
+                if (main->error.verbosity > f_console_verbosity_quiet_e) {
                   fll_print_dynamic_raw(f_string_eol_s, main->error.to.stream);
                 }
               }
index 8fdfaefa6a651a536cd2311d435916cdcc133a73..5ec604f2956fd399063f768941d61c12440d6a21 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
     if (header.status == F_failure) {
       if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-      flockfile(main->error.to.stream);
+      f_file_stream_lock(main->error.to);
 
       fl_print_format("%r%[%QThe action '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
       fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, control_action_type_name(header.action), main->context.set.notable);
@@ -29,7 +29,7 @@ extern "C" {
         fl_print_format("%[).%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
       }
 
-      funlockfile(main->error.to.stream);
+      f_file_stream_unlock(main->error.to);
 
       return;
     }
@@ -120,7 +120,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QReceived error response for " CONTROL_action_s " '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%q%]", main->error.to.stream, main->context.set.notable, control_action_type_name(header.action), main->context.set.notable);
@@ -136,7 +136,7 @@ extern "C" {
       fl_print_format("%[).%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
     }
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_packet_response_
 
@@ -154,13 +154,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
     fl_print_format("%[' is not a known controller action.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_not_
 
@@ -169,13 +169,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
     fl_print_format("%[' a rule base name cannot be an empty string.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_basename_empty_
 
@@ -184,13 +184,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
     fl_print_format("%[' a rule directory path cannot be an empty string.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_directory_empty_
 
@@ -199,13 +199,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
     fl_print_format("%[' a rule name cannot be an empty string.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_empty_
 
@@ -214,13 +214,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
     fl_print_format("%[' requires either a full rule name or a rule directory path along with the rule base name.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_not_
 
@@ -229,13 +229,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
     fl_print_format("%[' has too few arguments.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_too_few_
 
@@ -244,7 +244,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
@@ -252,7 +252,7 @@ extern "C" {
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, with, main->context.set.notable);
     fl_print_format("%[' has too few arguments.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_too_few_with_
 
@@ -261,13 +261,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
     fl_print_format("%[' has too many arguments.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_too_many_
 
@@ -276,7 +276,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
@@ -284,7 +284,7 @@ extern "C" {
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, with, main->context.set.notable);
     fl_print_format("%[' has too many arguments.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_too_many_with_
 
@@ -293,7 +293,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe action parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, action, main->context.set.notable);
@@ -301,7 +301,7 @@ extern "C" {
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, with, main->context.set.notable);
     fl_print_format("%['.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_action_rule_with_unknown_
 
@@ -310,13 +310,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, parameter, main->context.set.notable);
     fl_print_format("%[' must not be an empty string.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_value_empty_
 
@@ -325,13 +325,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, parameter, main->context.set.notable);
     fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_parameter_value_not_
 
@@ -367,13 +367,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QFailed to connect to the socket file '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable);
     fl_print_format("%['.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_socket_file_failed_
 
@@ -382,13 +382,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe controller socket file '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable);
     fl_print_format("%[' could not be found and is required.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_socket_file_missing_
 
@@ -397,13 +397,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe controller socket file '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error);
     fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable);
     fl_print_format("%[' is not a socket file.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_control_print_error_socket_file_not_
 
index c73b693100b6d7b1c8becacfeab9cb3678691aff..07b5523f9f60bfeec5c948a6df617447579e768d 100644 (file)
@@ -685,261 +685,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { controller_parameter_from_bytesequence_e, controller_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          controller_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == controller_parameter_from_bytesequence_e) {
-          if (setting->mode & controller_mode_from_codepoint_e) {
-            setting->mode -= controller_mode_from_codepoint_e;
-          }
-
-          setting->mode |= controller_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == controller_parameter_from_codepoint_e) {
-          if (setting->mode & controller_mode_from_bytesequence_e) {
-            setting->mode -= controller_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= controller_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { controller_parameter_to_bytesequence_e, controller_parameter_to_codepoint_e, controller_parameter_to_combining_e, controller_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          controller_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == controller_parameter_to_bytesequence_e) {
-          if (setting->mode & controller_mode_to_codepoint_e) {
-            setting->mode -= controller_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & controller_mode_to_combining_e) {
-            setting->mode -= controller_mode_to_combining_e;
-          }
-
-          if (setting->mode & controller_mode_to_width_e) {
-            setting->mode -= controller_mode_to_width_e;
-          }
-
-          setting->mode |= controller_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == controller_parameter_to_codepoint_e) {
-          if (setting->mode & controller_mode_to_bytesequence_e) {
-            setting->mode -= controller_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & controller_mode_to_combining_e) {
-            setting->mode -= controller_mode_to_combining_e;
-          }
-
-          if (setting->mode & controller_mode_to_width_e) {
-            setting->mode -= controller_mode_to_width_e;
-          }
-
-          setting->mode |= controller_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == controller_parameter_to_combining_e) {
-          if (setting->mode & controller_mode_to_bytesequence_e) {
-            setting->mode -= controller_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & controller_mode_to_codepoint_e) {
-            setting->mode -= controller_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[controller_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= controller_mode_to_width_e;
-          }
-
-          setting->mode |= controller_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == controller_parameter_to_width_e) {
-          if (setting->mode & controller_mode_to_bytesequence_e) {
-            setting->mode -= controller_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & controller_mode_to_codepoint_e) {
-            setting->mode -= controller_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[controller_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= controller_mode_to_combining_e;
-          }
-
-          setting->mode |= controller_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[controller_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[controller_parameter_to_file_e].values.used > 1) {
-        controller_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[controller_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[controller_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[controller_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[controller_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= controller_main_flag_file_to_e;
-      }
-      else {
-        controller_print_error_parameter_file_name_empty(main, setting, main->parameters.array[controller_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[controller_parameter_to_file_e].result == f_console_result_found_e) {
-      controller_print_error_no_value(main, setting, controller_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & controller_main_flag_file_to_e) {
-        setting->flag -= controller_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[controller_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[controller_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[controller_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[controller_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            controller_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          controller_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= controller_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[controller_parameter_from_file_e].result == f_console_result_found_e) {
-      controller_print_error_no_value(main, setting, controller_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & controller_main_flag_file_from_e) {
-        setting->flag -= controller_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[controller_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      controller_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & controller_mode_to_bytesequence_e)) {
-      if (main->parameters.array[controller_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[controller_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = controller_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[controller_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= controller_main_flag_header_e;
-    }
-
-    if (main->parameters.array[controller_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= controller_main_flag_separate_e;
-    }
-
     if (main->parameters.array[controller_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= controller_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_controller_setting_load_
 
index 595d63f42e03fec80e8925d5a0d72f2fca552edd..5342cbd8c8d33dc0e6ca152120cad70ccdf585e6 100644 (file)
@@ -117,7 +117,7 @@ extern "C" {
     }
     else {
       if (main->parameters.array[controller_parameter_settings_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_lock_print(main->error.to, 0);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
@@ -156,7 +156,7 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[controller_parameter_pid_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_lock_print(main->error.to, 0);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
@@ -214,7 +214,7 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[controller_parameter_cgroup_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_lock_print(main->error.to, 0);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
@@ -259,7 +259,7 @@ extern "C" {
 
     if (F_status_is_error_not(status) && main->parameters.array[controller_parameter_daemon_e].result == f_console_result_found_e) {
       if (main->parameters.array[controller_parameter_validate_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_lock_print(main->error.to, 0);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
@@ -340,7 +340,7 @@ extern "C" {
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
     if (F_status_is_error(status) && main->output.verbosity != f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
       }
 
       fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
index 1570655a1a0f84ee1dc895818838bc7154fd27de..ac4568d7f5300abf9d4f41baf3b77c06332366e4 100644 (file)
@@ -100,7 +100,7 @@ extern "C" {
         return F_file_found_not;
       }
 
-      if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
         controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stream_open", F_true, path, f_file_operation_open_s, fll_error_file_type_file_e);
       }
     }
@@ -108,7 +108,7 @@ extern "C" {
       status = f_file_stream_read(file, &cache->buffer_file);
 
       if (F_status_is_error(status)) {
-        if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stream_read", F_true, path, f_file_operation_read_s, fll_error_file_type_file_e);
         }
       }
@@ -123,7 +123,7 @@ extern "C" {
       status = f_file_stat(path, F_true, &stat_file);
 
       if (F_status_is_error(status)) {
-        if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stat", F_true, path, f_file_operation_stat_s, fll_error_file_type_file_e);
         }
       }
@@ -434,7 +434,7 @@ extern "C" {
 
         // Always return immediately on memory errors.
         if (F_status_set_fine(status) == F_memory_not) {
-          if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
             controller_lock_print(global->main->error.to, global->thread);
 
             controller_print_error_file(0, global->main->error, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid, f_file_operation_create_s, fll_error_file_type_file_e);
@@ -667,7 +667,7 @@ extern "C" {
         global->thread->id_control = 0;
       }
 
-      if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
         controller_print_error(global->thread, global->main->error, F_status_set_fine(status), "f_thread_create", F_true);
       }
     }
index 36a94355bbc309141be293181478a3433fab7880..5de673eb88ee1bf87d1e66f63266bbad4b3c025f 100644 (file)
@@ -257,7 +257,7 @@ extern "C" {
       if (cache->content_actions.array[i].used < at_least || cache->content_actions.array[i].used > at_most) {
         action->status = F_status_set_error(F_parameter);
 
-        if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
           f_thread_mutex_lock(&global.thread->lock.print);
 
           flockfile(global.main->error.to.stream);
@@ -373,7 +373,7 @@ extern "C" {
                 status_action = action->status;
               }
 
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QThe %r item action must not have an empty string for a path (the first parameter).%]%r", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
               }
             }
@@ -400,7 +400,7 @@ extern "C" {
               }
               else {
                 if (fl_string_dynamic_compare(action->parameters.array[1], cache->buffer_path) == F_equal_to_not) {
-                  if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+                  if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                     flockfile(global.main->error.to.stream);
 
                     fl_print_format("%r%[%QThe %r item action second parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
@@ -427,7 +427,7 @@ extern "C" {
                 status_action = action->status;
               }
 
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QThe %r item action must not have an empty string for a rule name (the second parameter).%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
               }
             }
@@ -452,7 +452,7 @@ extern "C" {
                   }
                 }
 
-                if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+                if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                   flockfile(global.main->error.to.stream);
 
                   fl_print_format("%r%[%QThe %r item action third parameter (and beyond) must be one of '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
@@ -478,7 +478,7 @@ extern "C" {
                 status_action = action->status;
               }
 
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 flockfile(global.main->error.to.stream);
 
                 fl_print_format("%r%[%QThe %r item action may not specify the reserved item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
@@ -507,7 +507,7 @@ extern "C" {
                 status_action = action->status;
               }
 
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 flockfile(global.main->error.to.stream);
 
                 fl_print_format("%r%[%QThe %r item action must have one of '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
@@ -550,7 +550,7 @@ extern "C" {
                     break;
                   }
 
-                  if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+                  if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                     flockfile(global.main->error.to.stream);
 
                     fl_print_format("%r%[%QThe %r item action parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
@@ -574,7 +574,7 @@ extern "C" {
               else {
                 action->status = F_status_set_error(F_supported_not);
 
-                if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+                if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                   flockfile(global.main->error.to.stream);
 
                   fl_print_format("%r%[%QThe %r item action may only have '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
@@ -709,7 +709,7 @@ extern "C" {
               for (j = 2; j < cache->ats.used; j += 2) {
 
                 if (cache->ats.array[j] == i) {
-                  if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+                  if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                     controller_lock_print(global.main->error.to, global.thread);
 
                     fl_print_format("%r%[%QThe %r item named '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->error.prefix, global.main->error.context);
@@ -771,7 +771,7 @@ extern "C" {
 
           if (error_has || i >= entry->items.used) {
             if (i >= entry->items.used) {
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global.main->error.to, global.thread);
 
                 fl_print_format("%r%[%QThe %r item named '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->error.prefix, global.main->error.context);
@@ -888,7 +888,7 @@ extern "C" {
     }
 
     if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e) {
-      if (global->main->error.verbosity != f_console_verbosity_quiet_e && global->main->error.verbosity != f_console_verbosity_error_e) {
+      if ((global->main->error.verbosity > f_console_verbosity_error_e)) {
         controller_lock_print(global->main->output.to, global->thread);
 
         fl_print_format("%rProcessing %r%r item '", global->main->output.to.stream, f_string_eol_s, failsafe ? controller_entry_print_failsafe_s : f_string_empty_s, is_entry ? controller_entry_s : controller_exit_s);
@@ -925,7 +925,7 @@ extern "C" {
 
         if (F_status_is_error(entry_action->status)) {
           if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) {
-            if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
               controller_lock_print(global->main->output.to, global->thread);
 
               fl_print_format("%rThe %r item action '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
@@ -947,7 +947,7 @@ extern "C" {
             }
           }
           else {
-            if ((entry_action->code & controller_entry_rule_code_require_d) && global->main->error.verbosity != f_console_verbosity_quiet_e || !(entry_action->code & controller_entry_rule_code_require_d) && (global->main->warning.verbosity == f_console_verbosity_verbose_e || global->main->warning.verbosity == f_console_verbosity_debug_e)) {
+            if ((entry_action->code & controller_entry_rule_code_require_d) && global->main->error.verbosity > f_console_verbosity_quiet_e || !(entry_action->code & controller_entry_rule_code_require_d) && (global->main->warning.verbosity == f_console_verbosity_verbose_e || global->main->warning.verbosity == f_console_verbosity_debug_e)) {
               fl_print_t *output = 0;
 
               if (entry_action->code & controller_entry_rule_code_require_d) {
@@ -1037,7 +1037,7 @@ extern "C" {
           }
           else {
             if (!failsafe && (global->main->error.verbosity == f_console_verbosity_verbose_e || entry->show == controller_entry_show_init_e) && global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_none_e) {
-              if (global->main->error.verbosity != f_console_verbosity_quiet_e && global->main->error.verbosity != f_console_verbosity_error_e) {
+              if ((global->main->error.verbosity > f_console_verbosity_error_e)) {
                 fl_print_format("%rState is now '%[%r%]'.%r", global->main->output.to.stream, f_string_eol_s, global->main->context.set.notable, controller_ready_s, global->main->context.set.notable, f_string_eol_s);
               }
             }
@@ -1050,7 +1050,7 @@ extern "C" {
           if (entry_action->number == 0 || entry_action->number >= entry->items.used || failsafe && entry_action->number == global->setting->failsafe_item_id) {
 
             // This should not happen if the pre-process is working as intended, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors.
-            if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
               controller_lock_print(global->main->error.to, global->thread);
 
               fl_print_format("%r%[Invalid %r item index '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, is_entry ? controller_entry_s : controller_exit_s, global->main->error.context);
@@ -1233,7 +1233,7 @@ extern "C" {
             }
 
             if (F_status_is_error(status)) {
-              if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global->main->error.to, global->thread);
 
                 controller_entry_print_error_cache(is_entry, global->main->error, cache->action);
@@ -1340,7 +1340,7 @@ extern "C" {
 
           if (F_status_is_error(status)) {
             if (F_status_set_fine(status) == F_file_found_not) {
-              if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global->main->error.to, global->thread);
 
                 fl_print_format("%r%[%QExecution failed, unable to find program or script '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix, global->main->error.context);
@@ -1359,7 +1359,7 @@ extern "C" {
             return F_status_set_error(F_execute);
           }
           else if (result != 0) {
-            if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
               controller_lock_print(global->main->error.to, global->thread);
 
               fl_print_format("%r%[%QExecution failed with return value of '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix, global->main->error.context);
@@ -1415,7 +1415,7 @@ extern "C" {
             if (entry_action->number == 0 || entry_action->number >= entry->items.used) {
 
               // This should not happen if the pre-process is working as designed, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors.
-              if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global->main->error.to, global->thread);
 
                 fl_print_format("%r%[%QInvalid %r item index '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global->main->error.context);
@@ -1500,7 +1500,7 @@ extern "C" {
       }
     }
 
-    if ((global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e && global->main->error.verbosity != f_console_verbosity_quiet_e) && global->main->error.verbosity != f_console_verbosity_error_e || global->main->error.verbosity == f_console_verbosity_verbose_e) {
+    if ((global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e && global->main->error.verbosity > f_console_verbosity_quiet_e) && global->main->error.verbosity != f_console_verbosity_error_e || global->main->error.verbosity == f_console_verbosity_verbose_e) {
       controller_lock_print(global->main->output.to, global->thread);
 
       fl_print_format("%rDone processing %r item '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
@@ -1602,7 +1602,7 @@ extern "C" {
         }
       }
       else {
-        if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_lock_print(global.main->error.to, global.thread);
 
           fll_print_format("%r%[%QThe %r file is empty.%]%r", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
@@ -1771,7 +1771,7 @@ extern "C" {
           cache->action.name_item.used = 0;
 
           if (!(code & 0x1)) {
-            if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
               controller_lock_print(global.main->error.to, global.thread);
 
               fl_print_format("%r%[%QThe required %r item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
@@ -1833,7 +1833,7 @@ extern "C" {
                       break;
                     }
 
-                    if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+                    if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                       controller_lock_print(global.main->error.to, global.thread);
 
                       fl_print_format("%r%[%QThe required %r item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
@@ -2275,7 +2275,7 @@ extern "C" {
             continue;
           }
 
-          if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
             flockfile(global.main->error.to.stream);
 
             fl_print_format("%r%[%QThe %r setting '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
index ce0ee4c4e44b68512e0506913ecf7e85cf9dd9d8..fa71074ae5d2d4a799b1aa32ddd18a7c809b7b0d 100644 (file)
@@ -439,7 +439,7 @@ extern "C" {
           }
 
           if (!type_rerun) {
-            if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
               controller_lock_print(global.main->error.to, global.thread);
 
               fl_print_format("%r%[%QRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -479,7 +479,7 @@ extern "C" {
             }
           }
           else {
-            if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
               controller_lock_print(global.main->error.to, global.thread);
 
               fl_print_format("%r%[%QRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -511,7 +511,7 @@ extern "C" {
               item->reruns[type_rerun].is |= rerun_item == &item->reruns[type_rerun].failure ? controller_rule_rerun_is_failure_reset_d : controller_rule_rerun_is_success_reset_d;
             }
             else {
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global.main->error.to, global.thread);
 
                 fl_print_format("%r%[%QRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -552,7 +552,7 @@ extern "C" {
               }
             }
             else {
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global.main->error.to, global.thread);
 
                 fl_print_format("%r%[%QUnknown value '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -695,7 +695,7 @@ extern "C" {
     }
 
     if (F_status_is_error(status)) {
-      if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
         status = F_status_set_fine(status);
 
         if (status != F_valid_not && status != F_number && status != F_number_decimal && status != F_number_overflow && status != F_number_underflow && status != F_number_negative) {
@@ -1693,7 +1693,7 @@ extern "C" {
     }
 
     if (options & controller_process_option_simulate_d) {
-      if (main->error.verbosity != f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e) {
+      if (main->error.verbosity > f_console_verbosity_error_e) {
         controller_lock_print(main->error.to, thread);
 
         fl_print_format("%rSimulating execution of '%[", main->error.to.stream, f_string_eol_s, main->context.set.title);
@@ -2496,7 +2496,7 @@ extern "C" {
       if (multiple) {
         if (type == controller_rule_action_type_group_e || type == controller_rule_action_type_pid_file_e || type == controller_rule_action_type_user_e) {
 
-          if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
             controller_lock_print(global.main->error.to, global.thread);
 
             fl_print_format("%r%[%QFSS Extended List is not allowed for the rule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -2569,7 +2569,7 @@ extern "C" {
         break;
 
       default:
-        if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_lock_print(global.main->error.to, global.thread);
 
           fl_print_format("%r%[%QUnsupported action type '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -2688,7 +2688,7 @@ extern "C" {
                 }
               }
 
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global.main->error.to, global.thread);
 
                 controller_rule_item_print_error_rule_not_loaded(global.main->error, dynamics[i]->array[j]);
@@ -2989,7 +2989,7 @@ extern "C" {
         } // for
 
         if (missing) {
-          if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
             controller_lock_print(global.main->error.to, global.thread);
 
             if (process->rule.items.used) {
@@ -3138,7 +3138,7 @@ extern "C" {
       if (F_status_is_error(status)) {
         f_thread_unlock(&global.thread->lock.process);
 
-        if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_lock_print(global.main->error.to, global.thread);
 
           controller_rule_item_print_error_rule_not_loaded(global.main->error, alias_rule);
@@ -3445,7 +3445,7 @@ extern "C" {
         for (f_array_length_t i = 0; i < process->stack.used && controller_thread_is_enabled_process(process, global.thread); ++i) {
 
           if (process->stack.array[i] == id_rule) {
-            if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
               controller_lock_print(global.main->error.to, global.thread);
 
               fl_print_format("%r%[%QThe rule '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -3523,7 +3523,7 @@ extern "C" {
 
       status = F_status_set_error(F_found_not);
 
-      if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
         controller_lock_print(global.main->error.to, global.thread);
 
         controller_rule_item_print_error_rule_not_loaded(global.main->error, process->rule.alias);
@@ -4447,7 +4447,7 @@ extern "C" {
         for (j = 0; j < rule->limits.used; ++j) {
 
           if (type == rule->limits.array[j].type) {
-            if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
 
               // Get the current line number within the settings item.
               cache->action.line_item = line_item;
@@ -4636,7 +4636,7 @@ extern "C" {
           status = controller_validate_has_graph(*setting_value);
 
           if (status == F_false || F_status_set_fine(status) == F_complete_not_utf) {
-            if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
 
               // Get the current line number within the settings item.
               cache->action.line_item = line_item;
@@ -4646,7 +4646,7 @@ extern "C" {
             }
 
             if (status == F_false) {
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global.main->error.to, global.thread);
 
                 fl_print_format("%r%[%QRule setting has an invalid name '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -4781,7 +4781,7 @@ extern "C" {
             status = F_status_set_fine(status);
 
             if ((zero_only && number) || (!zero_only && (number < 1 || number > 99)) || status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_negative || status == F_number_positive) {
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
 
                 // Get the current line number within the settings item.
                 cache->action.line_item = line_item;
@@ -4860,7 +4860,7 @@ extern "C" {
           timeout_code = controller_rule_timeout_code_stop_d;
         }
         else {
-          if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
 
             // Get the current line number within the settings item.
             cache->action.line_item = line_item;
@@ -5057,7 +5057,7 @@ extern "C" {
             status = F_status_set_fine(status);
 
             if (number < -20 || number > 19 || status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_underflow || status == F_number_decimal) {
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
 
                 // Get the current line number within the settings item.
                 cache->action.line_item = line_item;
@@ -5348,7 +5348,7 @@ extern "C" {
             cache->action.line_action = ++cache->action.line_item;
 
             if (status == F_false) {
-              if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(global.main->error.to, global.thread);
 
                 fl_print_format("%r%[%QRule setting has an invalid environment variable name '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
@@ -5441,7 +5441,7 @@ extern "C" {
         action = controller_rule_action_type_thaw_e;
       }
       else {
-        if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
 
           // Get the current line number within the settings item.
           cache->action.line_item = line_item;
@@ -5492,7 +5492,7 @@ extern "C" {
           setting_values = &rule->ons.array[j].wish;
         }
         else {
-          if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
 
             // Get the current line number within the settings item.
             cache->action.line_item = line_item;
@@ -5644,7 +5644,7 @@ extern "C" {
         break;
 
       default:
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_lock_print(main->error.to, global.thread);
 
           fl_print_format("%r%[%QUnsupported action type '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
index b44898812eb4f1e284300de0117e5a5ec3e4103d..b7582b45087f828ddc3287a526814e8bf39a7175 100644 (file)
@@ -191,7 +191,7 @@ extern "C" {
     status = controller_lock_create(&thread.lock);
 
     if (F_status_is_error(status)) {
-      if (main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (main->error.verbosity > f_console_verbosity_quiet_e) {
         fll_error_print(main->error, status, "controller_lock_create", F_true);
       }
     }
@@ -210,7 +210,7 @@ extern "C" {
     if (F_status_is_error(status)) {
       thread.id_signal = 0;
 
-      if (main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (main->error.verbosity > f_console_verbosity_quiet_e) {
         controller_print_error(&thread, main->error, F_status_set_fine(status), "f_thread_create", F_true);
       }
     }
@@ -219,7 +219,7 @@ extern "C" {
         setting->ready = controller_setting_ready_done_e;
 
         if (f_file_exists(setting->path_pid, F_true) == F_true) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
             controller_lock_print(main->error.to, &thread);
 
             fl_print_format("%r%[%QThe pid file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
@@ -239,7 +239,7 @@ extern "C" {
         status = f_thread_create(0, &thread.id_entry, &controller_thread_entry, (void *) &entry);
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
             controller_print_error(&thread, main->error, F_status_set_fine(status), "f_thread_create", F_true);
           }
         }
@@ -272,7 +272,7 @@ extern "C" {
           if (F_status_is_error(status)) {
             thread.id_cleanup = 0;
 
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (main->error.verbosity > f_console_verbosity_quiet_e) {
               controller_print_error(&thread, main->error, F_status_set_fine(status), "f_thread_create", F_true);
             }
           }
index ba707b64b141900ebf01656aca849a45ef2361f1..1331d4a42e9b58f4220dd0f02bda29d34defbaf1 100644 (file)
@@ -39,7 +39,7 @@ extern "C" {
       if (main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e || main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) {
 
         if (entry->setting->entry.pid == controller_entry_pid_require_e && f_file_exists(entry->setting->path_pid, F_true) == F_true) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
             controller_lock_print(main->error.to, entry->global->thread);
 
             fl_print_format("%r%[%QThe pid file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
@@ -78,7 +78,7 @@ extern "C" {
               const f_status_t status_failsafe = controller_entry_process(entry->global, cache, F_true, F_true);
 
               if (F_status_is_error(status_failsafe)) {
-                if (main->error.verbosity != f_console_verbosity_quiet_e) {
+                if (main->error.verbosity > f_console_verbosity_quiet_e) {
                   controller_lock_print(main->error.to, entry->global->thread);
 
                   fl_print_format("%r%[%QFailed while processing requested failsafe item '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
@@ -193,7 +193,7 @@ extern "C" {
             const f_status_t status_failsafe = controller_entry_process(entry->global, cache, F_true, F_false);
 
             if (F_status_is_error(status_failsafe)) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
                 controller_lock_print(main->error.to, entry->global->thread);
 
                 fl_print_format("%r%[%QFailed while processing requested failsafe item '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
index 29f54446467c161681cad59a8e22803b68d908f3..ceb01937df8fa9f4ae0bb4cca7388357324a4c83 100644 (file)
@@ -330,7 +330,7 @@ extern "C" {
       f_status_t status = f_thread_create(0, &global->thread->id_entry, &controller_thread_exit, (void *) &entry);
 
       if (F_status_is_error(status)) {
-        if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (global->main->error.verbosity > f_console_verbosity_quiet_e) {
           controller_print_error(global->thread, global->main->error, F_status_set_fine(status), "f_thread_create", F_true);
         }
 
index 9f06812f4be988ba1ea81d679bf2f562bc3962a5..ecbf20d462f4141e496f80ac1784933a5d053a94 100644 (file)
@@ -198,261 +198,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fake_parameter_from_bytesequence_e, fake_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fake_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fake_parameter_from_bytesequence_e) {
-          if (setting->mode & fake_mode_from_codepoint_e) {
-            setting->mode -= fake_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fake_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fake_parameter_from_codepoint_e) {
-          if (setting->mode & fake_mode_from_bytesequence_e) {
-            setting->mode -= fake_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fake_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fake_parameter_to_bytesequence_e, fake_parameter_to_codepoint_e, fake_parameter_to_combining_e, fake_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fake_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fake_parameter_to_bytesequence_e) {
-          if (setting->mode & fake_mode_to_codepoint_e) {
-            setting->mode -= fake_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fake_mode_to_combining_e) {
-            setting->mode -= fake_mode_to_combining_e;
-          }
-
-          if (setting->mode & fake_mode_to_width_e) {
-            setting->mode -= fake_mode_to_width_e;
-          }
-
-          setting->mode |= fake_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fake_parameter_to_codepoint_e) {
-          if (setting->mode & fake_mode_to_bytesequence_e) {
-            setting->mode -= fake_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fake_mode_to_combining_e) {
-            setting->mode -= fake_mode_to_combining_e;
-          }
-
-          if (setting->mode & fake_mode_to_width_e) {
-            setting->mode -= fake_mode_to_width_e;
-          }
-
-          setting->mode |= fake_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fake_parameter_to_combining_e) {
-          if (setting->mode & fake_mode_to_bytesequence_e) {
-            setting->mode -= fake_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fake_mode_to_codepoint_e) {
-            setting->mode -= fake_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fake_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fake_mode_to_width_e;
-          }
-
-          setting->mode |= fake_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fake_parameter_to_width_e) {
-          if (setting->mode & fake_mode_to_bytesequence_e) {
-            setting->mode -= fake_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fake_mode_to_codepoint_e) {
-            setting->mode -= fake_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fake_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fake_mode_to_combining_e;
-          }
-
-          setting->mode |= fake_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fake_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fake_parameter_to_file_e].values.used > 1) {
-        fake_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fake_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fake_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fake_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fake_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fake_main_flag_file_to_e;
-      }
-      else {
-        fake_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fake_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fake_parameter_to_file_e].result == f_console_result_found_e) {
-      fake_print_error_no_value(main, setting, fake_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fake_main_flag_file_to_e) {
-        setting->flag -= fake_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fake_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fake_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fake_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fake_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fake_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fake_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fake_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fake_parameter_from_file_e].result == f_console_result_found_e) {
-      fake_print_error_no_value(main, setting, fake_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fake_main_flag_file_from_e) {
-        setting->flag -= fake_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fake_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fake_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fake_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fake_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fake_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fake_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fake_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fake_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fake_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fake_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fake_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fake_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fake_setting_load_
 
index 002dcf6c9d0d2a9781eacee57786322cf198b0e7..658d754db2e4ee6762c4197d228a09e166666bd5 100644 (file)
@@ -173,7 +173,7 @@ extern "C" {
       if (!(main->pipe & fll_program_data_pipe_input_e) && main->parameters.remaining.used) {
         status = F_status_set_error(F_parameter);
 
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           fll_print_format("%r%[%QYou failed to specify a valid operation.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
         }
       }
@@ -183,8 +183,8 @@ extern "C" {
       if (main->parameters.array[fake_parameter_operation_build_e].locations.used && main->parameters.array[fake_parameter_operation_make_e].locations.used) {
         status = F_status_set_error(F_parameter);
 
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, fake_other_operation_build_s, main->error.notable);
@@ -192,7 +192,7 @@ extern "C" {
           fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, fake_other_operation_make_s, main->error.notable);
           fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
       }
     }
@@ -345,28 +345,28 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, operations_name, main->error.notable);
             fl_print_format("%[' failed.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
       }
 
-      if (main->error.verbosity != f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e) {
+      if (main->error.verbosity > f_console_verbosity_error_e) {
         if (F_status_is_error_not(status) && status != F_child) {
           fll_print_format("%rAll operations complete.%r%r", main->output.to.stream, f_string_eol_s, f_string_eol_s, f_string_eol_s);
         }
       }
     }
 
-    if (F_status_is_error(status) && main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (F_status_is_error(status) && main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
       }
 
       fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
index 3faf7487c4c87321947df11ce15624c6600ea18d..715785992d10bdbde315a02f40e9499ac510d7b8 100644 (file)
@@ -43,7 +43,7 @@ extern "C" {
 
     if (environment->used + data_build->setting.environment.used > environment->size) {
       if (environment->used + data_build->setting.environment.used > f_environment_max_length) {
-        if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
           flockfile(data->main->error.to.stream);
 
           fl_print_format("%r%[%QThe values for the setting '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -579,7 +579,7 @@ extern "C" {
         } // for
 
         if (found == F_false) {
-          if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
             flockfile(data->main->error.to.stream);
 
             fl_print_format("%r%[%QThe specified mode '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -673,7 +673,7 @@ extern "C" {
 
     if (F_status_is_error(*status)) {
       if (*status == F_status_set_error(F_string_too_large)) {
-        if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
           funlockfile(data->main->error.to.stream);
 
           fl_print_format("%r%[%QA setting in the file '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -1376,7 +1376,7 @@ extern "C" {
           setting->search_shared = F_false;
         }
 
-        if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
           flockfile(data->main->error.to.stream);
 
           fl_print_format("%r%[%QThe parameters '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -1437,7 +1437,7 @@ extern "C" {
 
     if (setting->build_language == fake_build_language_type_c_e || setting->build_language == fake_build_language_type_cpp_e) {
       if (setting->build_shared == F_false && setting->build_static == F_false) {
-        if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
           flockfile(data->main->error.to.stream);
 
           fl_print_format("%r%[%QThe build settings '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
index 29e50c155bdeae92f8f5d60762903ba36ae31a68..2498bcddaef67b7f88a3fabd882ea6627bec3a75 100644 (file)
@@ -101,7 +101,7 @@ extern "C" {
           *status = f_directory_exists(destination_path);
 
           if (*status == F_false) {
-            if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
               flockfile(data->main->error.to.stream);
 
               fl_print_format("%r%[%QThe path '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
index 99f1d16f6e38a713fb002ab784bd044a1143a1ea..4a3a3a0268c35917ba0f6d5824ca649d1857c8f1 100644 (file)
@@ -451,7 +451,7 @@ extern "C" {
 
             break;
           }
-          else if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+          else if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
             fake_print_error_build_operation_file(data, F_status_set_fine(*status), "fl_directory_copy", fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
           }
 
@@ -721,7 +721,7 @@ extern "C" {
     else if (*status != F_child) {
       if (F_status_is_error(*status)) {
         if (F_status_set_fine(*status) == F_failure) {
-          if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
             flockfile(data->main->error.to.stream);
 
             fl_print_format("%r%[%QFailed to execute script: '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
index fd5bd8f50d3338f341dbfc7c54cb2e4bc4f15b36..81f8d0db2042227a6721c1469607e187abcf094e 100644 (file)
@@ -66,7 +66,7 @@ extern "C" {
       return_code = 1;
 
       if (F_status_set_fine(*status) == F_file_found_not) {
-        if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
           flockfile(data->main->error.to.stream);
 
           fl_print_format("%r%[%QFailed to find program '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -255,7 +255,7 @@ extern "C" {
                 status = f_utf_is_word_dash_plus(data->main->parameters.arguments.array[index].string + j, width_max, F_false);
 
                 if (F_status_is_error(status)) {
-                  if (fll_error_print(data->main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+                  if (fll_error_print(data->main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && data->main->error.verbosity > f_console_verbosity_quiet_e) {
                     flockfile(data->main->error.to.stream);
 
                     fl_print_format("%r%[%QFailed to process the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -269,7 +269,7 @@ extern "C" {
                 }
 
                 if (status == F_false) {
-                  if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+                  if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
                     flockfile(data->main->error.to.stream);
 
                     fl_print_format("%r%[%QThe '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -298,7 +298,7 @@ extern "C" {
 
             if (F_status_is_error(status)) {
               if (status == F_status_set_error(F_string_too_large)) {
-                if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+                if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
                   flockfile(data->main->error.to.stream);
 
                   fl_print_format("%r%[%QThe parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -319,7 +319,7 @@ extern "C" {
           }
 
           if (!data->main->parameters.arguments.array[index].used || status == F_data_not) {
-            if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
               flockfile(data->main->error.to.stream);
 
               fl_print_format("%r%[%QThe parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -413,7 +413,7 @@ extern "C" {
           status = f_path_directory_cleanup(data->main->parameters.arguments.array[index], parameters_value[i]);
 
           if (F_status_is_error(status)) {
-            if (fll_error_print(data->main->error, F_status_set_fine(status), "f_path_directory_cleanup", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (fll_error_print(data->main->error, F_status_set_fine(status), "f_path_directory_cleanup", F_false) == F_known_not && data->main->error.verbosity > f_console_verbosity_quiet_e) {
               flockfile(data->main->error.to.stream);
 
               fl_print_format("%r%[%QFailed to process parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -440,7 +440,7 @@ extern "C" {
           status = f_string_dynamic_append(parameter_defaults[i], parameters_value[i]);
 
           if (F_status_is_error(status)) {
-            if (fll_error_print(data->main->error, F_status_set_fine(status), " f_string_dynamic_append", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (fll_error_print(data->main->error, F_status_set_fine(status), " f_string_dynamic_append", F_false) == F_known_not && data->main->error.verbosity > f_console_verbosity_quiet_e) {
               flockfile(data->main->error.to.stream);
 
               fl_print_format("%r%[%QFailed to load default for the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -460,7 +460,7 @@ extern "C" {
       status = fll_program_parameter_additional_rip(data->main->parameters.arguments.array, data->main->parameters.array[fake_parameter_define_e].values, &data->define);
 
       if (F_status_is_error(status)) {
-        if (fll_error_print(data->main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (fll_error_print(data->main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && data->main->error.verbosity > f_console_verbosity_quiet_e) {
           flockfile(data->main->error.to.stream);
 
           fl_print_format("%r%[%QFailed to process the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -484,7 +484,7 @@ extern "C" {
       status = fll_program_parameter_additional_rip(data->main->parameters.arguments.array, data->main->parameters.array[fake_parameter_mode_e].values, &data->mode);
 
       if (F_status_is_error(status)) {
-        if (fll_error_print(data->main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (fll_error_print(data->main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && data->main->error.verbosity > f_console_verbosity_quiet_e) {
           flockfile(data->main->error.to.stream);
 
           fl_print_format("%r%[%QFailed to process the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -510,7 +510,7 @@ extern "C" {
           status = f_utf_is_word_dash_plus(data->mode.array[i].string + j, width_max, F_false);
 
           if (F_status_is_error(status)) {
-            if (fll_error_print(data->main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (fll_error_print(data->main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && data->main->error.verbosity > f_console_verbosity_quiet_e) {
               flockfile(data->main->error.to.stream);
 
               fl_print_format("%r%[%QFailed to process the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -524,7 +524,7 @@ extern "C" {
           }
 
           if (status == F_false) {
-            if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
               flockfile(data->main->error.to.stream);
 
               fl_print_format("%r%[%QThe '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
index d63b29ce581b11e9ff165040c264f31c634195ed..9d7aef3fa4a0588ac66ff9f6d6ddab1c0e120a8b 100644 (file)
@@ -213,7 +213,7 @@ extern "C" {
       }
 
       if (missing_main) {
-        if (data_make->main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (data_make->main->error.verbosity > f_console_verbosity_quiet_e) {
           flockfile(data_make->main->error.to.stream);
 
           fl_print_format("%r%[%QThe fakefile '%]", data_make->main->error.to.stream, f_string_eol_s, data_make->main->error.context, data_make->main->error.prefix, data_make->main->error.context);
@@ -449,7 +449,7 @@ extern "C" {
           }
         }
         else {
-          if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
             flockfile(data->main->error.to.stream);
 
             fl_print_format("%r%[%QInvalid characters in the define setting name '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
index 501f3da3343f39e7dcf838a8628a53cbf1e3c1ff..9278829de3c56dd88039a223be3fb2d0cd62dab4 100644 (file)
@@ -1389,7 +1389,7 @@ extern "C" {
     if (F_status_set_error(*status) == F_interrupt) return 0;
 
     if (i == section->objects.used && F_status_is_error_not(*status) && (state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_else_e || state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_or_e)) {
-      if (data_make->data->main->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
+      if (data_make->data->main->error.verbosity > f_console_verbosity_quiet_e && data_make->error.to.stream) {
         flockfile(data_make->error.to.stream);
 
         fl_print_format("%r%[%QIncomplete '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
index 530ac34064334755168de0bcfb501ed1a30b35ad..6e90900477e1f9d50013ebcea9f5a12365f1f1ad 100644 (file)
@@ -930,7 +930,7 @@ extern "C" {
     if (F_status_is_error(status)) {
       state_process->condition_result = fake_condition_result_error_e;
 
-      if (data_make->main->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
+      if (data_make->main->error.verbosity > f_console_verbosity_quiet_e && data_make->error.to.stream) {
         flockfile(data_make->error.to.stream);
 
         if ((i == 1 && number_left > F_number_t_size_unsigned_d) || (i > 1 && number_right > F_number_t_size_unsigned_d)) {
index 081d2095ce763cbd0a58ee9f5c846211949b772c..6ba02498670a5ef218c173e71a296bfb6f963acf 100644 (file)
@@ -59,7 +59,7 @@ extern "C" {
         }
 
         if (status == F_exist_not) {
-          if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
             flockfile(data->main->error.to.stream);
 
             fl_print_format("%r%[%QThe group name '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -81,7 +81,7 @@ extern "C" {
     }
 
     if (number > F_type_size_32_unsigned_d) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QThe number '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -110,7 +110,7 @@ extern "C" {
     const f_status_t status = f_file_mode_from_string(buffer, data->main->umask, mode, replace);
 
     if (F_status_is_error(status)) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         if (F_status_set_fine(status) == F_syntax) {
           flockfile(data->main->error.to.stream);
 
@@ -152,7 +152,7 @@ extern "C" {
         }
 
         if (status == F_exist_not) {
-          if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
             flockfile(data->main->error.to.stream);
 
             fl_print_format("%r%[%QThe user '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -174,7 +174,7 @@ extern "C" {
     }
 
     if (number > F_type_size_32_unsigned_d) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QThe number '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
index 6213226630a63d64f14a6e6ff3a9b6ac26898f0b..a5c9db8ac3f69a174fd9fe9714796043215a1633 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
   bool fake_print_error_build_operation_file(fake_data_t * const data, const f_status_t status, const char *function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) {
 
     if (status == F_file_found_not) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QFailed to find '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -26,7 +26,7 @@ extern "C" {
     }
 
     if (status == F_parameter) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QInvalid parameter when calling '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -44,7 +44,7 @@ extern "C" {
     }
 
     if (status == F_name) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QInvalid name for '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -67,7 +67,7 @@ extern "C" {
     }
 
     if (status == F_memory_not) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QUnable to allocate memory, while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
@@ -83,7 +83,7 @@ extern "C" {
     }
 
     if (status == F_number_overflow) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QOverflow while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
@@ -99,7 +99,7 @@ extern "C" {
     }
 
     if (status == F_directory) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QInvalid directory while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
@@ -115,7 +115,7 @@ extern "C" {
     }
 
     if (status == F_access_denied) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QAccess denied while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
@@ -131,7 +131,7 @@ extern "C" {
     }
 
     if (status == F_loop) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QLoop while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
@@ -147,7 +147,7 @@ extern "C" {
     }
 
     if (status == F_prohibited) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QProhibited by system while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
@@ -163,7 +163,7 @@ extern "C" {
     }
 
     if (status == F_directory_found_not) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QFailed to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
@@ -179,7 +179,7 @@ extern "C" {
     }
 
     if (status == F_failure) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QFailed to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
@@ -194,7 +194,7 @@ extern "C" {
       return F_false;
     }
 
-    if (fll_error_print(data->main->error, status, function, F_false) == F_known_not && fallback && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (fll_error_print(data->main->error, status, function, F_false) == F_known_not && fallback && data->main->error.verbosity > f_console_verbosity_quiet_e) {
       flockfile(data->main->error.to.stream);
 
       fl_print_format("%r%[UNKNOWN %Q(%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -235,7 +235,7 @@ extern "C" {
   bool fake_print_error_fss(fake_data_t * const data, const f_status_t status, const char *function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) {
 
     if (status == F_file_found_not) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QOccurred on invalid UTF-8 character at stop position (at '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -251,7 +251,7 @@ extern "C" {
     }
 
     if (status == F_complete_not_utf || status == F_complete_not_utf_eos || status == F_complete_not_utf_stop) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QOccurred on invalid UTF-8 character at %s (at '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, status == F_complete_not_utf_eos ? "end of string" : "stop point of string", data->main->error.context);
@@ -267,7 +267,7 @@ extern "C" {
     }
 
     if (status == F_complete_not_utf_stop) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QOccurred on invalid UTF-8 character at stop point of string (at '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
@@ -282,7 +282,7 @@ extern "C" {
       return F_false;
     }
 
-    if (fll_error_print(data->main->error, status, function, F_false) == F_known_not && fallback && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (fll_error_print(data->main->error, status, function, F_false) == F_known_not && fallback && data->main->error.verbosity > f_console_verbosity_quiet_e) {
       flockfile(data->main->error.to.stream);
 
       fl_print_format("%r%[UNKNOWN %Q(%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
index 28d68d2844fb7c1b7e9067a8d215d74849c382a7..8ab4e1611b211d180e75ff42f8139b6907d52884 100644 (file)
@@ -142,7 +142,7 @@ extern "C" {
     }
 
     if (status == F_false) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
         flockfile(data->main->error.to.stream);
 
         fl_print_format("%r%[%QThe path '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
index e921ce912da74422cba378e55bb4b2b8e4e1a502..759827b79d83a59942d74ec76c0d351aa3823e86 100644 (file)
@@ -186,261 +186,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { firewall_parameter_from_bytesequence_e, firewall_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          firewall_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == firewall_parameter_from_bytesequence_e) {
-          if (setting->mode & firewall_mode_from_codepoint_e) {
-            setting->mode -= firewall_mode_from_codepoint_e;
-          }
-
-          setting->mode |= firewall_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == firewall_parameter_from_codepoint_e) {
-          if (setting->mode & firewall_mode_from_bytesequence_e) {
-            setting->mode -= firewall_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= firewall_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { firewall_parameter_to_bytesequence_e, firewall_parameter_to_codepoint_e, firewall_parameter_to_combining_e, firewall_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          firewall_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == firewall_parameter_to_bytesequence_e) {
-          if (setting->mode & firewall_mode_to_codepoint_e) {
-            setting->mode -= firewall_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & firewall_mode_to_combining_e) {
-            setting->mode -= firewall_mode_to_combining_e;
-          }
-
-          if (setting->mode & firewall_mode_to_width_e) {
-            setting->mode -= firewall_mode_to_width_e;
-          }
-
-          setting->mode |= firewall_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == firewall_parameter_to_codepoint_e) {
-          if (setting->mode & firewall_mode_to_bytesequence_e) {
-            setting->mode -= firewall_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & firewall_mode_to_combining_e) {
-            setting->mode -= firewall_mode_to_combining_e;
-          }
-
-          if (setting->mode & firewall_mode_to_width_e) {
-            setting->mode -= firewall_mode_to_width_e;
-          }
-
-          setting->mode |= firewall_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == firewall_parameter_to_combining_e) {
-          if (setting->mode & firewall_mode_to_bytesequence_e) {
-            setting->mode -= firewall_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & firewall_mode_to_codepoint_e) {
-            setting->mode -= firewall_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[firewall_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= firewall_mode_to_width_e;
-          }
-
-          setting->mode |= firewall_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == firewall_parameter_to_width_e) {
-          if (setting->mode & firewall_mode_to_bytesequence_e) {
-            setting->mode -= firewall_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & firewall_mode_to_codepoint_e) {
-            setting->mode -= firewall_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[firewall_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= firewall_mode_to_combining_e;
-          }
-
-          setting->mode |= firewall_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[firewall_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[firewall_parameter_to_file_e].values.used > 1) {
-        firewall_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[firewall_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[firewall_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[firewall_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[firewall_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= firewall_main_flag_file_to_e;
-      }
-      else {
-        firewall_print_error_parameter_file_name_empty(main, setting, main->parameters.array[firewall_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[firewall_parameter_to_file_e].result == f_console_result_found_e) {
-      firewall_print_error_no_value(main, setting, firewall_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & firewall_main_flag_file_to_e) {
-        setting->flag -= firewall_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[firewall_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[firewall_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[firewall_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[firewall_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            firewall_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          firewall_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= firewall_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[firewall_parameter_from_file_e].result == f_console_result_found_e) {
-      firewall_print_error_no_value(main, setting, firewall_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & firewall_main_flag_file_from_e) {
-        setting->flag -= firewall_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[firewall_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      firewall_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & firewall_mode_to_bytesequence_e)) {
-      if (main->parameters.array[firewall_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[firewall_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = firewall_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[firewall_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= firewall_main_flag_header_e;
-    }
-
-    if (main->parameters.array[firewall_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= firewall_main_flag_separate_e;
-    }
-
     if (main->parameters.array[firewall_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= firewall_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_firewall_setting_load_
 
index ca0f6303d1fa32d8d570d3ac87d6cfe0427ab952..63bdd9bd3eb5115d2d43a9a0522b02aff7104f22 100644 (file)
@@ -203,7 +203,7 @@ extern "C" {
 
         if (show_nat) {
           fll_print_format("%[===========================%] %[NAT%] %[============================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
-          fflush(main->output.to.stream);
+          f_file_stream_flush(main->output.to);
 
           status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code);
 
@@ -217,12 +217,12 @@ extern "C" {
           }
 
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
-          fflush(main->output.to.stream);
+          f_file_stream_flush(main->output.to);
         }
 
         if (F_status_is_error_not(status) && show_mangle) {
           fll_print_format("%[==========================%] %[MANGLE%] %[==========================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
-          fflush(main->output.to.stream);
+          f_file_stream_flush(main->output.to);
 
           parameters_array[3] = firewall_show_mangle_s;
 
@@ -238,12 +238,12 @@ extern "C" {
           }
 
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
-          fflush(main->output.to.stream);
+          f_file_stream_flush(main->output.to);
         }
 
         if (F_status_is_error_not(status) && show_ports) {
           fll_print_format("%[==========================%] %[FILTER%] %[==========================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
-          fflush(main->output.to.stream);
+          f_file_stream_flush(main->output.to);
 
           parameters_array[0] = firewall_show_parameter_exact_s;
           parameters_array[1] = firewall_show_parameter_verbose_s;
@@ -263,7 +263,7 @@ extern "C" {
           }
 
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
-          fflush(main->output.to.stream);
+          f_file_stream_flush(main->output.to);
         }
 
         if (F_status_is_error(status)) {
@@ -291,7 +291,7 @@ extern "C" {
       if (F_status_is_error(status)) {
         status = F_status_set_fine(status);
 
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           if (status == F_memory_not) {
             firewall_print_error_on_allocation_failure(main->error);
           }
@@ -392,7 +392,7 @@ extern "C" {
             return status;
           }
 
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
             fll_print_format("%r%[%QFailed to perform lock request because the lock instructions are missing from: %r.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, path_file_other, main->error.context, f_string_eol_s);
           }
 
@@ -434,7 +434,7 @@ extern "C" {
             }
           }
           else {
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
+            if (main->error.verbosity > f_console_verbosity_quiet_e) {
               fll_print_format("%r%[%QFailed to perform stop request because the lock instructions are missing from: %r.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, path_file_other, main->error.context, f_string_eol_s);
             }
 
@@ -683,16 +683,16 @@ extern "C" {
       firewall_delete_local_data(&local);
     }
     else {
-      if (main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (main->error.verbosity > f_console_verbosity_quiet_e) {
         fll_print_format("%r%[%QNo command given.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
       }
 
       status = F_status_set_error(F_parameter);
     }
 
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
       }
index 0a63bd53e80a46787a17aa268af1445a675d4015..834136d3a16b77cf35bf98da07a2effe6e729516 100644 (file)
@@ -548,7 +548,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca
 
           if (F_status_is_error(status)) {
             if (F_status_set_fine(status) == F_parameter) {
-              if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
                 firewall_print_error_on_invalid_parameter(data->main->error, "f_file_open");
               }
             }
@@ -562,12 +562,12 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca
               status = F_none;
             }
             else if (F_status_set_fine(status) == F_file_open) {
-              if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QUnable to open the file '%Q'.%]%r", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, path_file, data->main->error.context, f_string_eol_s);
               }
             }
             else if (F_status_set_fine(status) == F_file_descriptor) {
-              if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QFile descriptor error while trying to open the file '%Q'.%]%r", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, path_file, data->main->error.context, f_string_eol_s);
               }
             }
@@ -588,7 +588,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca
             f_file_stream_close(&file);
 
             if (F_status_is_error(status)) {
-              if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
                 if (F_status_set_fine(status) == F_parameter) {
                   firewall_print_error_on_invalid_parameter(data->main->error, "f_file_read");
                 }
@@ -1128,7 +1128,7 @@ f_status_t firewall_buffer_rules(firewall_data_t * const data, const f_string_st
   f_status_t status = f_file_open(filename, 0, &file);
 
   if (F_status_is_error(status)) {
-    if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
       if (optional) {
         if (F_status_set_fine(status) == F_parameter) {
           firewall_print_error_on_invalid_parameter(data->main->error, "f_file_open");
@@ -1164,7 +1164,7 @@ f_status_t firewall_buffer_rules(firewall_data_t * const data, const f_string_st
   f_file_stream_close(&file);
 
   if (F_status_is_error(status)) {
-    if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_parameter) {
         firewall_print_error_on_invalid_parameter(data->main->error, "f_file_read");
       }
@@ -1204,7 +1204,7 @@ f_status_t firewall_buffer_rules(firewall_data_t * const data, const f_string_st
   if (F_status_is_error(status)) {
     status = F_status_set_fine(status);
 
-    if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
       if (status == F_parameter) {
         firewall_print_error_on_invalid_parameter_for_file(data->main->error, "fll_fss_basic_list_read", filename);
       }
index 63fb628dac1a6bf23a3165b82e8ce420656591ef..2afe8bfa74798663852e3327bbc42c1946b85902 100644 (file)
@@ -144,261 +144,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_basic_list_read_parameter_from_bytesequence_e, fss_basic_list_read_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_basic_list_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_basic_list_read_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_basic_list_read_mode_from_codepoint_e) {
-            setting->mode -= fss_basic_list_read_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_basic_list_read_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_basic_list_read_parameter_from_codepoint_e) {
-          if (setting->mode & fss_basic_list_read_mode_from_bytesequence_e) {
-            setting->mode -= fss_basic_list_read_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_basic_list_read_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_basic_list_read_parameter_to_bytesequence_e, fss_basic_list_read_parameter_to_codepoint_e, fss_basic_list_read_parameter_to_combining_e, fss_basic_list_read_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_basic_list_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_basic_list_read_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_basic_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_list_read_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_basic_list_read_mode_to_combining_e) {
-            setting->mode -= fss_basic_list_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_basic_list_read_mode_to_width_e) {
-            setting->mode -= fss_basic_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_list_read_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_basic_list_read_parameter_to_codepoint_e) {
-          if (setting->mode & fss_basic_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_list_read_mode_to_combining_e) {
-            setting->mode -= fss_basic_list_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_basic_list_read_mode_to_width_e) {
-            setting->mode -= fss_basic_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_list_read_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_basic_list_read_parameter_to_combining_e) {
-          if (setting->mode & fss_basic_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_list_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_basic_list_read_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_basic_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_list_read_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_basic_list_read_parameter_to_width_e) {
-          if (setting->mode & fss_basic_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_list_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_basic_list_read_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_basic_list_read_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_basic_list_read_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_basic_list_read_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_basic_list_read_parameter_to_file_e].values.used > 1) {
-        fss_basic_list_read_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_basic_list_read_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_basic_list_read_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_basic_list_read_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_basic_list_read_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_basic_list_read_main_flag_file_to_e;
-      }
-      else {
-        fss_basic_list_read_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_basic_list_read_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_basic_list_read_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_basic_list_read_print_error_no_value(main, setting, fss_basic_list_read_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_basic_list_read_main_flag_file_to_e) {
-        setting->flag -= fss_basic_list_read_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_basic_list_read_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_basic_list_read_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_basic_list_read_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_basic_list_read_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_basic_list_read_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_basic_list_read_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_basic_list_read_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_basic_list_read_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_basic_list_read_print_error_no_value(main, setting, fss_basic_list_read_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_basic_list_read_main_flag_file_from_e) {
-        setting->flag -= fss_basic_list_read_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_basic_list_read_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_basic_list_read_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_basic_list_read_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_basic_list_read_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_basic_list_read_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_basic_list_read_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_basic_list_read_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_basic_list_read_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_basic_list_read_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_basic_list_read_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_basic_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_basic_list_read_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_basic_list_read_setting_load_
 
index 1abbed33793da8e6793e22d36a4a6baa8dfc6b7f..dccb6efa1371df75bd613b7dc5d81ddf78fac317 100644 (file)
@@ -117,13 +117,13 @@ extern "C" {
         for (f_array_length_t i = 0; i < 6; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
             fl_print_format("%[' requires a %s.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
 
@@ -160,8 +160,8 @@ extern "C" {
         for (f_array_length_t i = 0; i < 5; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) {
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
-              fll_program_parameter_long_print_cannot_use_with(main->error, fss_basic_list_read_long_columns_s, parameter_name[i]);
+            if (main->error.verbosity > f_console_verbosity_quiet_e) {
+              fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_basic_list_read_long_columns_s, parameter_name[i]);
             }
 
             status = F_status_set_error(F_parameter);
@@ -173,15 +173,15 @@ extern "C" {
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) {
         if (main->parameters.array[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_basic_list_read_long_pipe_s, fss_basic_list_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_basic_list_read_long_pipe_s, fss_basic_list_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
         }
         else if (main->parameters.array[fss_basic_list_read_parameter_line_e].result == f_console_result_additional_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_basic_list_read_long_pipe_s, fss_basic_list_read_long_line_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_basic_list_read_long_pipe_s, fss_basic_list_read_long_line_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -213,13 +213,13 @@ extern "C" {
           length = data.argv[index].used;
 
           if (!length) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit_s, main->error.notable);
             fl_print_format("%[' must not be empty.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
 
@@ -346,13 +346,13 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_basic_list_read_parameter_select_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, main->error.notable);
         fl_print_format("%[' parameter requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
@@ -518,9 +518,9 @@ extern "C" {
       status = F_status_set_error(F_parameter);
     }
 
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
       }
index 74c033351a406dc57cd7e022cc20a9be658ed438..a97e18f1efdd488d4bfac3caea411315137d0fc6 100644 (file)
@@ -185,8 +185,8 @@ extern "C" {
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
@@ -194,15 +194,15 @@ extern "C" {
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
         }
 
         if (data->depths.array[i].depth > data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, main->error.notable);
@@ -212,7 +212,7 @@ extern "C" {
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[j].depth, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
index b3b13296b41c7f6537d695e248011dbf0d60b6fb..beb3a6f0eda9afc3d81410a78ff62e541916e2b3 100644 (file)
@@ -125,261 +125,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_basic_list_write_parameter_from_bytesequence_e, fss_basic_list_write_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_basic_list_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_basic_list_write_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_basic_list_write_mode_from_codepoint_e) {
-            setting->mode -= fss_basic_list_write_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_basic_list_write_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_basic_list_write_parameter_from_codepoint_e) {
-          if (setting->mode & fss_basic_list_write_mode_from_bytesequence_e) {
-            setting->mode -= fss_basic_list_write_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_basic_list_write_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_basic_list_write_parameter_to_bytesequence_e, fss_basic_list_write_parameter_to_codepoint_e, fss_basic_list_write_parameter_to_combining_e, fss_basic_list_write_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_basic_list_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_basic_list_write_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_basic_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_list_write_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_basic_list_write_mode_to_combining_e) {
-            setting->mode -= fss_basic_list_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_basic_list_write_mode_to_width_e) {
-            setting->mode -= fss_basic_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_list_write_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_basic_list_write_parameter_to_codepoint_e) {
-          if (setting->mode & fss_basic_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_list_write_mode_to_combining_e) {
-            setting->mode -= fss_basic_list_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_basic_list_write_mode_to_width_e) {
-            setting->mode -= fss_basic_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_list_write_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_basic_list_write_parameter_to_combining_e) {
-          if (setting->mode & fss_basic_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_list_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_basic_list_write_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_basic_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_list_write_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_basic_list_write_parameter_to_width_e) {
-          if (setting->mode & fss_basic_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_list_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_basic_list_write_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_basic_list_write_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_basic_list_write_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_basic_list_write_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_basic_list_write_parameter_to_file_e].values.used > 1) {
-        fss_basic_list_write_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_basic_list_write_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_basic_list_write_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_basic_list_write_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_basic_list_write_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_basic_list_write_main_flag_file_to_e;
-      }
-      else {
-        fss_basic_list_write_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_basic_list_write_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_basic_list_write_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_basic_list_write_print_error_no_value(main, setting, fss_basic_list_write_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_basic_list_write_main_flag_file_to_e) {
-        setting->flag -= fss_basic_list_write_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_basic_list_write_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_basic_list_write_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_basic_list_write_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_basic_list_write_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_basic_list_write_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_basic_list_write_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_basic_list_write_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_basic_list_write_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_basic_list_write_print_error_no_value(main, setting, fss_basic_list_write_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_basic_list_write_main_flag_file_from_e) {
-        setting->flag -= fss_basic_list_write_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_basic_list_write_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_basic_list_write_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_basic_list_write_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_basic_list_write_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_basic_list_write_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_basic_list_write_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_basic_list_write_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_basic_list_write_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_basic_list_write_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_basic_list_write_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_basic_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_basic_list_write_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_basic_list_write_setting_load_
 
index 311fb52c7375866351eafba8130841fd57dbac02..eeb3b8709eaeee4c5408ea57cbaee3c656cac9d4 100644 (file)
@@ -81,14 +81,14 @@ extern "C" {
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_basic_list_write_parameter_file_e].result == f_console_result_additional_e) {
         if (main->parameters.array[fss_basic_list_write_parameter_file_e].values.used > 1) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_file_s, main->error.notable);
             fl_print_format("%[' may only be specified once.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -128,8 +128,8 @@ extern "C" {
           }
           else if (main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used && main->parameters.array[fss_basic_list_write_parameter_partial_e].locations.used) {
             if (main->parameters.array[fss_basic_list_write_parameter_content_e].result == f_console_result_additional_e) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
@@ -139,7 +139,7 @@ extern "C" {
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
                 fl_print_format("%[' parameter, but not both.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -160,8 +160,8 @@ extern "C" {
                 location_sub_content = main->parameters.array[fss_basic_list_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) {
-                    flockfile(main->error.to.stream);
+                  if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                    f_file_stream_lock(main->error.to);
 
                     fl_print_format("%r%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
@@ -169,7 +169,7 @@ extern "C" {
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
                     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                    funlockfile(main->error.to.stream);
+                    f_file_stream_unlock(main->error.to);
                   }
 
                   status = F_status_set_error(F_parameter);
@@ -192,8 +192,8 @@ extern "C" {
         }
       }
       else if (!(main->pipe & fll_program_data_pipe_input_e)) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        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.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
@@ -201,7 +201,7 @@ extern "C" {
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
           fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -209,14 +209,14 @@ extern "C" {
 
       if (F_status_is_error_not(status) && (main->pipe & fll_program_data_pipe_input_e)) {
         if (main->parameters.array[fss_basic_list_write_parameter_partial_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
             fl_print_format("%[' parameter cannot be used when processing a pipe.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -226,14 +226,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_basic_list_write_parameter_prepend_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
           fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -251,14 +251,14 @@ extern "C" {
             if (F_status_is_error(status)) break;
 
             if (status == F_false) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
                 fl_print_format("%[' must only contain white space.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -268,14 +268,14 @@ extern "C" {
           } // for
         }
         else {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
             fl_print_format("%[' must not be an empty string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -285,14 +285,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_basic_list_write_parameter_ignore_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' was specified, but no values were given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -302,13 +302,13 @@ extern "C" {
         const f_array_length_t total_arguments = main->parameters.array[fss_basic_list_write_parameter_ignore_e].values.used;
 
         if (total_locations * 2 > total_arguments) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' requires two values.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           status = F_status_set_error(F_parameter);
         }
@@ -337,13 +337,13 @@ extern "C" {
         status = fss_basic_list_write_process_pipe(main, output, quoted, &buffer);
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
       }
@@ -418,16 +418,16 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
-        else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters.array[fss_basic_list_write_parameter_file_e].result == f_console_result_none_e) {
+        else if (main->error.verbosity > f_console_verbosity_quiet_e && main->parameters.array[fss_basic_list_write_parameter_file_e].result == f_console_result_none_e) {
 
           // Ensure there is always a newline at the end, unless in quiet mode.
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -441,7 +441,7 @@ extern "C" {
     }
 
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_is_error(status)) {
         fll_print_dynamic_raw(f_string_eol_s, main->error.to.stream);
       }
index 4d3d125e8601c2bdd00890ecfd6dffefc12f4a14..bbf3d7bdec202f74c59b0f9916aa4395d7578a44 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
@@ -21,7 +21,7 @@ extern "C" {
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_basic_list_write_error_parameter_same_times_print_
 
@@ -30,7 +30,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe FSS-0002 (Basic List) standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
@@ -38,7 +38,7 @@ extern "C" {
     fl_print_format("%[U+000A%]", main->error.to.stream, main->error.notable, main->error.notable);
     fl_print_format("%[) in objects.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_basic_list_write_error_parameter_unsupported_eol_print_
 
@@ -47,13 +47,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
     fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_basic_list_write_error_parameter_value_missing_print_
 
@@ -267,7 +267,7 @@ extern "C" {
           for (; range.start <= range.stop; ++range.start) {
 
             if (block.string[range.start] == fss_basic_list_write_pipe_content_start_s.string[0]) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QThe FSS-0002 (Basic List) standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
index 923d37c07e7d68b0d047d882bfda9cbd1902de57..c275f869aa904e02283a63d3c23ceacb4fbf1a05 100644 (file)
@@ -143,261 +143,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_basic_read_parameter_from_bytesequence_e, fss_basic_read_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_basic_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_basic_read_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_basic_read_mode_from_codepoint_e) {
-            setting->mode -= fss_basic_read_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_basic_read_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_basic_read_parameter_from_codepoint_e) {
-          if (setting->mode & fss_basic_read_mode_from_bytesequence_e) {
-            setting->mode -= fss_basic_read_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_basic_read_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_basic_read_parameter_to_bytesequence_e, fss_basic_read_parameter_to_codepoint_e, fss_basic_read_parameter_to_combining_e, fss_basic_read_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_basic_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_basic_read_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_basic_read_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_read_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_basic_read_mode_to_combining_e) {
-            setting->mode -= fss_basic_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_basic_read_mode_to_width_e) {
-            setting->mode -= fss_basic_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_read_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_basic_read_parameter_to_codepoint_e) {
-          if (setting->mode & fss_basic_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_read_mode_to_combining_e) {
-            setting->mode -= fss_basic_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_basic_read_mode_to_width_e) {
-            setting->mode -= fss_basic_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_read_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_basic_read_parameter_to_combining_e) {
-          if (setting->mode & fss_basic_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_read_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_basic_read_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_basic_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_read_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_basic_read_parameter_to_width_e) {
-          if (setting->mode & fss_basic_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_read_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_basic_read_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_basic_read_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_basic_read_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_basic_read_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_basic_read_parameter_to_file_e].values.used > 1) {
-        fss_basic_read_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_basic_read_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_basic_read_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_basic_read_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_basic_read_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_basic_read_main_flag_file_to_e;
-      }
-      else {
-        fss_basic_read_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_basic_read_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_basic_read_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_basic_read_print_error_no_value(main, setting, fss_basic_read_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_basic_read_main_flag_file_to_e) {
-        setting->flag -= fss_basic_read_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_basic_read_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_basic_read_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_basic_read_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_basic_read_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_basic_read_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_basic_read_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_basic_read_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_basic_read_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_basic_read_print_error_no_value(main, setting, fss_basic_read_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_basic_read_main_flag_file_from_e) {
-        setting->flag -= fss_basic_read_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_basic_read_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_basic_read_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_basic_read_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_basic_read_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_basic_read_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_basic_read_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_basic_read_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_basic_read_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_basic_read_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_basic_read_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_basic_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_basic_read_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_basic_read_setting_load_
 
index 5aee79cf926b57068cd17d9d818c97e4c0948d1f..6726b1b161db6bafd3d55b87a1af0465c0085ee7 100644 (file)
@@ -117,13 +117,13 @@ extern "C" {
         for (f_array_length_t i = 0; i < 6; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
             fl_print_format("%[' requires a %s.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
 
@@ -160,8 +160,8 @@ extern "C" {
         for (f_array_length_t i = 0; i < 5; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) {
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
-              fll_program_parameter_long_print_cannot_use_with(main->error, fss_basic_read_long_columns_s, parameter_name[i]);
+            if (main->error.verbosity > f_console_verbosity_quiet_e) {
+              fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_basic_read_long_columns_s, parameter_name[i]);
             }
 
             status = F_status_set_error(F_parameter);
@@ -173,15 +173,15 @@ extern "C" {
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) {
         if (main->parameters.array[fss_basic_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_basic_read_long_pipe_s, fss_basic_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_basic_read_long_pipe_s, fss_basic_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
         }
         else if (main->parameters.array[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_basic_read_long_pipe_s, fss_basic_read_long_line_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_basic_read_long_pipe_s, fss_basic_read_long_line_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -213,13 +213,13 @@ extern "C" {
           length = data.argv[index].used;
 
           if (!length) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit_s, main->error.notable);
             fl_print_format("%[' must not be empty.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
 
@@ -346,13 +346,13 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_basic_read_parameter_select_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, main->error.notable);
         fl_print_format("%[' parameter requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         fss_basic_read_depths_resize(0, &data.depths);
 
@@ -523,9 +523,9 @@ extern "C" {
       status = F_status_set_error(F_parameter);
     }
 
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
       }
index 657a5d4e0237e78a71bc37caa3014bdf81aa31f6..f3fd7fe5b13fbddba69611a7500b122d523311dc 100644 (file)
@@ -162,8 +162,8 @@ extern "C" {
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
@@ -171,15 +171,15 @@ extern "C" {
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
         }
 
         if (data->depths.array[i].depth > data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, main->error.notable);
@@ -189,7 +189,7 @@ extern "C" {
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[j].depth, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
index 4e4edf15a11f5abefa6968cc323f1cfb2c4d8b42..2a5fef93fe31e639fb5405c5b11fa01289a36ca3 100644 (file)
@@ -125,261 +125,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_basic_write_parameter_from_bytesequence_e, fss_basic_write_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_basic_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_basic_write_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_basic_write_mode_from_codepoint_e) {
-            setting->mode -= fss_basic_write_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_basic_write_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_basic_write_parameter_from_codepoint_e) {
-          if (setting->mode & fss_basic_write_mode_from_bytesequence_e) {
-            setting->mode -= fss_basic_write_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_basic_write_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_basic_write_parameter_to_bytesequence_e, fss_basic_write_parameter_to_codepoint_e, fss_basic_write_parameter_to_combining_e, fss_basic_write_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_basic_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_basic_write_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_basic_write_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_write_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_basic_write_mode_to_combining_e) {
-            setting->mode -= fss_basic_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_basic_write_mode_to_width_e) {
-            setting->mode -= fss_basic_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_write_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_basic_write_parameter_to_codepoint_e) {
-          if (setting->mode & fss_basic_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_write_mode_to_combining_e) {
-            setting->mode -= fss_basic_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_basic_write_mode_to_width_e) {
-            setting->mode -= fss_basic_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_write_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_basic_write_parameter_to_combining_e) {
-          if (setting->mode & fss_basic_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_write_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_basic_write_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_basic_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_basic_write_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_basic_write_parameter_to_width_e) {
-          if (setting->mode & fss_basic_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_basic_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_basic_write_mode_to_codepoint_e) {
-            setting->mode -= fss_basic_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_basic_write_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_basic_write_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_basic_write_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_basic_write_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_basic_write_parameter_to_file_e].values.used > 1) {
-        fss_basic_write_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_basic_write_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_basic_write_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_basic_write_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_basic_write_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_basic_write_main_flag_file_to_e;
-      }
-      else {
-        fss_basic_write_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_basic_write_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_basic_write_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_basic_write_print_error_no_value(main, setting, fss_basic_write_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_basic_write_main_flag_file_to_e) {
-        setting->flag -= fss_basic_write_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_basic_write_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_basic_write_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_basic_write_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_basic_write_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_basic_write_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_basic_write_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_basic_write_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_basic_write_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_basic_write_print_error_no_value(main, setting, fss_basic_write_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_basic_write_main_flag_file_from_e) {
-        setting->flag -= fss_basic_write_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_basic_write_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_basic_write_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_basic_write_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_basic_write_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_basic_write_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_basic_write_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_basic_write_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_basic_write_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_basic_write_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_basic_write_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_basic_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_basic_write_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_basic_write_setting_load_
 
index b375bb6ba02f4807f0b782da2cf795e61357eded..e3cfc5b59354bfe491c33cb5a506909aaa36f0b7 100644 (file)
@@ -79,14 +79,14 @@ extern "C" {
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_basic_write_parameter_file_e].result == f_console_result_additional_e) {
         if (main->parameters.array[fss_basic_write_parameter_file_e].values.used > 1) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_file_s, main->error.notable);
             fl_print_format("%[' may only be specified once.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -126,8 +126,8 @@ extern "C" {
           }
           else if (main->parameters.array[fss_basic_write_parameter_content_e].locations.used && main->parameters.array[fss_basic_write_parameter_partial_e].locations.used) {
             if (main->parameters.array[fss_basic_write_parameter_content_e].result == f_console_result_additional_e) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
@@ -137,7 +137,7 @@ extern "C" {
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
                 fl_print_format("%[' parameter, but not both.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -158,8 +158,8 @@ extern "C" {
                 location_sub_content = main->parameters.array[fss_basic_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) {
-                    flockfile(main->error.to.stream);
+                  if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                    f_file_stream_lock(main->error.to);
 
                     fl_print_format("%r%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
@@ -167,7 +167,7 @@ extern "C" {
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
                     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                    funlockfile(main->error.to.stream);
+                    f_file_stream_unlock(main->error.to);
                   }
 
                   status = F_status_set_error(F_parameter);
@@ -190,8 +190,8 @@ extern "C" {
         }
       }
       else if (!(main->pipe & fll_program_data_pipe_input_e)) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        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.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
@@ -199,7 +199,7 @@ extern "C" {
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
           fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -207,14 +207,14 @@ extern "C" {
 
       if (F_status_is_error_not(status) && (main->pipe & fll_program_data_pipe_input_e)) {
         if (main->parameters.array[fss_basic_write_parameter_partial_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
             fl_print_format("%[' parameter cannot be used when processing a pipe.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -224,14 +224,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_basic_write_parameter_prepend_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
           fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -250,14 +250,14 @@ extern "C" {
             if (F_status_is_error(status)) break;
 
             if (status == F_false) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
                 fl_print_format("%[' must only contain white space.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -267,14 +267,14 @@ extern "C" {
           } // for
         }
         else {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
             fl_print_format("%[' must not be an empty string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -284,14 +284,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_basic_write_parameter_ignore_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' was specified, but no values were given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -301,13 +301,13 @@ extern "C" {
         const f_array_length_t total_arguments = main->parameters.array[fss_basic_write_parameter_ignore_e].values.used;
 
         if (total_locations * 2 > total_arguments) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' requires two values.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           status = F_status_set_error(F_parameter);
         }
@@ -336,13 +336,13 @@ extern "C" {
         status = fss_basic_write_process_pipe(main, output, quote, &buffer);
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
       }
@@ -409,16 +409,16 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
-        else if (main->error.verbosity != f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_basic_write_parameter_file_e].result == f_console_result_none_e) {
+        else if (main->error.verbosity > f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_basic_write_parameter_file_e].result == f_console_result_none_e) {
 
           // Ensure there is always a newline at the end, unless in quiet mode.
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -432,7 +432,7 @@ extern "C" {
     }
 
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_is_error(status)) {
         fll_print_dynamic_raw(f_string_eol_s, main->error.to.stream);
       }
index d86cd5feff1bbc61641d3fc7d61b571a4f641262..2356ce3041e5ad25c4759c7ed68c21e05627c84f 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
@@ -21,7 +21,7 @@ extern "C" {
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_basic_write_error_parameter_same_times_print_
 
@@ -30,13 +30,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
     fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_basic_write_error_parameter_value_missing_print_
 
@@ -45,7 +45,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe FSS-0000 (Basic) standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
@@ -53,7 +53,7 @@ extern "C" {
     fl_print_format("%[U+000A%]", main->error.to.stream, main->error.notable, main->error.notable);
     fl_print_format("%[) in objects.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_basic_write_error_parameter_unsupported_eol_print_
 
@@ -269,7 +269,7 @@ extern "C" {
           for (; range.start <= range.stop; ++range.start) {
 
             if (block.string[range.start] == fss_basic_write_pipe_content_start_s.string[0]) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QThe FSS-0000 (Basic) standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
index 98a5025d747877d19271346f311b12421fc7d734..f7353dac910fd1a6c235dbe287d4ab4a438c9a6f 100644 (file)
@@ -142,261 +142,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_embedded_list_read_parameter_from_bytesequence_e, fss_embedded_list_read_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_embedded_list_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_embedded_list_read_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_embedded_list_read_mode_from_codepoint_e) {
-            setting->mode -= fss_embedded_list_read_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_embedded_list_read_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_embedded_list_read_parameter_from_codepoint_e) {
-          if (setting->mode & fss_embedded_list_read_mode_from_bytesequence_e) {
-            setting->mode -= fss_embedded_list_read_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_embedded_list_read_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_embedded_list_read_parameter_to_bytesequence_e, fss_embedded_list_read_parameter_to_codepoint_e, fss_embedded_list_read_parameter_to_combining_e, fss_embedded_list_read_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_embedded_list_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_embedded_list_read_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_embedded_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_embedded_list_read_mode_to_combining_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_embedded_list_read_mode_to_width_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_embedded_list_read_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_embedded_list_read_parameter_to_codepoint_e) {
-          if (setting->mode & fss_embedded_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_embedded_list_read_mode_to_combining_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_embedded_list_read_mode_to_width_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_embedded_list_read_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_embedded_list_read_parameter_to_combining_e) {
-          if (setting->mode & fss_embedded_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_embedded_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_embedded_list_read_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_embedded_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_embedded_list_read_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_embedded_list_read_parameter_to_width_e) {
-          if (setting->mode & fss_embedded_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_embedded_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_embedded_list_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_embedded_list_read_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_embedded_list_read_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_embedded_list_read_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_embedded_list_read_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_embedded_list_read_parameter_to_file_e].values.used > 1) {
-        fss_embedded_list_read_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_embedded_list_read_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_embedded_list_read_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_embedded_list_read_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_embedded_list_read_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_embedded_list_read_main_flag_file_to_e;
-      }
-      else {
-        fss_embedded_list_read_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_embedded_list_read_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_embedded_list_read_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_embedded_list_read_print_error_no_value(main, setting, fss_embedded_list_read_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_embedded_list_read_main_flag_file_to_e) {
-        setting->flag -= fss_embedded_list_read_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_embedded_list_read_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_embedded_list_read_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_embedded_list_read_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_embedded_list_read_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_embedded_list_read_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_embedded_list_read_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_embedded_list_read_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_embedded_list_read_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_embedded_list_read_print_error_no_value(main, setting, fss_embedded_list_read_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_embedded_list_read_main_flag_file_from_e) {
-        setting->flag -= fss_embedded_list_read_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_embedded_list_read_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_embedded_list_read_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_embedded_list_read_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_embedded_list_read_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_embedded_list_read_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_embedded_list_read_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_embedded_list_read_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_embedded_list_read_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_embedded_list_read_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_embedded_list_read_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_embedded_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_embedded_list_read_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_embedded_list_read_setting_load_
 
index e8d476249b0fee3ccbd68d05d6e3bc86ae4cbb62..c5e8211a65d8b7b1da3832517191a5e7ef1d1538 100644 (file)
@@ -79,8 +79,8 @@ extern "C" {
 
     if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) {
       if (main->parameters.array[fss_embedded_list_read_parameter_columns_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          fll_program_parameter_long_print_cannot_use_with(main->error, fss_embedded_list_read_long_columns_s, fss_embedded_list_read_long_total_s);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_embedded_list_read_long_columns_s, fss_embedded_list_read_long_total_s);
         }
 
         status = F_status_set_error(F_parameter);
@@ -89,69 +89,69 @@ extern "C" {
 
     if (main->parameters.remaining.used > 0 || (main->pipe & fll_program_data_pipe_input_e)) {
       if (main->parameters.array[fss_embedded_list_read_parameter_at_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, main->error.notable);
         fl_print_format("%[' requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_depth_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, main->error.notable);
         fl_print_format("%[' requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_line_s, main->error.notable);
         fl_print_format("%[' requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_name_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, main->error.notable);
         fl_print_format("%[' requires a string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_select_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, main->error.notable);
         fl_print_format("%[' requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
 
       if (main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) {
         if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_embedded_list_read_long_line_s, fss_embedded_list_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_embedded_list_read_long_line_s, fss_embedded_list_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -160,8 +160,8 @@ extern "C" {
 
       if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) {
         if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_embedded_list_read_long_pipe_s, fss_embedded_list_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_embedded_list_read_long_pipe_s, fss_embedded_list_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -170,13 +170,13 @@ extern "C" {
 
       if (F_status_is_error_not(status)) {
         if (main->parameters.array[fss_embedded_list_read_parameter_delimit_e].result == f_console_result_found_e) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, main->error.notable);
           fl_print_format("%[' requires a value.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           status = F_status_set_error(F_parameter);
         }
@@ -185,13 +185,13 @@ extern "C" {
           f_array_length_t length = data.argv[index].used;
 
           if (!length) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, main->error.notable);
             fl_print_format("%[' must not be empty.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
           }
@@ -248,13 +248,13 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_select_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, main->error.notable);
         fl_print_format("%[' parameter requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
@@ -415,9 +415,9 @@ extern "C" {
       status = F_status_set_error(F_parameter);
     }
 
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
       }
index a31b4b71cc1c22f094b17dfe3123153023d4cda7..11bfc9ecc179257a32eee7b1f00329bd868899ef 100644 (file)
@@ -125,261 +125,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_embedded_list_write_parameter_from_bytesequence_e, fss_embedded_list_write_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_embedded_list_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_embedded_list_write_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_embedded_list_write_mode_from_codepoint_e) {
-            setting->mode -= fss_embedded_list_write_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_embedded_list_write_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_embedded_list_write_parameter_from_codepoint_e) {
-          if (setting->mode & fss_embedded_list_write_mode_from_bytesequence_e) {
-            setting->mode -= fss_embedded_list_write_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_embedded_list_write_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_embedded_list_write_parameter_to_bytesequence_e, fss_embedded_list_write_parameter_to_codepoint_e, fss_embedded_list_write_parameter_to_combining_e, fss_embedded_list_write_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_embedded_list_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_embedded_list_write_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_embedded_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_embedded_list_write_mode_to_combining_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_embedded_list_write_mode_to_width_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_embedded_list_write_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_embedded_list_write_parameter_to_codepoint_e) {
-          if (setting->mode & fss_embedded_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_embedded_list_write_mode_to_combining_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_embedded_list_write_mode_to_width_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_embedded_list_write_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_embedded_list_write_parameter_to_combining_e) {
-          if (setting->mode & fss_embedded_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_embedded_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_embedded_list_write_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_embedded_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_embedded_list_write_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_embedded_list_write_parameter_to_width_e) {
-          if (setting->mode & fss_embedded_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_embedded_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_embedded_list_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_embedded_list_write_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_embedded_list_write_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_embedded_list_write_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_embedded_list_write_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_embedded_list_write_parameter_to_file_e].values.used > 1) {
-        fss_embedded_list_write_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_embedded_list_write_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_embedded_list_write_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_embedded_list_write_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_embedded_list_write_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_embedded_list_write_main_flag_file_to_e;
-      }
-      else {
-        fss_embedded_list_write_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_embedded_list_write_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_embedded_list_write_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_embedded_list_write_print_error_no_value(main, setting, fss_embedded_list_write_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_embedded_list_write_main_flag_file_to_e) {
-        setting->flag -= fss_embedded_list_write_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_embedded_list_write_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_embedded_list_write_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_embedded_list_write_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_embedded_list_write_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_embedded_list_write_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_embedded_list_write_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_embedded_list_write_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_embedded_list_write_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_embedded_list_write_print_error_no_value(main, setting, fss_embedded_list_write_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_embedded_list_write_main_flag_file_from_e) {
-        setting->flag -= fss_embedded_list_write_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_embedded_list_write_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_embedded_list_write_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_embedded_list_write_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_embedded_list_write_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_embedded_list_write_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_embedded_list_write_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_embedded_list_write_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_embedded_list_write_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_embedded_list_write_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_embedded_list_write_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_embedded_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_embedded_list_write_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_embedded_list_write_setting_load_
 
index a5bd5327cf50d70a7ede0e48bfcae4293b7361d9..542452858216fc859775c7a90a5330c315e6811d 100644 (file)
@@ -79,14 +79,14 @@ extern "C" {
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_additional_e) {
         if (main->parameters.array[fss_embedded_list_write_parameter_file_e].values.used > 1) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_file_s, main->error.notable);
             fl_print_format("%[' may only be specified once.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -126,8 +126,8 @@ extern "C" {
           }
           else if (main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used && main->parameters.array[fss_embedded_list_write_parameter_partial_e].locations.used) {
             if (main->parameters.array[fss_embedded_list_write_parameter_content_e].result == f_console_result_additional_e) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
@@ -137,7 +137,7 @@ extern "C" {
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
                 fl_print_format("%[' parameter, but not both.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -158,8 +158,8 @@ extern "C" {
                 location_sub_content = main->parameters.array[fss_embedded_list_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) {
-                    flockfile(main->error.to.stream);
+                  if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                    f_file_stream_lock(main->error.to);
 
                     fl_print_format("%r%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
@@ -167,7 +167,7 @@ extern "C" {
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
                     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                    funlockfile(main->error.to.stream);
+                    f_file_stream_unlock(main->error.to);
                   }
 
                   status = F_status_set_error(F_parameter);
@@ -190,8 +190,8 @@ extern "C" {
         }
       }
       else if (!(main->pipe & fll_program_data_pipe_input_e)) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        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.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
@@ -199,7 +199,7 @@ extern "C" {
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
           fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -207,14 +207,14 @@ extern "C" {
 
       if (F_status_is_error_not(status) && (main->pipe & fll_program_data_pipe_input_e)) {
         if (main->parameters.array[fss_embedded_list_write_parameter_partial_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
             fl_print_format("%[' parameter cannot be used when processing a pipe.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -224,14 +224,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_embedded_list_write_parameter_prepend_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
           fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -249,14 +249,14 @@ extern "C" {
             if (F_status_is_error(status)) break;
 
             if (status == F_false) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
                 fl_print_format("%[' must only contain white space.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -266,14 +266,14 @@ extern "C" {
           } // for
         }
         else {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
             fl_print_format("%[' must not be an empty string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -283,14 +283,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_embedded_list_write_parameter_ignore_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' was specified, but no values were given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -300,13 +300,13 @@ extern "C" {
         const f_array_length_t total_arguments = main->parameters.array[fss_embedded_list_write_parameter_ignore_e].values.used;
 
         if (total_locations * 2 > total_arguments) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' requires two values.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           status = F_status_set_error(F_parameter);
         }
@@ -337,13 +337,13 @@ extern "C" {
         status = fss_embedded_list_write_process_pipe(main, output, quote, &buffer, &ignore);
 
         if (F_status_is_error(status) && F_status_set_fine(status) != F_interrupt) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
 
@@ -419,16 +419,16 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
-        else if (main->error.verbosity != f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_none_e) {
+        else if (main->error.verbosity > f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_none_e) {
 
           // Ensure there is always a newline at the end, unless in quiet mode.
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -444,7 +444,7 @@ extern "C" {
     }
 
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_is_error(status)) {
         fll_print_dynamic_raw(f_string_eol_s, main->error.to.stream);
       }
index 3654add0d2ad48c101707beeaae1c577fbec5f1e..33bb70a141e237a48a8e64b5a8c655de24a116c9 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
@@ -23,7 +23,7 @@ extern "C" {
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_embedded_list_write_error_parameter_same_times_print_
 
@@ -34,7 +34,7 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe FSS-0008 (Embedded List) standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
@@ -42,7 +42,7 @@ extern "C" {
     fl_print_format("%[U+000A%]", main->error.to.stream, main->error.notable, main->error.notable);
     fl_print_format("%[) in objects.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_embedded_list_write_error_parameter_unsupported_eol_print_
 
@@ -53,13 +53,13 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
     fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_embedded_list_write_error_parameter_value_missing_print_
 
@@ -279,7 +279,7 @@ extern "C" {
           for (; range.start <= range.stop; ++range.start) {
 
             if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s.string[0]) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QThe FSS-0008 (Embedded List) standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
index 1726e8f09a5b9613a3249a55a6ed5989b7146478..727047c7aab558a069f49de37ef5927b09ebfe5e 100644 (file)
@@ -150,261 +150,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_extended_list_read_parameter_from_bytesequence_e, fss_extended_list_read_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_extended_list_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_extended_list_read_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_extended_list_read_mode_from_codepoint_e) {
-            setting->mode -= fss_extended_list_read_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_extended_list_read_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_extended_list_read_parameter_from_codepoint_e) {
-          if (setting->mode & fss_extended_list_read_mode_from_bytesequence_e) {
-            setting->mode -= fss_extended_list_read_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_extended_list_read_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_extended_list_read_parameter_to_bytesequence_e, fss_extended_list_read_parameter_to_codepoint_e, fss_extended_list_read_parameter_to_combining_e, fss_extended_list_read_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_extended_list_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_extended_list_read_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_extended_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_list_read_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_extended_list_read_mode_to_combining_e) {
-            setting->mode -= fss_extended_list_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_extended_list_read_mode_to_width_e) {
-            setting->mode -= fss_extended_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_list_read_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_extended_list_read_parameter_to_codepoint_e) {
-          if (setting->mode & fss_extended_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_list_read_mode_to_combining_e) {
-            setting->mode -= fss_extended_list_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_extended_list_read_mode_to_width_e) {
-            setting->mode -= fss_extended_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_list_read_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_extended_list_read_parameter_to_combining_e) {
-          if (setting->mode & fss_extended_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_list_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_extended_list_read_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_extended_list_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_list_read_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_extended_list_read_parameter_to_width_e) {
-          if (setting->mode & fss_extended_list_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_list_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_list_read_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_list_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_extended_list_read_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_extended_list_read_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_extended_list_read_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_extended_list_read_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_extended_list_read_parameter_to_file_e].values.used > 1) {
-        fss_extended_list_read_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_extended_list_read_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_extended_list_read_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_extended_list_read_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_extended_list_read_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_extended_list_read_main_flag_file_to_e;
-      }
-      else {
-        fss_extended_list_read_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_extended_list_read_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_extended_list_read_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_extended_list_read_print_error_no_value(main, setting, fss_extended_list_read_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_extended_list_read_main_flag_file_to_e) {
-        setting->flag -= fss_extended_list_read_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_extended_list_read_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_extended_list_read_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_extended_list_read_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_extended_list_read_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_extended_list_read_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_extended_list_read_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_extended_list_read_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_extended_list_read_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_extended_list_read_print_error_no_value(main, setting, fss_extended_list_read_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_extended_list_read_main_flag_file_from_e) {
-        setting->flag -= fss_extended_list_read_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_extended_list_read_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_extended_list_read_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_extended_list_read_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_extended_list_read_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_extended_list_read_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_extended_list_read_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_extended_list_read_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_extended_list_read_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_extended_list_read_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_extended_list_read_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_extended_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_extended_list_read_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_extended_list_read_setting_load_
 
index 218d78ca0e9de82ff7f2b15d025a210fbdac40d7..df2e21e2f416910bfea59088cca488411111d6d3 100644 (file)
@@ -117,13 +117,13 @@ extern "C" {
         for (f_array_length_t i = 0; i < 6; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
             fl_print_format("%[' requires a %s.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
 
@@ -160,8 +160,8 @@ extern "C" {
         for (f_array_length_t i = 0; i < 5; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) {
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
-              fll_program_parameter_long_print_cannot_use_with(main->error, fss_extended_list_read_long_columns_s, parameter_name[i]);
+            if (main->error.verbosity > f_console_verbosity_quiet_e) {
+              fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_extended_list_read_long_columns_s, parameter_name[i]);
             }
 
             status = F_status_set_error(F_parameter);
@@ -173,15 +173,15 @@ extern "C" {
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
         if (main->parameters.array[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_extended_list_read_long_pipe_s, fss_extended_list_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_extended_list_read_long_pipe_s, fss_extended_list_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
         }
         else if (main->parameters.array[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_extended_list_read_long_pipe_s, fss_extended_list_read_long_line_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_extended_list_read_long_pipe_s, fss_extended_list_read_long_line_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -213,13 +213,13 @@ extern "C" {
           length = data.argv[index].used;
 
           if (!length) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit_s, main->error.notable);
             fl_print_format("%[' must not be empty.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
 
@@ -346,13 +346,13 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_extended_list_read_parameter_select_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, main->error.notable);
         fl_print_format("%[' parameter requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         fss_extended_list_read_depths_resize(0, &data.depths);
 
@@ -523,9 +523,9 @@ extern "C" {
       status = F_status_set_error(F_parameter);
     }
 
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
       }
index 3494f4bcce9dcbcaa5bec0760b5cbc96633007d2..fc3273645e7c5f1d07a6efe0a14babd6244fd5c8 100644 (file)
@@ -185,8 +185,8 @@ extern "C" {
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
@@ -194,14 +194,14 @@ extern "C" {
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
         }
         else if (data->depths.array[i].depth > data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, main->error.notable);
@@ -211,7 +211,7 @@ extern "C" {
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[j].depth, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
index ec3991a2142b1aa4eedd814f4792671ec0534370..6043faf0fe17fa39ca40c7d2dec3fbb0daa6acc9 100644 (file)
@@ -132,261 +132,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_extended_list_write_parameter_from_bytesequence_e, fss_extended_list_write_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_extended_list_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_extended_list_write_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_extended_list_write_mode_from_codepoint_e) {
-            setting->mode -= fss_extended_list_write_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_extended_list_write_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_extended_list_write_parameter_from_codepoint_e) {
-          if (setting->mode & fss_extended_list_write_mode_from_bytesequence_e) {
-            setting->mode -= fss_extended_list_write_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_extended_list_write_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_extended_list_write_parameter_to_bytesequence_e, fss_extended_list_write_parameter_to_codepoint_e, fss_extended_list_write_parameter_to_combining_e, fss_extended_list_write_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_extended_list_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_extended_list_write_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_extended_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_list_write_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_extended_list_write_mode_to_combining_e) {
-            setting->mode -= fss_extended_list_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_extended_list_write_mode_to_width_e) {
-            setting->mode -= fss_extended_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_list_write_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_extended_list_write_parameter_to_codepoint_e) {
-          if (setting->mode & fss_extended_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_list_write_mode_to_combining_e) {
-            setting->mode -= fss_extended_list_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_extended_list_write_mode_to_width_e) {
-            setting->mode -= fss_extended_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_list_write_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_extended_list_write_parameter_to_combining_e) {
-          if (setting->mode & fss_extended_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_list_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_extended_list_write_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_extended_list_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_list_write_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_extended_list_write_parameter_to_width_e) {
-          if (setting->mode & fss_extended_list_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_list_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_list_write_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_list_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_extended_list_write_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_extended_list_write_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_extended_list_write_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_extended_list_write_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_extended_list_write_parameter_to_file_e].values.used > 1) {
-        fss_extended_list_write_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_extended_list_write_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_extended_list_write_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_extended_list_write_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_extended_list_write_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_extended_list_write_main_flag_file_to_e;
-      }
-      else {
-        fss_extended_list_write_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_extended_list_write_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_extended_list_write_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_extended_list_write_print_error_no_value(main, setting, fss_extended_list_write_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_extended_list_write_main_flag_file_to_e) {
-        setting->flag -= fss_extended_list_write_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_extended_list_write_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_extended_list_write_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_extended_list_write_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_extended_list_write_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_extended_list_write_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_extended_list_write_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_extended_list_write_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_extended_list_write_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_extended_list_write_print_error_no_value(main, setting, fss_extended_list_write_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_extended_list_write_main_flag_file_from_e) {
-        setting->flag -= fss_extended_list_write_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_extended_list_write_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_extended_list_write_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_extended_list_write_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_extended_list_write_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_extended_list_write_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_extended_list_write_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_extended_list_write_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_extended_list_write_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_extended_list_write_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_extended_list_write_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_extended_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_extended_list_write_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_extended_list_write_setting_load_
 
index 4b3c9a67c60e9c2264a087a0f4ec019211ad7267..33eb064fa5cd62282a4b2dff755f518ef562be65 100644 (file)
@@ -79,14 +79,14 @@ extern "C" {
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_extended_list_write_parameter_file_e].result == f_console_result_additional_e) {
         if (main->parameters.array[fss_extended_list_write_parameter_file_e].values.used > 1) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_file_s, main->error.notable);
             fl_print_format("%[' may only be specified once.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -126,8 +126,8 @@ extern "C" {
           }
           else if (main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_list_write_parameter_partial_e].locations.used) {
             if (main->parameters.array[fss_extended_list_write_parameter_content_e].result == f_console_result_additional_e) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
@@ -137,7 +137,7 @@ extern "C" {
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
                 fl_print_format("%[' parameter, but not both.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -158,8 +158,8 @@ extern "C" {
                 location_sub_content = main->parameters.array[fss_extended_list_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) {
-                    flockfile(main->error.to.stream);
+                  if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                    f_file_stream_lock(main->error.to);
 
                     fl_print_format("%r%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
@@ -167,7 +167,7 @@ extern "C" {
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
                     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                    funlockfile(main->error.to.stream);
+                    f_file_stream_unlock(main->error.to);
                   }
 
                   status = F_status_set_error(F_parameter);
@@ -189,8 +189,8 @@ extern "C" {
         }
       }
       else if (!(main->pipe & fll_program_data_pipe_input_e)) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        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.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
@@ -198,7 +198,7 @@ extern "C" {
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
           fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -206,14 +206,14 @@ extern "C" {
 
       if (F_status_is_error_not(status) && (main->pipe & fll_program_data_pipe_input_e)) {
         if (main->parameters.array[fss_extended_list_write_parameter_partial_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
             fl_print_format("%[' parameter cannot be used when processing a pipe.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -223,14 +223,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_extended_list_write_parameter_prepend_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
           fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -248,14 +248,14 @@ extern "C" {
             if (F_status_is_error(status)) break;
 
             if (status == F_false) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
                 fl_print_format("%[' must only contain white space.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -265,14 +265,14 @@ extern "C" {
           } // for
         }
         else {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
             fl_print_format("%[' must not be an empty string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -282,14 +282,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_extended_list_write_parameter_ignore_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' was specified, but no values were given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -299,13 +299,13 @@ extern "C" {
         const f_array_length_t total_arguments = main->parameters.array[fss_extended_list_write_parameter_ignore_e].values.used;
 
         if (total_locations * 2 > total_arguments) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' requires two values.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           status = F_status_set_error(F_parameter);
         }
@@ -336,13 +336,13 @@ extern "C" {
         status = fss_extended_list_write_process_pipe(main, output, quote, &buffer, &ignore);
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
 
@@ -418,16 +418,16 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
-        else if (main->error.verbosity != f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_extended_list_write_parameter_file_e].result == f_console_result_none_e) {
+        else if (main->error.verbosity > f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_extended_list_write_parameter_file_e].result == f_console_result_none_e) {
 
           // Ensure there is always a newline at the end, unless in quiet mode.
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -443,7 +443,7 @@ extern "C" {
     }
 
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_is_error(status)) {
         fll_print_dynamic_raw(f_string_eol_s, main->error.to.stream);
       }
index 1a44c8d9930e8ce83195124d23ad7a3aec2e26f5..e2b8748f881cdd25361fec5b4c191f53d62050c2 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
@@ -21,7 +21,7 @@ extern "C" {
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_extended_list_write_error_parameter_same_times_print_
 
@@ -30,7 +30,7 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe FSS-0003 (Extended List) standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
@@ -38,7 +38,7 @@ extern "C" {
     fl_print_format("%[U+000A%]", main->error.to.stream, main->error.notable, main->error.notable);
     fl_print_format("%[) in objects.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_extended_list_write_error_parameter_unsupported_eol_print_
 
@@ -47,13 +47,13 @@ extern "C" {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) return;
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
     fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_extended_list_write_error_parameter_value_missing_print_
 
@@ -270,7 +270,7 @@ extern "C" {
           for (; range.start <= range.stop; ++range.start) {
 
             if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s.string[0]) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QThe FSS-0003 (Extended List) standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
index cb20d4340b3e57c5a4360817f6746405a045b161..518f301adb5af15adb8edf764d73c8dc859365c3 100644 (file)
@@ -143,261 +143,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_extended_read_parameter_from_bytesequence_e, fss_extended_read_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_extended_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_extended_read_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_extended_read_mode_from_codepoint_e) {
-            setting->mode -= fss_extended_read_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_extended_read_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_extended_read_parameter_from_codepoint_e) {
-          if (setting->mode & fss_extended_read_mode_from_bytesequence_e) {
-            setting->mode -= fss_extended_read_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_extended_read_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_extended_read_parameter_to_bytesequence_e, fss_extended_read_parameter_to_codepoint_e, fss_extended_read_parameter_to_combining_e, fss_extended_read_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_extended_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_extended_read_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_extended_read_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_read_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_extended_read_mode_to_combining_e) {
-            setting->mode -= fss_extended_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_extended_read_mode_to_width_e) {
-            setting->mode -= fss_extended_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_read_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_extended_read_parameter_to_codepoint_e) {
-          if (setting->mode & fss_extended_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_read_mode_to_combining_e) {
-            setting->mode -= fss_extended_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_extended_read_mode_to_width_e) {
-            setting->mode -= fss_extended_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_read_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_extended_read_parameter_to_combining_e) {
-          if (setting->mode & fss_extended_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_read_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_extended_read_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_extended_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_read_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_extended_read_parameter_to_width_e) {
-          if (setting->mode & fss_extended_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_read_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_extended_read_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_extended_read_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_extended_read_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_extended_read_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_extended_read_parameter_to_file_e].values.used > 1) {
-        fss_extended_read_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_extended_read_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_extended_read_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_extended_read_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_extended_read_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_extended_read_main_flag_file_to_e;
-      }
-      else {
-        fss_extended_read_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_extended_read_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_extended_read_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_extended_read_print_error_no_value(main, setting, fss_extended_read_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_extended_read_main_flag_file_to_e) {
-        setting->flag -= fss_extended_read_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_extended_read_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_extended_read_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_extended_read_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_extended_read_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_extended_read_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_extended_read_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_extended_read_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_extended_read_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_extended_read_print_error_no_value(main, setting, fss_extended_read_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_extended_read_main_flag_file_from_e) {
-        setting->flag -= fss_extended_read_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_extended_read_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_extended_read_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_extended_read_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_extended_read_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_extended_read_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_extended_read_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_extended_read_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_extended_read_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_extended_read_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_extended_read_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_extended_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_extended_read_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_extended_read_setting_load_
 
index b64bbfae2027aaad7dec2bdac84ea520bb4fc6b1..77ec8602d2785389ffbd6e1ccf3f0c40f32bf411 100644 (file)
@@ -117,13 +117,13 @@ extern "C" {
         for (f_array_length_t i = 0; i < 6; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
             fl_print_format("%[' requires a %s.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
             break;
@@ -159,8 +159,8 @@ extern "C" {
         for (f_array_length_t i = 0; i < 5; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) {
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
-              fll_program_parameter_long_print_cannot_use_with(main->error, fss_extended_read_long_columns_s, parameter_name[i]);
+            if (main->error.verbosity > f_console_verbosity_quiet_e) {
+              fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_extended_read_long_columns_s, parameter_name[i]);
             }
 
             status = F_status_set_error(F_parameter);
@@ -172,15 +172,15 @@ extern "C" {
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) {
         if (main->parameters.array[fss_extended_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_extended_read_long_pipe_s, fss_extended_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_extended_read_long_pipe_s, fss_extended_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
         }
         else if (main->parameters.array[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_extended_read_long_pipe_s, fss_extended_read_long_line_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_extended_read_long_pipe_s, fss_extended_read_long_line_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -212,13 +212,13 @@ extern "C" {
           length = data.argv[index].used;
 
           if (!length) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, main->error.notable);
             fl_print_format("%[' must not be empty.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
 
@@ -345,13 +345,13 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_select_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, main->error.notable);
         fl_print_format("%[' parameter requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         fss_extended_read_depths_resize(0, &data.depths);
 
@@ -522,9 +522,9 @@ extern "C" {
       status = F_status_set_error(F_parameter);
     }
 
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
       }
index fedaa0ed22a9b72df757605235286e34344f18be..6a8356e2ff3c4d15506f6c16ee9b820aa92992a9 100644 (file)
@@ -189,8 +189,8 @@ extern "C" {
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
@@ -198,14 +198,14 @@ extern "C" {
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
         }
         else if (data->depths.array[i].depth > data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, main->error.notable);
@@ -215,7 +215,7 @@ extern "C" {
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[j].depth, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
index f4323601f075f209422a89ca66f2858772c47d57..c8dbc479b75bd5fe8250987c317c392caf789912 100644 (file)
@@ -125,261 +125,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_extended_write_parameter_from_bytesequence_e, fss_extended_write_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_extended_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_extended_write_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_extended_write_mode_from_codepoint_e) {
-            setting->mode -= fss_extended_write_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_extended_write_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_extended_write_parameter_from_codepoint_e) {
-          if (setting->mode & fss_extended_write_mode_from_bytesequence_e) {
-            setting->mode -= fss_extended_write_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_extended_write_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_extended_write_parameter_to_bytesequence_e, fss_extended_write_parameter_to_codepoint_e, fss_extended_write_parameter_to_combining_e, fss_extended_write_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_extended_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_extended_write_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_extended_write_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_write_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_extended_write_mode_to_combining_e) {
-            setting->mode -= fss_extended_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_extended_write_mode_to_width_e) {
-            setting->mode -= fss_extended_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_write_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_extended_write_parameter_to_codepoint_e) {
-          if (setting->mode & fss_extended_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_write_mode_to_combining_e) {
-            setting->mode -= fss_extended_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_extended_write_mode_to_width_e) {
-            setting->mode -= fss_extended_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_write_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_extended_write_parameter_to_combining_e) {
-          if (setting->mode & fss_extended_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_write_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_extended_write_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_extended_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_extended_write_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_extended_write_parameter_to_width_e) {
-          if (setting->mode & fss_extended_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_extended_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_extended_write_mode_to_codepoint_e) {
-            setting->mode -= fss_extended_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_extended_write_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_extended_write_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_extended_write_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_extended_write_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_extended_write_parameter_to_file_e].values.used > 1) {
-        fss_extended_write_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_extended_write_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_extended_write_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_extended_write_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_extended_write_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_extended_write_main_flag_file_to_e;
-      }
-      else {
-        fss_extended_write_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_extended_write_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_extended_write_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_extended_write_print_error_no_value(main, setting, fss_extended_write_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_extended_write_main_flag_file_to_e) {
-        setting->flag -= fss_extended_write_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_extended_write_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_extended_write_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_extended_write_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_extended_write_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_extended_write_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_extended_write_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_extended_write_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_extended_write_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_extended_write_print_error_no_value(main, setting, fss_extended_write_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_extended_write_main_flag_file_from_e) {
-        setting->flag -= fss_extended_write_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_extended_write_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_extended_write_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_extended_write_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_extended_write_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_extended_write_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_extended_write_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_extended_write_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_extended_write_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_extended_write_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_extended_write_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_extended_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_extended_write_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_extended_write_setting_load_
 
index de6d4b9a204f34f566c175eff5dba42fecb509d4..8dd62a9a2a0f6c32e19b0ba1278de2194a71d30b 100644 (file)
@@ -79,14 +79,14 @@ extern "C" {
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_additional_e) {
         if (main->parameters.array[fss_extended_write_parameter_file_e].values.used > 1) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_file_s, main->error.notable);
             fl_print_format("%[' may only be specified once.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -126,8 +126,8 @@ extern "C" {
           }
           else if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_write_parameter_partial_e].locations.used) {
             if (main->parameters.array[fss_extended_write_parameter_content_e].result == f_console_result_additional_e) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
@@ -137,7 +137,7 @@ extern "C" {
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
                 fl_print_format("%[' parameter, but not both.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -152,8 +152,8 @@ extern "C" {
               f_array_length_t location_sub_content = main->parameters.array[fss_extended_write_parameter_content_e].locations_sub.array[0];
 
               if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) {
-                if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                  flockfile(main->error.to.stream);
+                if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                  f_file_stream_lock(main->error.to);
 
                   fl_print_format("%r%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                   fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
@@ -161,7 +161,7 @@ extern "C" {
                   fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
                   fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                  funlockfile(main->error.to.stream);
+                  f_file_stream_unlock(main->error.to);
                 }
 
                 status = F_status_set_error(F_parameter);
@@ -173,8 +173,8 @@ extern "C" {
                 location_sub_content = main->parameters.array[fss_extended_write_parameter_content_e].locations_sub.array[main->parameters.array[fss_extended_write_parameter_content_e].locations_sub.used - 1];
 
                 if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) {
-                  if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                    flockfile(main->error.to.stream);
+                  if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                    f_file_stream_lock(main->error.to);
 
                     fl_print_format("%r%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
@@ -182,7 +182,7 @@ extern "C" {
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
                     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                    funlockfile(main->error.to.stream);
+                    f_file_stream_unlock(main->error.to);
                   }
 
                   status = F_status_set_error(F_parameter);
@@ -203,8 +203,8 @@ extern "C" {
         }
       }
       else if (!(main->pipe & fll_program_data_pipe_input_e)) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        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.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
@@ -212,7 +212,7 @@ extern "C" {
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
           fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -220,14 +220,14 @@ extern "C" {
 
       if (F_status_is_error_not(status) && (main->pipe & fll_program_data_pipe_input_e)) {
         if (main->parameters.array[fss_extended_write_parameter_partial_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
             fl_print_format("%[' parameter cannot be used when processing a pipe.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -237,14 +237,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_extended_write_parameter_prepend_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
           fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -263,14 +263,14 @@ extern "C" {
             if (F_status_is_error(status)) break;
 
             if (status == F_false) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
                 fl_print_format("%[' must only contain white space.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -280,14 +280,14 @@ extern "C" {
           } // for
         }
         else {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
             fl_print_format("%[' must not be an empty string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -297,14 +297,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_extended_write_parameter_ignore_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' was specified, but no values were given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -314,13 +314,13 @@ extern "C" {
         const f_array_length_t total_arguments = main->parameters.array[fss_extended_write_parameter_ignore_e].values.used;
 
         if (total_locations * 2 > total_arguments) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' requires two values.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           status = F_status_set_error(F_parameter);
         }
@@ -352,13 +352,13 @@ extern "C" {
         status = fss_extended_write_process_pipe(main, output, quote, &buffer);
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
       }
@@ -476,16 +476,16 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
-        else if (main->error.verbosity != f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_none_e) {
+        else if (main->error.verbosity > f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_none_e) {
 
           // Ensure there is always a newline at the end, unless in quiet mode.
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -501,10 +501,10 @@ extern "C" {
     }
 
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_is_error(status)) {
         if (F_status_set_fine(status) == F_interrupt) {
-          fflush(main->output.to.stream);
+          f_file_stream_flush(main->output.to);
         }
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
index c1cdbe45053db7fa892c807c43217356c562bc9e..64b7ae277c379f29bf76f4bbe85e85ae66340b55 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
@@ -23,7 +23,7 @@ extern "C" {
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_extended_write_error_parameter_at_least_once_print_
 
@@ -34,13 +34,13 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
     fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_extended_write_error_parameter_value_missing_print_
 
@@ -51,7 +51,7 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe FSS-0001 (Extended) standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
@@ -59,7 +59,7 @@ extern "C" {
     fl_print_format("%[U+000A%]", main->error.to.stream, main->error.notable, main->error.notable);
     fl_print_format("%[) in objects.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_extended_write_error_parameter_unsupported_eol_print_
 
index 2e87b1848800595d81cacb6d9c0179acb1572578..06971ea03769680878a9c2c38d0a794ce02382f3 100644 (file)
@@ -110,261 +110,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_identify_parameter_from_bytesequence_e, fss_identify_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_identify_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_identify_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_identify_mode_from_codepoint_e) {
-            setting->mode -= fss_identify_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_identify_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_identify_parameter_from_codepoint_e) {
-          if (setting->mode & fss_identify_mode_from_bytesequence_e) {
-            setting->mode -= fss_identify_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_identify_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_identify_parameter_to_bytesequence_e, fss_identify_parameter_to_codepoint_e, fss_identify_parameter_to_combining_e, fss_identify_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_identify_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_identify_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_identify_mode_to_codepoint_e) {
-            setting->mode -= fss_identify_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_identify_mode_to_combining_e) {
-            setting->mode -= fss_identify_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_identify_mode_to_width_e) {
-            setting->mode -= fss_identify_mode_to_width_e;
-          }
-
-          setting->mode |= fss_identify_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_identify_parameter_to_codepoint_e) {
-          if (setting->mode & fss_identify_mode_to_bytesequence_e) {
-            setting->mode -= fss_identify_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_identify_mode_to_combining_e) {
-            setting->mode -= fss_identify_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_identify_mode_to_width_e) {
-            setting->mode -= fss_identify_mode_to_width_e;
-          }
-
-          setting->mode |= fss_identify_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_identify_parameter_to_combining_e) {
-          if (setting->mode & fss_identify_mode_to_bytesequence_e) {
-            setting->mode -= fss_identify_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_identify_mode_to_codepoint_e) {
-            setting->mode -= fss_identify_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_identify_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_identify_mode_to_width_e;
-          }
-
-          setting->mode |= fss_identify_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_identify_parameter_to_width_e) {
-          if (setting->mode & fss_identify_mode_to_bytesequence_e) {
-            setting->mode -= fss_identify_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_identify_mode_to_codepoint_e) {
-            setting->mode -= fss_identify_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_identify_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_identify_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_identify_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_identify_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_identify_parameter_to_file_e].values.used > 1) {
-        fss_identify_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_identify_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_identify_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_identify_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_identify_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_identify_main_flag_file_to_e;
-      }
-      else {
-        fss_identify_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_identify_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_identify_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_identify_print_error_no_value(main, setting, fss_identify_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_identify_main_flag_file_to_e) {
-        setting->flag -= fss_identify_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_identify_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_identify_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_identify_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_identify_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_identify_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_identify_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_identify_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_identify_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_identify_print_error_no_value(main, setting, fss_identify_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_identify_main_flag_file_from_e) {
-        setting->flag -= fss_identify_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_identify_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_identify_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_identify_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_identify_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_identify_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_identify_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_identify_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_identify_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_identify_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_identify_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_identify_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_identify_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_identify_setting_load_
 
index f5a07113504c16ac27f0a5e8c8c74f0bff5f2b51..671b0a825821dd52da1549852b3bbb9f7e370072 100644 (file)
@@ -74,13 +74,13 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_line_s, main->error.notable);
         fl_print_format("%[' requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
@@ -97,15 +97,15 @@ extern "C" {
 
     if (F_status_is_error_not(status) && main->parameters.array[fss_identify_parameter_total_e].result == f_console_result_found_e) {
       if (main->parameters.array[fss_identify_parameter_object_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          fll_program_parameter_long_print_cannot_use_with(main->error, fss_identify_long_object_s, fss_identify_long_total_s);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_identify_long_object_s, fss_identify_long_total_s);
         }
 
         status = F_status_set_error(F_parameter);
       }
       else if (main->parameters.array[fss_identify_parameter_content_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          fll_program_parameter_long_print_cannot_use_with(main->error, fss_identify_long_content_s, fss_identify_long_total_s);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_identify_long_content_s, fss_identify_long_total_s);
         }
 
         status = F_status_set_error(F_parameter);
@@ -114,13 +114,13 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_identify_parameter_name_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
         fl_print_format("%[' requires a string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         status = F_status_set_error(F_parameter);
       }
@@ -130,13 +130,13 @@ extern "C" {
         const f_string_range_t range = macro_f_string_range_t_initialize2(length);
 
         if (length == 0) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
           fl_print_format("%[' does not allow zero length strings.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           status = F_status_set_error(F_parameter);
         }
@@ -160,7 +160,7 @@ extern "C" {
               break;
             }
             else if (status == F_false) {
-              flockfile(main->error.to.stream);
+              f_file_stream_lock(main->error.to);
 
               fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
               fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, data.argv[index], main->error.notable);
@@ -168,7 +168,7 @@ extern "C" {
               fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
               fl_print_format("%[' may only contain word characters or the dash (minus)y character.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-              funlockfile(main->error.to.stream);
+              f_file_stream_unlock(main->error.to);
 
               status = F_status_set_error(F_parameter);
 
@@ -249,10 +249,10 @@ extern "C" {
     }
 
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_is_error(status)) {
         if (F_status_set_fine(status) == F_interrupt) {
-          fflush(main->output.to.stream);
+          f_file_stream_flush(main->output.to);
         }
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
index 49fdb5d55f82609db372360f9f773ab4660ac69e..2b51e5cc262b04085cfa9f9a29c32707907de5ba 100644 (file)
@@ -135,261 +135,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_payload_read_parameter_from_bytesequence_e, fss_payload_read_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_payload_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_payload_read_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_payload_read_mode_from_codepoint_e) {
-            setting->mode -= fss_payload_read_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_payload_read_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_payload_read_parameter_from_codepoint_e) {
-          if (setting->mode & fss_payload_read_mode_from_bytesequence_e) {
-            setting->mode -= fss_payload_read_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_payload_read_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_payload_read_parameter_to_bytesequence_e, fss_payload_read_parameter_to_codepoint_e, fss_payload_read_parameter_to_combining_e, fss_payload_read_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          fss_payload_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_payload_read_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_payload_read_mode_to_codepoint_e) {
-            setting->mode -= fss_payload_read_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_payload_read_mode_to_combining_e) {
-            setting->mode -= fss_payload_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_payload_read_mode_to_width_e) {
-            setting->mode -= fss_payload_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_payload_read_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_payload_read_parameter_to_codepoint_e) {
-          if (setting->mode & fss_payload_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_payload_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_payload_read_mode_to_combining_e) {
-            setting->mode -= fss_payload_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_payload_read_mode_to_width_e) {
-            setting->mode -= fss_payload_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_payload_read_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_payload_read_parameter_to_combining_e) {
-          if (setting->mode & fss_payload_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_payload_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_payload_read_mode_to_codepoint_e) {
-            setting->mode -= fss_payload_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_payload_read_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_payload_read_mode_to_width_e;
-          }
-
-          setting->mode |= fss_payload_read_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_payload_read_parameter_to_width_e) {
-          if (setting->mode & fss_payload_read_mode_to_bytesequence_e) {
-            setting->mode -= fss_payload_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_payload_read_mode_to_codepoint_e) {
-            setting->mode -= fss_payload_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_payload_read_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_payload_read_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_payload_read_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_payload_read_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_payload_read_parameter_to_file_e].values.used > 1) {
-        fss_payload_read_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_payload_read_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_payload_read_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_payload_read_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_payload_read_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_payload_read_main_flag_file_to_e;
-      }
-      else {
-        fss_payload_read_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_payload_read_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_payload_read_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_payload_read_print_error_no_value(main, setting, fss_payload_read_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_payload_read_main_flag_file_to_e) {
-        setting->flag -= fss_payload_read_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_payload_read_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_payload_read_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_payload_read_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_payload_read_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_payload_read_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_payload_read_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_payload_read_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_payload_read_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_payload_read_print_error_no_value(main, setting, fss_payload_read_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_payload_read_main_flag_file_from_e) {
-        setting->flag -= fss_payload_read_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_payload_read_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_payload_read_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_payload_read_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_payload_read_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_payload_read_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_payload_read_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_payload_read_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_payload_read_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_payload_read_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_payload_read_main_flag_separate_e;
-    }
-
     if (main->parameters.array[fss_payload_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= fss_payload_read_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_payload_read_setting_load_
 
index 4b536ae336a03f0d2849b32f4650cfb5d198d9ba..40cb7c3d402eb4422d6cc795509d8800fb22d39d 100644 (file)
@@ -126,13 +126,13 @@ extern "C" {
         for (f_array_length_t i = 0; i < 6; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
             fl_print_format("%[' requires a %s.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
             break;
@@ -168,8 +168,8 @@ extern "C" {
         for (f_array_length_t i = 0; i < 5; ++i) {
 
           if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) {
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
-              fll_program_parameter_long_print_cannot_use_with(main->error, fss_payload_read_long_columns_s, parameter_name[i]);
+            if (main->error.verbosity > f_console_verbosity_quiet_e) {
+              fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_payload_read_long_columns_s, parameter_name[i]);
             }
 
             status = F_status_set_error(F_parameter);
@@ -181,15 +181,15 @@ extern "C" {
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
         if (main->parameters.array[fss_payload_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_payload_read_long_pipe_s, fss_payload_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_payload_read_long_pipe_s, fss_payload_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
         }
         else if (main->parameters.array[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, fss_payload_read_long_pipe_s, fss_payload_read_long_line_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_payload_read_long_pipe_s, fss_payload_read_long_line_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -221,13 +221,13 @@ extern "C" {
           length = data.argv[index].used;
 
           if (!length) {
-            flockfile(main->error.to.stream);
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_delimit_s, main->error.notable);
             fl_print_format("%[' must not be empty.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
 
             status = F_status_set_error(F_parameter);
 
@@ -367,13 +367,13 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_select_e].result == f_console_result_found_e) {
-        flockfile(main->error.to.stream);
+        f_file_stream_lock(main->error.to);
 
         fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
         fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, main->error.notable);
         fl_print_format("%[' parameter requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-        funlockfile(main->error.to.stream);
+        f_file_stream_unlock(main->error.to);
 
         fss_payload_read_depths_resize(0, &data.depths);
 
@@ -536,9 +536,9 @@ extern "C" {
       status = F_status_set_error(F_parameter);
     }
 
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
 
         fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
       }
index d99d35d7d6d181eab5da01e10f35bfd5852e08eb..b43252f339f7834e80fba2ce05691118f5887ee1 100644 (file)
@@ -185,23 +185,17 @@ extern "C" {
         }
 
         if (data->depths.array[i].depth == data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity < f_console_verbosity_normal_e) {
+            fss_payload_read_print_line_first(setting, main->error, F_true);
 
-            fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-            fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
-            fl_print_format("%[' may only be specified once for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
-            fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, main->error.notable);
-            fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
-
-            funlockfile(main->error.to.stream);
+            fll_program_print_error_parameter_must_specify_once_value(main->error, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, data->depths.array[i].depth);
           }
 
           return F_status_set_error(F_parameter);
         }
         else if (data->depths.array[i].depth > data->depths.array[j].depth) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, main->error.notable);
@@ -211,7 +205,7 @@ extern "C" {
             fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[j].depth, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           return F_status_set_error(F_parameter);
@@ -257,8 +251,8 @@ extern "C" {
       const f_string_static_t file_name = fss_payload_read_file_identify(input.start, data->files);
 
       if (F_status_set_fine(status) == F_none || F_status_set_fine(status) == F_none_eos || F_status_set_fine(status) == F_none_stop || F_status_set_fine(status) == F_data_not_eos || F_status_set_fine(status) == F_data_not_stop) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, file_name, main->error.notable);
@@ -266,7 +260,7 @@ extern "C" {
           fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, f_fss_string_payload_s, main->error.notable);
           fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
       }
       else {
index 84a5dcfd4eb833b496ab117ed3e85360fca78a5f..6af79f4d0ae035a71811817fd2baf6f3fd85defd 100644 (file)
@@ -115,261 +115,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { fss_payload_write_parameter_from_bytesequence_e, fss_payload_write_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        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), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_payload_write_parameter_from_bytesequence_e) {
-          if (setting->mode & fss_payload_write_mode_from_codepoint_e) {
-            setting->mode -= fss_payload_write_mode_from_codepoint_e;
-          }
-
-          setting->mode |= fss_payload_write_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_payload_write_parameter_from_codepoint_e) {
-          if (setting->mode & fss_payload_write_mode_from_bytesequence_e) {
-            setting->mode -= fss_payload_write_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= fss_payload_write_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { fss_payload_write_parameter_to_bytesequence_e, fss_payload_write_parameter_to_codepoint_e, fss_payload_write_parameter_to_combining_e, fss_payload_write_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        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), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == fss_payload_write_parameter_to_bytesequence_e) {
-          if (setting->mode & fss_payload_write_mode_to_codepoint_e) {
-            setting->mode -= fss_payload_write_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & fss_payload_write_mode_to_combining_e) {
-            setting->mode -= fss_payload_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_payload_write_mode_to_width_e) {
-            setting->mode -= fss_payload_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_payload_write_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == fss_payload_write_parameter_to_codepoint_e) {
-          if (setting->mode & fss_payload_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_payload_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_payload_write_mode_to_combining_e) {
-            setting->mode -= fss_payload_write_mode_to_combining_e;
-          }
-
-          if (setting->mode & fss_payload_write_mode_to_width_e) {
-            setting->mode -= fss_payload_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_payload_write_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == fss_payload_write_parameter_to_combining_e) {
-          if (setting->mode & fss_payload_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_payload_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_payload_write_mode_to_codepoint_e) {
-            setting->mode -= fss_payload_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_payload_write_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= fss_payload_write_mode_to_width_e;
-          }
-
-          setting->mode |= fss_payload_write_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == fss_payload_write_parameter_to_width_e) {
-          if (setting->mode & fss_payload_write_mode_to_bytesequence_e) {
-            setting->mode -= fss_payload_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & fss_payload_write_mode_to_codepoint_e) {
-            setting->mode -= fss_payload_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[fss_payload_write_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= fss_payload_write_mode_to_combining_e;
-          }
-
-          setting->mode |= fss_payload_write_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[fss_payload_write_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[fss_payload_write_parameter_to_file_e].values.used > 1) {
-        fss_payload_write_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[fss_payload_write_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[fss_payload_write_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[fss_payload_write_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[fss_payload_write_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= fss_payload_write_main_flag_file_to_e;
-      }
-      else {
-        fss_payload_write_print_error_parameter_file_name_empty(main, setting, main->parameters.array[fss_payload_write_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[fss_payload_write_parameter_to_file_e].result == f_console_result_found_e) {
-      fss_payload_write_print_error_no_value(main, setting, fss_payload_write_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & fss_payload_write_main_flag_file_to_e) {
-        setting->flag -= fss_payload_write_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[fss_payload_write_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[fss_payload_write_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[fss_payload_write_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[fss_payload_write_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            fss_payload_write_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          fss_payload_write_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= fss_payload_write_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[fss_payload_write_parameter_from_file_e].result == f_console_result_found_e) {
-      fss_payload_write_print_error_no_value(main, setting, fss_payload_write_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & fss_payload_write_main_flag_file_from_e) {
-        setting->flag -= fss_payload_write_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[fss_payload_write_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      fss_payload_write_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & fss_payload_write_mode_to_bytesequence_e)) {
-      if (main->parameters.array[fss_payload_write_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[fss_payload_write_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = fss_payload_write_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[fss_payload_write_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= fss_payload_write_main_flag_header_e;
-    }
-
-    if (main->parameters.array[fss_payload_write_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= fss_payload_write_main_flag_separate_e;
-    }
-
     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;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_fss_payload_write_setting_load_
 
index 0669bb8cbed62cf74c187624fd80fa1050d0f074..5a8222fe5a26a592ff44e97524cfe9068b84b04e 100644 (file)
@@ -90,14 +90,8 @@ extern "C" {
     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_quiet_e) {
-            flockfile(main->error.to.stream);
-
-            fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-            fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_file_s, main->error.notable);
-            fl_print_format("%[' may only be specified once.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
-
-            funlockfile(main->error.to.stream);
+          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);
           }
 
           status = F_status_set_error(F_parameter);
@@ -137,8 +131,8 @@ extern "C" {
           }
           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) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
@@ -148,7 +142,7 @@ extern "C" {
                 fl_print_format("%[%r%r%]", main->error.to.stream, 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.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -169,8 +163,8 @@ extern "C" {
                 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) {
-                    flockfile(main->error.to.stream);
+                  if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                    f_file_stream_lock(main->error.to);
 
                     fl_print_format("%r%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
@@ -178,7 +172,7 @@ extern "C" {
                     fl_print_format("%[%r%r%]", main->error.to.stream, 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.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                    funlockfile(main->error.to.stream);
+                    f_file_stream_unlock(main->error.to);
                   }
 
                   status = F_status_set_error(F_parameter);
@@ -200,8 +194,8 @@ extern "C" {
         }
       }
       else if (!(main->pipe & fll_program_data_pipe_input_e)) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        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.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
@@ -209,7 +203,7 @@ extern "C" {
           fl_print_format("%[%r%r%]", main->error.to.stream, 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.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -217,14 +211,14 @@ extern "C" {
 
       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) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, 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.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -234,14 +228,14 @@ extern "C" {
 
     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) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, 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.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -259,14 +253,14 @@ extern "C" {
             if (F_status_is_error(status)) break;
 
             if (status == F_false) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                flockfile(main->error.to.stream);
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
+                f_file_stream_lock(main->error.to);
 
                 fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
                 fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
                 fl_print_format("%[' must only contain white space.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-                funlockfile(main->error.to.stream);
+                f_file_stream_unlock(main->error.to);
               }
 
               status = F_status_set_error(F_parameter);
@@ -275,14 +269,14 @@ extern "C" {
           } // for
         }
         else {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
             fl_print_format("%[' must not be an empty string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
@@ -292,14 +286,14 @@ extern "C" {
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_payload_write_parameter_ignore_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' was specified, but no values were given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -309,13 +303,13 @@ extern "C" {
         const f_array_length_t total_arguments = main->parameters.array[fss_payload_write_parameter_ignore_e].values.used;
 
         if (total_locations * 2 > total_arguments) {
-          flockfile(main->error.to.stream);
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_ignore_s, main->error.notable);
           fl_print_format("%[' requires two values.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
 
           status = F_status_set_error(F_parameter);
         }
@@ -346,13 +340,13 @@ extern "C" {
         status = fss_payload_write_process_pipe(main, output, quote, &buffer);
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
       }
@@ -420,16 +414,16 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
             fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
         }
-        else if (main->error.verbosity != f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_none_e) {
+        else if (main->error.verbosity > f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_none_e) {
 
           // Ensure there is always a newline at the end, unless in quiet mode.
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -445,7 +439,7 @@ extern "C" {
     }
 
     // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
+    if (main->error.verbosity > f_console_verbosity_quiet_e) {
       if (F_status_is_error(status)) {
         fll_print_dynamic_raw(f_string_eol_s, main->error.to.stream);
       }
index 3b93b2abfa04671db3dca8f49125e549be02dfa3..6c574d0aa7342d57775dc03fc5c795820795a922 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
@@ -23,7 +23,7 @@ extern "C" {
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
     fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_payload_write_error_parameter_same_times_print_
 
@@ -34,7 +34,7 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe FSS-000E (Payload) standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
@@ -42,7 +42,7 @@ extern "C" {
     fl_print_format("%[U+000A%]", main->error.to.stream, main->error.notable, main->error.notable);
     fl_print_format("%[) in objects.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_payload_write_error_parameter_unsupported_eol_print_
 
@@ -53,13 +53,13 @@ extern "C" {
       return;
     }
 
-    flockfile(main->error.to.stream);
+    f_file_stream_lock(main->error.to);
 
     fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
     fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
     fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-    funlockfile(main->error.to.stream);
+    f_file_stream_unlock(main->error.to);
   }
 #endif // _di_fss_payload_write_error_parameter_value_missing_print_
 
@@ -344,7 +344,7 @@ extern "C" {
           for (; range.start <= range.stop; ++range.start) {
 
             if (block.string[range.start] == fss_payload_write_pipe_content_start_s.string[0]) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
+              if (main->error.verbosity > f_console_verbosity_quiet_e) {
                 fll_print_format("%r%[%QThe FSS-000E (Payload) standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
index 0d5f5481b840d8d6a55d763a6eccda2b4959d7c2..4bd0140a24e2f726973bf4ffe3ce95617914927e 100644 (file)
@@ -55,7 +55,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_status_code_print_line_first(setting, main->error, F_true);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      fss_status_code_print_line_last(setting, main->error, F_true);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -145,43 +152,43 @@ extern "C" {
     if (setting->flag & fss_status_code_main_flag_error_e) {
       if (setting->flag & fss_status_code_main_flag_warning_e) {
         if (!(setting->flag & fss_status_code_main_flag_number_e)) {
+          setting->status = F_status_set_error(F_parameter);
+
           fss_status_code_print_line_first(setting, main->error, F_true);
           fss_status_code_print_error_cannot_error_warning_number(setting, main->error);
           fss_status_code_print_line_last(setting, main->error, F_true);
 
-          setting->status = F_status_set_error(F_parameter);
-
           return;
         }
       }
 
       if (setting->flag & fss_status_code_main_flag_fine_e) {
+        setting->status = F_status_set_error(F_parameter);
+
         fss_status_code_print_line_first(setting, main->error, F_true);
-        fll_program_parameter_long_print_cannot_use_with(main->error, fss_status_code_long_error_s, fss_status_code_long_fine_s);
+        fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_status_code_long_error_s, fss_status_code_long_fine_s);
         fss_status_code_print_line_last(setting, main->error, F_true);
 
-        setting->status = F_status_set_error(F_parameter);
-
         return;
       }
     }
     else if (setting->flag & fss_status_code_main_flag_warning_e && setting->flag & fss_status_code_main_flag_fine_e) {
+      setting->status = F_status_set_error(F_parameter);
+
       fss_status_code_print_line_first(setting, main->error, F_true);
-      fll_program_parameter_long_print_cannot_use_with(main->error, fss_status_code_long_warning_s, fss_status_code_long_fine_s);
+      fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, fss_status_code_long_warning_s, fss_status_code_long_fine_s);
       fss_status_code_print_line_last(setting, main->error, F_true);
 
-      setting->status = F_status_set_error(F_parameter);
-
       return;
     }
 
     if (main->parameters.remaining.used == 0 && !(main->pipe & fll_program_data_pipe_input_e)) {
+      setting->status = F_status_set_error(F_parameter);
+
       fss_status_code_print_line_first(setting, main->error, F_true);
       fss_status_code_print_error_no_fss_status_codes(setting, main->error);
       fss_status_code_print_line_last(setting, main->error, F_true);
 
-      setting->status = F_status_set_error(F_parameter);
-
       return;
     }
   }
index 3b580e4f6b99e7656de81c87f24cb9882662bfb3..8e48fb0d7f15d4e20e44642d7be9e2a54b89dc57 100644 (file)
@@ -9,17 +9,7 @@ extern "C" {
 #ifndef _di_fss_status_code_main_
   void fss_status_code_main(fll_program_data_t * const main, fss_status_code_setting_t * const setting) {
 
-    if (!main || !setting) {
-      fss_status_code_print_line_first(setting, main->error, F_true);
-      fll_error_print(main->error, F_parameter, "fss_status_code_main", F_true);
-      fss_status_code_print_line_last(setting, main->error, F_true);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-
-    if (F_status_is_error(setting->status)) return;
+    if (!main || !setting || F_status_is_error(setting->status)) return;
 
     setting->status = F_none;
 
index f0d58a242e5b4be445ab73d3a4d75bbd55f3bd37..377018b183db40745bf17ff4be0524fa2ec8b5d3 100644 (file)
@@ -7,9 +7,9 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_status_code_print_error_cannot_error_warning_number_
-  void fss_status_code_print_error_cannot_error_warning_number(fss_status_code_setting_t * const setting, const fl_print_t print) {
+  f_status_t fss_status_code_print_error_cannot_error_warning_number(fss_status_code_setting_t * const setting, const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -22,15 +22,19 @@ extern "C" {
     fl_print_format("%[' parameter.%]%r", print.to.stream, print.context, print.context, f_string_eol_s);
 
     f_file_stream_unlock(print.to);
+
+    return F_none;
   }
 #endif // _di_fss_status_code_print_error_cannot_error_warning_number_
 
 #ifndef _di_fss_status_code_print_error_no_fss_status_codes_
-  void fss_status_code_print_error_no_fss_status_codes(fss_status_code_setting_t * const setting, const fl_print_t print) {
+  f_status_t fss_status_code_print_error_no_fss_status_codes(fss_status_code_setting_t * const setting, const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     fll_print_format("%[No status code is specified.%]%r", print.to.stream, print.context, print.context, f_string_eol_s);
+
+    return F_none;
   }
 #endif // _di_fss_status_code_print_error_no_fss_status_codes_
 
@@ -64,9 +68,9 @@ extern "C" {
 #endif // _di_fss_status_code_print_help_
 
 #ifndef _di_fss_status_code_print_line_first_
-  void fss_status_code_print_line_first(fss_status_code_setting_t * const setting, const fl_print_t print, const bool lock) {
+  f_status_t fss_status_code_print_line_first(fss_status_code_setting_t * const setting, const fl_print_t print, const bool lock) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     if (lock) {
       fll_print_dynamic_raw(setting->line_first, print.to.stream);
@@ -74,14 +78,16 @@ extern "C" {
     else {
       f_print_dynamic_raw(setting->line_first, print.to.stream);
     }
+
+    return F_none;
   }
 #endif // _di_fss_status_code_print_line_first_
 
 #ifndef _di_fss_status_code_print_line_last_
-  void fss_status_code_print_line_last(fss_status_code_setting_t * const setting, const fl_print_t print, const bool lock) {
+  f_status_t fss_status_code_print_line_last(fss_status_code_setting_t * const setting, const fl_print_t print, const bool lock) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
-    if (print.verbosity == f_console_verbosity_error_e && !F_status_is_error(setting->status)) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity == f_console_verbosity_error_e && !F_status_is_error(setting->status)) return F_output_not;
 
     if (lock) {
       fll_print_dynamic_raw(setting->line_last, print.to.stream);
@@ -89,6 +95,8 @@ extern "C" {
     else {
       f_print_dynamic_raw(setting->line_last, print.to.stream);
     }
+
+    return F_none;
   }
 #endif // _di_fss_status_code_print_line_last_
 
index cca7957d539774f8668d991daacccfd002f73cc2..aa007215b1d9a042ae8de24ef49d4a6dd1a79a3e 100644 (file)
@@ -20,9 +20,13 @@ extern "C" {
  *   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_status_code_print_error_cannot_error_warning_number_
-  extern void fss_status_code_print_error_cannot_error_warning_number(fss_status_code_setting_t * const setting, const fl_print_t print);
+  extern f_status_t fss_status_code_print_error_cannot_error_warning_number(fss_status_code_setting_t * const setting, const fl_print_t print);
 #endif // _di_fss_status_code_print_error_cannot_error_warning_number_
 
 /**
@@ -33,9 +37,13 @@ extern "C" {
  *   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_status_code_print_error_no_fss_status_codes_
-  extern void fss_status_code_print_error_no_fss_status_codes(fss_status_code_setting_t * const setting, const fl_print_t print);
+  extern f_status_t fss_status_code_print_error_no_fss_status_codes(fss_status_code_setting_t * const setting, const fl_print_t print);
 #endif // _di_fss_status_code_print_error_no_fss_status_codes_
 
 /**
@@ -49,6 +57,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_fss_status_code_print_help_
   extern f_status_t fss_status_code_print_help(fss_status_code_setting_t * const setting, const fl_print_t print);
@@ -67,9 +76,13 @@ extern "C" {
  * @param lock
  *   If TRUE, then lock the stream.
  *   If FALSE, then do not lock or unlock the stream.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_fss_status_code_print_line_first_
-  extern void fss_status_code_print_line_first(fss_status_code_setting_t * const setting, const fl_print_t print, const bool lock);
+  extern f_status_t fss_status_code_print_line_first(fss_status_code_setting_t * const setting, const fl_print_t print, const bool lock);
 #endif // _di_fss_status_code_print_line_first_
 
 /**
@@ -85,9 +98,13 @@ extern "C" {
  * @param lock
  *   If TRUE, then lock the stream.
  *   If FALSE, then do not lock or unlock the stream.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_fss_status_code_print_line_last_
-  extern void fss_status_code_print_line_last(fss_status_code_setting_t * const setting, const fl_print_t print, const bool lock);
+  extern f_status_t fss_status_code_print_line_last(fss_status_code_setting_t * const setting, const fl_print_t print, const bool lock);
 #endif // _di_fss_status_code_print_line_last_
 
 #ifdef __cplusplus
index a0ccf6097963a768487b40c3f123ba70d9239879..932b8db70154e90968461dbe6e57495f08d44744 100644 (file)
@@ -130,261 +130,13 @@ extern "C" {
 
         return;
       }
-
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { iki_read_parameter_from_bytesequence_e, iki_read_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == iki_read_parameter_from_bytesequence_e) {
-          if (setting->mode & iki_read_mode_from_codepoint_e) {
-            setting->mode -= iki_read_mode_from_codepoint_e;
-          }
-
-          setting->mode |= iki_read_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == iki_read_parameter_from_codepoint_e) {
-          if (setting->mode & iki_read_mode_from_bytesequence_e) {
-            setting->mode -= iki_read_mode_from_bytesequence_e;
-          }
-
-          setting->mode |= iki_read_mode_from_codepoint_e;
-        }
-      }
-
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { iki_read_parameter_to_bytesequence_e, iki_read_parameter_to_codepoint_e, iki_read_parameter_to_combining_e, iki_read_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          iki_read_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == iki_read_parameter_to_bytesequence_e) {
-          if (setting->mode & iki_read_mode_to_codepoint_e) {
-            setting->mode -= iki_read_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & iki_read_mode_to_combining_e) {
-            setting->mode -= iki_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & iki_read_mode_to_width_e) {
-            setting->mode -= iki_read_mode_to_width_e;
-          }
-
-          setting->mode |= iki_read_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == iki_read_parameter_to_codepoint_e) {
-          if (setting->mode & iki_read_mode_to_bytesequence_e) {
-            setting->mode -= iki_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & iki_read_mode_to_combining_e) {
-            setting->mode -= iki_read_mode_to_combining_e;
-          }
-
-          if (setting->mode & iki_read_mode_to_width_e) {
-            setting->mode -= iki_read_mode_to_width_e;
-          }
-
-          setting->mode |= iki_read_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == iki_read_parameter_to_combining_e) {
-          if (setting->mode & iki_read_mode_to_bytesequence_e) {
-            setting->mode -= iki_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & iki_read_mode_to_codepoint_e) {
-            setting->mode -= iki_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[iki_read_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= iki_read_mode_to_width_e;
-          }
-
-          setting->mode |= iki_read_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == iki_read_parameter_to_width_e) {
-          if (setting->mode & iki_read_mode_to_bytesequence_e) {
-            setting->mode -= iki_read_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & iki_read_mode_to_codepoint_e) {
-            setting->mode -= iki_read_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[iki_read_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= iki_read_mode_to_combining_e;
-          }
-
-          setting->mode |= iki_read_mode_to_width_e;
-        }
-      }
     }
 
     f_string_static_t * const args = main->parameters.arguments.array;
 
-    if (main->parameters.array[iki_read_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[iki_read_parameter_to_file_e].values.used > 1) {
-        iki_read_print_error_parameter_file_to_too_many(main, setting);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-
-      if (args[main->parameters.array[iki_read_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[iki_read_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[iki_read_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
-
-        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, args[main->parameters.array[iki_read_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
-
-        setting->flag |= iki_read_main_flag_file_to_e;
-      }
-      else {
-        iki_read_print_error_parameter_file_name_empty(main, setting, main->parameters.array[iki_read_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
-
-        return;
-      }
-    }
-    else if (main->parameters.array[iki_read_parameter_to_file_e].result == f_console_result_found_e) {
-      iki_read_print_error_no_value(main, setting, iki_read_long_to_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
-
-      if (setting->flag & iki_read_main_flag_file_to_e) {
-        setting->flag -= iki_read_main_flag_file_to_e;
-      }
-    }
-
-    if (main->parameters.array[iki_read_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[iki_read_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
-
-      setting->path_files_from.used = main->parameters.array[iki_read_parameter_from_file_e].values.used;
-
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
-      for (; i < setting->path_files_from.used; ++i) {
-
-        index = main->parameters.array[iki_read_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
-
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            iki_read_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
-
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          iki_read_print_error_parameter_file_name_empty(main, setting, index);
-
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
-      } // for
-
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= iki_read_main_flag_file_from_e;
-    }
-    else if (main->parameters.array[iki_read_parameter_from_file_e].result == f_console_result_found_e) {
-      iki_read_print_error_no_value(main, setting, iki_read_long_from_file_s);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-    else {
-      if (setting->flag & iki_read_main_flag_file_from_e) {
-        setting->flag -= iki_read_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[iki_read_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      iki_read_print_error_no_from(main, setting);
-
-      setting->status = F_status_set_error(F_parameter);
-    }
-
-    if (!(setting->mode & iki_read_mode_to_bytesequence_e)) {
-      if (main->parameters.array[iki_read_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[iki_read_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = iki_read_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
-
-    if (main->parameters.array[iki_read_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= iki_read_main_flag_header_e;
-    }
-
-    if (main->parameters.array[iki_read_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= iki_read_main_flag_separate_e;
-    }
-
     if (main->parameters.array[iki_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
       setting->flag |= iki_read_main_flag_strip_invalid_e;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_iki_read_setting_load_
 
index 3b03fb6cf172abf712099ef14c33b15884b358a0..4628854123a9ad1cd5c6e662574fe93ed0d38a16 100644 (file)
@@ -78,14 +78,14 @@ extern "C" {
 
     if (main->parameters.remaining.used > 0 || (main->pipe & fll_program_data_pipe_input_e)) {
       if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_at_s, main->error.notable);
           fl_print_format("%[' requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -106,8 +106,8 @@ extern "C" {
         data.at = number;
 
         if (main->parameters.array[iki_read_parameter_whole_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_at_s, iki_read_long_whole_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_at_s, iki_read_long_whole_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -115,14 +115,14 @@ extern "C" {
       }
 
       if (main->parameters.array[iki_read_parameter_line_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_line_s, main->error.notable);
           fl_print_format("%[' requires a positive number.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -144,14 +144,14 @@ extern "C" {
       }
 
       if (main->parameters.array[iki_read_parameter_name_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          f_file_stream_lock(main->error.to);
 
           fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
           fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_name_s, main->error.notable);
           fl_print_format("%[' requires a string.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          f_file_stream_unlock(main->error.to);
         }
 
         status = F_status_set_error(F_parameter);
@@ -159,22 +159,22 @@ extern "C" {
 
       if (main->parameters.array[iki_read_parameter_replace_e].result != f_console_result_none_e) {
         if (main->parameters.array[iki_read_parameter_replace_e].result == f_console_result_found_e || main->parameters.array[iki_read_parameter_replace_e].values.used % 2 != 0) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_replace_s, main->error.notable);
             fl_print_format("%[' requires 2 strings.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
         }
 
         if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_replace_s, iki_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_replace_s, iki_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -183,22 +183,22 @@ extern "C" {
 
       if (main->parameters.array[iki_read_parameter_substitute_e].result != f_console_result_none_e) {
         if (main->parameters.array[iki_read_parameter_substitute_e].result == f_console_result_found_e || main->parameters.array[iki_read_parameter_substitute_e].values.used % 3 != 0) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            f_file_stream_lock(main->error.to);
 
             fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
             fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_substitute_s, main->error.notable);
             fl_print_format("%[' requires 3 strings.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-            funlockfile(main->error.to.stream);
+            f_file_stream_unlock(main->error.to);
           }
 
           status = F_status_set_error(F_parameter);
         }
 
         if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_substitute_s, iki_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_substitute_s, iki_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -207,24 +207,24 @@ extern "C" {
 
       if (main->parameters.array[iki_read_parameter_literal_e].result == f_console_result_found_e) {
         if (main->parameters.array[iki_read_parameter_object_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_literal_s, iki_read_long_object_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_literal_s, iki_read_long_object_s);
           }
 
           status = F_status_set_error(F_parameter);
         }
 
         if (main->parameters.array[iki_read_parameter_content_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_literal_s, iki_read_long_content_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_literal_s, iki_read_long_content_s);
           }
 
           status = F_status_set_error(F_parameter);
         }
 
         if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_literal_s, iki_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_literal_s, iki_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -234,16 +234,16 @@ extern "C" {
       }
       else if (main->parameters.array[iki_read_parameter_object_e].result == f_console_result_found_e) {
         if (main->parameters.array[iki_read_parameter_content_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_object_s, iki_read_long_content_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_object_s, iki_read_long_content_s);
           }
 
           status = F_status_set_error(F_parameter);
         }
 
         if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_object_s, iki_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_object_s, iki_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -262,8 +262,8 @@ extern "C" {
 
       if (main->parameters.array[iki_read_parameter_whole_e].result == f_console_result_found_e) {
         if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_program_parameter_long_print_cannot_use_with(main->error, iki_read_long_whole_s, iki_read_long_total_s);
+          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+            fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, iki_read_long_whole_s, iki_read_long_total_s);
           }
 
           status = F_status_set_error(F_parameter);
@@ -271,7 +271,7 @@ extern "C" {
       }
 
       if (F_status_is_error(status)) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
+        if (main->error.verbosity > f_console_verbosity_quiet_e) {
           fll_print_dynamic_raw(f_string_eol_s, main->error.to.stream);
         }
 
@@ -407,7 +407,7 @@ extern "C" {
       }
     }
     else {
-      if (main->error.verbosity != f_console_verbosity_quiet_e) {
+      if (main->error.verbosity > f_console_verbosity_quiet_e) {
         fll_print_format("%r%[%QYou failed to specify one or more files.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
       }
 
@@ -417,10 +417,10 @@ extern "C" {
     // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
     if (main->output.verbosity != f_console_verbosity_quiet_e) {
       if (F_status_set_fine(status) == F_interrupt) {
-        fflush(main->output.to.stream);
+        f_file_stream_flush(main->output.to);
       }
 
-      fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
+      fll_print_dynamic_raw(f_string_eol_s, main->message.to.stream);
     }
 
     iki_read_data_delete(&data);
index 993dc44dd5cdbd59f34cbfa95f05fd11a9cbefcb..6164233ed10f993c56d9b30bb8dc455fc697379c 100644 (file)
@@ -13,6 +13,10 @@ extern "C" {
   const f_string_static_t iki_write_program_name_long_s = macro_f_string_static_t_initialize(IKI_WRITE_program_name_long_s, 0, IKI_WRITE_program_name_long_s_length);
 #endif // _di_iki_write_program_name_
 
+#ifndef _di_iki_write_strings_
+  const f_string_static_t iki_write_object_s = macro_f_string_static_t_initialize(IKI_WRITE_object_s, 0, IKI_WRITE_object_s_length);
+#endif // _di_iki_write_strings_
+
 #ifndef _di_iki_write_parameters_
   const f_string_static_t iki_write_short_file_s = macro_f_string_static_t_initialize(IKI_WRITE_short_file_s, 0, IKI_WRITE_short_file_s_length);
   const f_string_static_t iki_write_short_content_s = macro_f_string_static_t_initialize(IKI_WRITE_short_content_s, 0, IKI_WRITE_short_content_s_length);
@@ -32,6 +36,14 @@ 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_dynamics_resize(0, &setting->objects);
+    f_string_dynamics_resize(0, &setting->contents);
+
     return F_none;
   }
 #endif // _di_iki_write_setting_delete_
@@ -43,7 +55,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)) {
+      iki_write_print_line_first(setting, main->error, F_true);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      iki_write_print_line_last(setting, main->error, F_true);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -62,6 +81,7 @@ extern "C" {
         if (F_status_is_error(setting->status)) {
           iki_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);
+          iki_write_print_line_last(setting, main->error, F_true);
 
           return;
         }
@@ -94,6 +114,7 @@ extern "C" {
         if (F_status_is_error(setting->status)) {
           iki_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);
+          iki_write_print_line_last(setting, main->error, F_true);
 
           return;
         }
@@ -110,261 +131,148 @@ extern "C" {
 
         return;
       }
+    }
 
-      // Identify and prioritize "from" mode parameters.
-      {
-        uint16_t choices_array[2] = { iki_write_parameter_from_bytesequence_e, iki_write_parameter_from_codepoint_e };
-        choices.array = choices_array;
-        choices.used = 2;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          iki_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
+    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 (choices.array[choice] == iki_write_parameter_from_bytesequence_e) {
-          if (setting->mode & iki_write_mode_from_codepoint_e) {
-            setting->mode -= iki_write_mode_from_codepoint_e;
-          }
+    if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_e) {
+      if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) {
+        setting->status = F_status_set_error(F_parameter);
 
-          setting->mode |= iki_write_mode_from_bytesequence_e;
-        }
-        else if (choices.array[choice] == iki_write_parameter_from_codepoint_e) {
-          if (setting->mode & iki_write_mode_from_bytesequence_e) {
-            setting->mode -= iki_write_mode_from_bytesequence_e;
-          }
+        iki_write_print_line_first(setting, main->error, F_true);
+        fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_enable_s, iki_write_long_file_s);
+        iki_write_print_line_last(setting, main->error, F_true);
 
-          setting->mode |= iki_write_mode_from_codepoint_e;
-        }
+        return;
       }
 
-      // Identify and prioritize "to" mode parameters.
-      {
-        uint16_t choices_array[4] = { iki_write_parameter_to_bytesequence_e, iki_write_parameter_to_codepoint_e, iki_write_parameter_to_combining_e, iki_write_parameter_to_width_e };
-        choices.array = choices_array;
-        choices.used = 4;
-        choice = 1;
-
-        setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
-
-        if (F_status_is_error(setting->status)) {
-          iki_write_print_line_first(setting, main->error, F_true);
-          fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
-
-          return;
-        }
-
-        if (choices.array[choice] == iki_write_parameter_to_bytesequence_e) {
-          if (setting->mode & iki_write_mode_to_codepoint_e) {
-            setting->mode -= iki_write_mode_to_codepoint_e;
-          }
-
-          if (setting->mode & iki_write_mode_to_combining_e) {
-            setting->mode -= iki_write_mode_to_combining_e;
-          }
+      f_string_static_t * const args = main->parameters.arguments.array;
 
-          if (setting->mode & iki_write_mode_to_width_e) {
-            setting->mode -= iki_write_mode_to_width_e;
-          }
+      const f_array_length_t index = main->parameters.array[iki_write_parameter_file_e].values.array[0];
 
-          setting->mode |= iki_write_mode_to_bytesequence_e;
-        }
-        else if (choices.array[choice] == iki_write_parameter_to_codepoint_e) {
-          if (setting->mode & iki_write_mode_to_bytesequence_e) {
-            setting->mode -= iki_write_mode_to_bytesequence_e;
-          }
-
-          if (setting->mode & iki_write_mode_to_combining_e) {
-            setting->mode -= iki_write_mode_to_combining_e;
-          }
+      main->output.to.id = -1;
+      main->output.to.stream = 0;
 
-          if (setting->mode & iki_write_mode_to_width_e) {
-            setting->mode -= iki_write_mode_to_width_e;
-          }
+      setting->status = f_file_stream_open(args[index], f_string_empty_s, &main->output.to);
 
-          setting->mode |= iki_write_mode_to_codepoint_e;
-        }
-        else if (choices.array[choice] == iki_write_parameter_to_combining_e) {
-          if (setting->mode & iki_write_mode_to_bytesequence_e) {
-            setting->mode -= iki_write_mode_to_bytesequence_e;
-          }
+      if (F_status_is_error(setting->status)) {
+        iki_write_print_line_first(setting, main->error, F_true);
+        fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", F_true, args[index], f_file_operation_open_s, fll_error_file_type_file_e);
+        iki_write_print_line_last(setting, main->error, F_true);
 
-          if (setting->mode & iki_write_mode_to_codepoint_e) {
-            setting->mode -= iki_write_mode_to_codepoint_e;
-          }
-
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[iki_write_parameter_to_width_e].result == f_console_result_found_e) {
-            setting->mode |= iki_write_mode_to_width_e;
-          }
-
-          setting->mode |= iki_write_mode_to_combining_e;
-        }
-        else if (choices.array[choice] == iki_write_parameter_to_width_e) {
-          if (setting->mode & iki_write_mode_to_bytesequence_e) {
-            setting->mode -= iki_write_mode_to_bytesequence_e;
-          }
+        return;
+      }
 
-          if (setting->mode & iki_write_mode_to_codepoint_e) {
-            setting->mode -= iki_write_mode_to_codepoint_e;
-          }
+      setting->flag |= iki_write_main_flag_file_to_e;
+    }
+    else if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_found_e) {
+      setting->status = F_status_set_error(F_parameter);
 
-          // --to_width may be specified with --to_combining.
-          if (main->parameters.array[iki_write_parameter_to_combining_e].result == f_console_result_found_e) {
-            setting->mode |= iki_write_mode_to_combining_e;
-          }
+      iki_write_print_line_first(setting, main->error, F_true);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, iki_write_long_file_s);
+      iki_write_print_line_last(setting, main->error, F_true);
 
-          setting->mode |= iki_write_mode_to_width_e;
-        }
-      }
+      return;
     }
 
-    f_string_static_t * const args = main->parameters.arguments.array;
+    if (main->parameters.array[iki_write_parameter_object_e].result == f_console_result_additional_e) {
+      f_array_lengths_t * const values = &main->parameters.array[iki_write_parameter_object_e].values;
 
-    if (main->parameters.array[iki_write_parameter_to_file_e].result == f_console_result_additional_e) {
-      if (main->parameters.array[iki_write_parameter_to_file_e].values.used > 1) {
-        iki_write_print_error_parameter_file_to_too_many(main, setting);
+      setting->objects.used = 0;
 
-        setting->status = F_status_set_error(F_parameter);
+      setting->status = f_string_dynamics_resize(values->used, &setting->objects);
+
+      if (F_status_is_error(setting->status)) {
+        iki_write_print_line_first(setting, main->error, F_true);
+        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_resize", F_true);
+        iki_write_print_line_last(setting, main->error, F_true);
 
         return;
       }
 
-      if (args[main->parameters.array[iki_write_parameter_to_file_e].values.array[0]].used) {
-        setting->path_files_to.used = 0;
-
-        setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
-
-        setting->path_files_to.array[setting->path_files_to.used].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[iki_write_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
-
-        ++setting->path_files_to.used;
-
-        setting->status = f_file_stream_open(args[main->parameters.array[iki_write_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
+      // 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; ) {
 
-        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, args[main->parameters.array[iki_write_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
-
-          return;
-        }
+        index = values->array[setting->objects.used];
 
-        setting->flag |= iki_write_main_flag_file_to_e;
-      }
-      else {
-        iki_write_print_error_parameter_file_name_empty(main, setting, main->parameters.array[iki_write_parameter_to_file_e].values.array[0]);
-
-        setting->status = F_status_set_error(F_parameter);
+        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
 
-        return;
-      }
+      setting->flag |= iki_write_main_flag_object_e;
     }
-    else if (main->parameters.array[iki_write_parameter_to_file_e].result == f_console_result_found_e) {
-      iki_write_print_error_no_value(main, setting, iki_write_long_to_file_s);
-
+    else if (main->parameters.array[iki_write_parameter_object_e].result == f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
 
-      return;
-    }
-    else {
-      main->output.to = main->message.to;
+      iki_write_print_line_first(setting, main->error, F_true);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, iki_write_long_object_s);
+      iki_write_print_line_last(setting, main->error, F_true);
 
-      if (setting->flag & iki_write_main_flag_file_to_e) {
-        setting->flag -= iki_write_main_flag_file_to_e;
-      }
+      return;
     }
 
-    if (main->parameters.array[iki_write_parameter_from_file_e].result == f_console_result_additional_e) {
-      setting->path_files_from.used = 0;
-
-      setting->status = f_string_dynamics_increase_by(main->parameters.array[iki_write_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
+    if (main->parameters.array[iki_write_parameter_content_e].result == f_console_result_additional_e) {
+      f_array_lengths_t * const values = &main->parameters.array[iki_write_parameter_content_e].values;
 
-      setting->path_files_from.used = main->parameters.array[iki_write_parameter_from_file_e].values.used;
+      setting->contents.used = 0;
 
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
+      setting->status = f_string_dynamics_resize(values->used, &setting->contents);
 
-      for (; i < setting->path_files_from.used; ++i) {
+      if (F_status_is_error(setting->status)) {
+        iki_write_print_line_first(setting, main->error, F_true);
+        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_resize", F_true);
+        iki_write_print_line_last(setting, main->error, F_true);
 
-        index = main->parameters.array[iki_write_parameter_from_file_e].values.array[i];
-        setting->path_files_from.array[i].used = 0;
-
-        setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
+        return;
+      }
 
-        if (args[index].used) {
-          if (f_file_exists(args[index], F_true) != F_true) {
-            iki_write_print_error_parameter_file_not_found(main, setting, F_true, args[index]);
+      // 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; ) {
 
-            if (F_status_is_error_not(setting->status)) {
-              setting->status = F_status_set_error(F_file_found_not);
-            }
-          }
-        }
-        else {
-          iki_write_print_error_parameter_file_name_empty(main, setting, index);
+        index = values->array[setting->contents.used];
 
-          if (F_status_is_error_not(setting->status)) {
-            setting->status = F_status_set_error(F_parameter);
-          }
-        }
+        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
 
-      if (F_status_is_error(setting->status)) return;
-
-      setting->flag |= iki_write_main_flag_file_from_e;
+      setting->flag |= iki_write_main_flag_content_e;
     }
-    else if (main->parameters.array[iki_write_parameter_from_file_e].result == f_console_result_found_e) {
-      iki_write_print_error_no_value(main, setting, iki_write_long_from_file_s);
-
+    else if (main->parameters.array[iki_write_parameter_content_e].result == f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
 
+      iki_write_print_line_first(setting, main->error, F_true);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, iki_write_long_content_s);
+      iki_write_print_line_last(setting, main->error, F_true);
+
       return;
     }
-    else {
-      if (setting->flag & iki_write_main_flag_file_from_e) {
-        setting->flag -= iki_write_main_flag_file_from_e;
-      }
-    }
-
-    if (F_status_is_error(setting->status)) return;
-
-    if (main->parameters.array[iki_write_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
-      iki_write_print_error_no_from(main, setting);
 
+    if (!(main->pipe & fll_program_data_pipe_input_e) && !(setting->flag & (iki_write_main_flag_content_e | iki_write_parameter_object_e))) {
       setting->status = F_status_set_error(F_parameter);
-    }
 
-    if (!(setting->mode & iki_write_mode_to_bytesequence_e)) {
-      if (main->parameters.array[iki_write_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[iki_write_parameter_headers_e].result == f_console_result_found_e) {
-        setting->prepend = iki_write_string_prepend_padding_s;
-        setting->append = f_string_eol_s;
-      }
-      else {
-        setting->prepend = f_string_space_s;
-      }
-    }
+      iki_write_print_line_first(setting, main->error, F_true);
+      iki_write_print_error_main_missing(setting, main->error);
+      iki_write_print_line_last(setting, main->error, F_true);
 
-    if (main->parameters.array[iki_write_parameter_headers_e].result == f_console_result_found_e) {
-      setting->flag |= iki_write_main_flag_header_e;
+      return;
     }
 
-    if (main->parameters.array[iki_write_parameter_separate_e].result == f_console_result_found_e) {
-      setting->flag |= iki_write_main_flag_separate_e;
-    }
+    setting->quote = f_iki_syntax_quote_double_s;
 
-    if (main->parameters.array[iki_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
-      setting->flag |= iki_write_main_flag_strip_invalid_e;
+    if (main->parameters.array[iki_write_parameter_double_e].result == f_console_result_found_e) {
+      if (main->parameters.array[iki_write_parameter_single_e].result == f_console_result_found_e) {
+        if (main->parameters.array[iki_write_parameter_double_e].location < main->parameters.array[iki_write_parameter_single_e].location) {
+          setting->quote = f_iki_syntax_quote_single_s;
+        }
+      }
+    }
+    else if (main->parameters.array[iki_write_parameter_single_e].result == f_console_result_found_e) {
+      setting->quote = f_iki_syntax_quote_single_s;
     }
-
-    setting->valid_not = main->message.set->error;
   }
 #endif // _di_iki_write_setting_load_
 
index 0da4da3cc3514660805644abb1a2c6da82cd6974..6d2e6be2e50a5898418a17ecef8101cd51981f30 100644 (file)
@@ -60,6 +60,17 @@ extern "C" {
 #endif // _di_iki_write_program_name_
 
 /**
+ * Special strings used by this program.
+ */
+#ifndef _di_iki_write_strings_
+  #define IKI_WRITE_object_s  "object"
+
+  #define IKI_WRITE_object_s_length 6
+
+  extern const f_string_static_t iki_write_object_s;
+#endif // _di_iki_write_strings_
+
+/**
  * The program defines.
  */
 #ifndef _di_iki_write_defines_
@@ -157,26 +168,24 @@ extern "C" {
  *
  * iki_write_main_flag_*_e:
  *   - none:          No modes in use.
- *   - file_from:     Using a specified source file.
+ *   - content:       The Content being written is specified.
+ *   - double:        Operate using double quotes.
  *   - 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.
+ *   - object:        The Object being written is specified.
+ *   - single:        Operate using single quotes.
  *   - version:       Print version.
  */
 #ifndef _di_iki_write_main_flag_e_
   enum {
-    iki_write_main_flag_none_e          = 0x0,
-    iki_write_main_flag_file_from_e     = 0x1,
-    iki_write_main_flag_file_to_e       = 0x2,
-    iki_write_main_flag_header_e        = 0x4,
-    iki_write_main_flag_help_e          = 0x8,
-    iki_write_main_flag_separate_e      = 0x10,
-    iki_write_main_flag_strip_invalid_e = 0x20,
-    iki_write_main_flag_verify_e        = 0x40,
-    iki_write_main_flag_version_e       = 0x80,
+    iki_write_main_flag_none_e    = 0x0,
+    iki_write_main_flag_content_e = 0x1,
+    iki_write_main_flag_double_e  = 0x2,
+    iki_write_main_flag_file_to_e = 0x4,
+    iki_write_main_flag_help_e    = 0x8,
+    iki_write_main_flag_object_e  = 0x10,
+    iki_write_main_flag_single_e  = 0x20,
+    iki_write_main_flag_version_e = 0x40,
   };
 #endif // _di_iki_write_main_flag_e_
 
@@ -192,6 +201,16 @@ 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.
+ *
+ * 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_iki_write_setting_t_
   typedef struct {
@@ -201,6 +220,16 @@ 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_dynamics_t objects;
+    f_string_dynamics_t contents;
   } iki_write_setting_t;
 
   #define iki_write_setting_t_initialize \
@@ -209,6 +238,12 @@ 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_dynamics_t_initialize, \
+      f_string_dynamics_t_initialize, \
     }
 #endif // _di_iki_write_setting_t_
 
index c265da3abbb5e27d1603166aa164d5f843bf8ccb..0c778605bf19fb0ac904a45748b4f7101d35f636 100644 (file)
@@ -7,396 +7,189 @@ extern "C" {
 #endif
 
 #ifndef _di_iki_write_main_
-  f_status_t iki_write_main(fll_program_data_t * const main, iki_write_setting_t * const setting) {
+  void iki_write_main(fll_program_data_t * const main, iki_write_setting_t * const setting) {
 
-    f_status_t status = F_none;
+    if (!main || !setting || F_status_is_error(setting->status)) return;
 
-    // Load parameters.
-    status = f_console_parameter_process(arguments, &main->parameters);
-    if (F_status_is_error(status)) return;
+    setting->status = F_none;
 
-    {
-      f_array_length_t choice = 0;
-      f_uint16s_t choices = f_uint16s_t_initialize;
-
-      // Identify and prioritize "color context" parameters.
-      {
-        uint16_t choices_array[3] = { iki_write_parameter_no_color_e, iki_write_parameter_light_e, iki_write_parameter_dark_e };
-        choices.array = choices_array;
-        choices.used = 3;
-
-        const uint8_t modes[3] = { f_color_mode_color_not_e, f_color_mode_light_e, f_color_mode_dark_e };
-
-        status = fll_program_parameter_process_context(choices, modes, F_true, main);
-
-        if (F_status_is_error(status)) {
-          fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
-
-          return;
-        }
-      }
-
-      // Identify and prioritize "verbosity" parameters.
-      {
-        uint16_t choices_array[5] = { iki_write_parameter_verbosity_quiet_e, iki_write_parameter_verbosity_error_e, iki_write_parameter_verbosity_verbose_e, iki_write_parameter_verbosity_debug_e, iki_write_parameter_verbosity_normal_e };
-        choices.array = choices_array;
-        choices.used = 5;
-
-        const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
-
-        status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
-
-        if (F_status_is_error(status)) {
-          fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
-
-          return;
-        }
-      }
-    }
-
-    iki_write_data_t data = iki_write_data_t_initialize;
-    data.main = main;
-    data.argv = main->parameters.arguments.array;
-
-    status = F_none;
-
-    if (main->parameters.array[iki_write_parameter_help_e].result == f_console_result_found_e) {
+    if (setting->flag & iki_write_main_flag_help_e) {
       iki_write_print_help(setting, main->message);
 
-      iki_write_data_delete(&data);
-
-      return F_none;
+      return;
     }
 
-    if (main->parameters.array[iki_write_parameter_version_e].result == f_console_result_found_e) {
+    if (setting->flag & iki_write_main_flag_version_e) {
       fll_program_print_version(main->message, iki_write_program_version_s);
 
-      iki_write_data_delete(&data);
-
-      return F_none;
+      return;
     }
 
-    f_file_t file = f_file_t_initialize;
+    setting->escaped.used = 0;
 
-    file.id = F_type_descriptor_output_d;
-    file.stream = F_type_output_d;
-    file.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+    if (main->pipe & fll_program_data_pipe_input_e) {
+      bool object_ended = F_false;
 
-    if (F_status_is_error_not(status)) {
-      if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_e) {
-        if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            flockfile(main->error.to.stream);
+      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;
 
-            fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-            fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_file_s, main->error.notable);
-            fl_print_format("%[' may only be specified once.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+      pipe.id = F_type_descriptor_input_d;
+      pipe.size_read = 1;
 
-            funlockfile(main->error.to.stream);
-          }
+      setting->buffer.used = 0;
+      setting->object.used = 0;
+      setting->content.used = 0;
 
-          status = F_status_set_error(F_parameter);
-        }
-        else {
-          const f_array_length_t index = main->parameters.array[iki_write_parameter_file_e].values.array[0];
+      range.start = 0;
 
-          file.id = -1;
-          file.stream = 0;
+      do {
+        if (!((++main->signal_check) % iki_write_signal_check_d)) {
+          if (fll_program_standard_signal_received(main)) {
+            setting->status = F_status_set_error(F_interrupt);
 
-          status = f_file_stream_open(data.argv[index], f_string_empty_s, &file);
-
-          if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[index], f_file_operation_open_s, fll_error_file_type_file_e);
+            return;
           }
-        }
-      }
-      else if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_found_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
-
-          fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-          fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_file_s, main->error.notable);
-          fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
 
-          funlockfile(main->error.to.stream);
+          main->signal_check = 0;
         }
 
-        status = F_status_set_error(F_parameter);
-      }
-    }
-
-    if (F_status_is_error_not(status) && main->parameters.array[iki_write_parameter_object_e].result == f_console_result_found_e) {
-      if (main->error.verbosity != f_console_verbosity_quiet_e) {
-        flockfile(main->error.to.stream);
-
-        fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-        fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
-        fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
-
-        funlockfile(main->error.to.stream);
-      }
-
-      status = F_status_set_error(F_parameter);
-    }
+        if (status != F_none_eof) {
+          status = f_file_read(pipe, &setting->buffer);
 
-    if (F_status_is_error_not(status) && main->parameters.array[iki_write_parameter_content_e].result == f_console_result_found_e) {
-      if (main->error.verbosity != f_console_verbosity_quiet_e) {
-        flockfile(main->error.to.stream);
+          if (F_status_is_error(status)) {
+            setting->status = F_status_set_error(F_pipe);
 
-        fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-        fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
-        fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+            iki_write_print_line_first(setting, main->error, F_true);
+            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(setting, main->error, F_true);
 
-        funlockfile(main->error.to.stream);
-      }
+            return;
+          }
 
-      status = F_status_set_error(F_parameter);
-    }
+          if (!setting->buffer.used) {
+            setting->status = F_status_set_error(F_parameter);
 
-    if (F_status_is_error_not(status) && !(main->pipe & fll_program_data_pipe_input_e)) {
-      if (main->parameters.array[iki_write_parameter_object_e].result != f_console_result_additional_e && main->parameters.array[iki_write_parameter_content_e].result != f_console_result_additional_e) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
+            iki_write_print_line_first(setting, main->error, F_true);
+            fll_program_print_error_pipe_missing_content(main->error);
+            iki_write_print_line_last(setting, main->error, F_true);
 
-          fl_print_format("%r%[%QNo main provided, either pipe the main or use the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-          fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
-          fl_print_format("%[' and the '%]", main->error.to.stream, main->error.context, main->error.context);
-          fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
-          fl_print_format("%[' parameters.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+            return;
+          }
 
-          funlockfile(main->error.to.stream);
+          range.stop = setting->buffer.used - 1;
         }
 
-        status = F_status_set_error(F_parameter);
-      }
-    }
+        previous = range.start;
+        setting->status = f_string_dynamic_seek_to(setting->buffer, f_string_ascii_feed_form_s.string[0], &range);
 
-    if (F_status_is_error_not(status)) {
-      if (main->parameters.array[iki_write_parameter_object_e].values.used != main->parameters.array[iki_write_parameter_content_e].values.used) {
-        if (main->error.verbosity != f_console_verbosity_quiet_e) {
-          flockfile(main->error.to.stream);
-
-          fl_print_format("%r%[%QThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-          fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
-          fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
-          fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
-          fl_print_format("%[' must be specified the same number of times.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
-
-          funlockfile(main->error.to.stream);
+        if (setting->status == F_data_not_stop) {
+          setting->status = F_status_set_error(F_parameter);
         }
 
-        status = F_status_set_error(F_parameter);
-      }
-    }
+        if (F_status_is_error(setting->status)) {
+          iki_write_print_line_first(setting, main->error, F_true);
+          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_seek_to", F_true);
+          iki_write_print_line_last(setting, main->error, F_true);
 
-    data.quote = f_iki_syntax_quote_double_s;
-
-    if (F_status_is_error_not(status)) {
-      if (main->parameters.array[iki_write_parameter_double_e].result == f_console_result_found_e) {
-        if (main->parameters.array[iki_write_parameter_single_e].result == f_console_result_found_e) {
-          if (main->parameters.array[iki_write_parameter_double_e].location < main->parameters.array[iki_write_parameter_single_e].location) {
-            data.quote = f_iki_syntax_quote_single_s;
-          }
+          return;
         }
-      }
-      else if (main->parameters.array[iki_write_parameter_single_e].result == f_console_result_found_e) {
-        data.quote = f_iki_syntax_quote_single_s;
-      }
-    }
-
-    if (F_status_is_error_not(status)) {
-      f_string_dynamic_t escaped = f_string_dynamic_t_initialize;
-
-      if (main->pipe & fll_program_data_pipe_input_e) {
-        f_file_t pipe = f_file_t_initialize;
-
-        pipe.id = F_type_descriptor_input_d;
-        pipe.size_read = 1;
-
-        f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
-        f_string_dynamic_t object = f_string_dynamic_t_initialize;
-        f_string_dynamic_t content = f_string_dynamic_t_initialize;
 
-        bool object_ended = F_false;
+        if (object_ended && previous == range.start) {
+          setting->status = F_status_set_error(F_parameter);
 
-        f_array_length_t previous = 0;
-        f_string_range_t range = f_string_range_t_initialize;
+          iki_write_print_line_first(setting, main->error, F_true);
+          fll_program_print_error_pipe_invalid_form_feed(main->error);
+          iki_write_print_line_last(setting, main->error, F_true);
 
-        range.start = 0;
-
-        for (f_status_t status_pipe = F_none; ; ) {
-
-          if (!((++main->signal_check) % iki_write_signal_check_d)) {
-            if (fll_program_standard_signal_received(main)) {
-              status = F_status_set_error(F_interrupt);
-
-              break;
-            }
-
-            main->signal_check = 0;
-          }
-
-          if (status_pipe != F_none_eof) {
-            status_pipe = f_file_read(pipe, &buffer);
-
-            if (F_status_is_error(status_pipe)) {
-              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_to", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
-
-              status = F_status_set_error(F_pipe);
-
-              break;
-            }
-
-            if (!buffer.used) {
-              if (main->error.verbosity != f_console_verbosity_quiet_e) {
-                fll_print_format("%r%[%QThe pipe has no content.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
-              }
-
-              status = F_status_set_error(F_parameter);
-
-              break;
-            }
-
-            range.stop = buffer.used - 1;
-          }
-
-          previous = range.start;
-          status = f_string_dynamic_seek_to(buffer, f_string_ascii_feed_form_s.string[0], &range);
-
-          if (F_status_is_error(status)) {
-            fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_seek_to", F_true);
-
-            break;
-          }
-
-          if (status == F_data_not_stop) {
-            status = F_status_set_error(F_parameter);
-
-            fll_error_print(main->error, F_parameter, "f_string_dynamic_seek_line", F_true);
-
-            break;
-          }
-
-          if (object_ended && previous == range.start) {
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
-              fll_print_format("%r%[%QThe pipe has incorrectly placed form-feed characters (\\f).%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
-            }
-
-            status = F_status_set_error(F_parameter);
-
-            break;
-          }
+          return;
+        }
 
-          range.stop = range.start - 1;
-          range.start = previous;
+        range.stop = range.start - 1;
+        range.start = previous;
 
-          if (object_ended) {
-            content.used = 0;
+        if (object_ended) {
+          setting->content.used = 0;
 
-            if (buffer.used) {
-              status = f_string_dynamic_partial_append_nulless(buffer, range, &content);
+          if (setting->buffer.used) {
+            setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->content);
 
-              if (F_status_is_error(status)) {
-                fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true);
+            if (F_status_is_error(setting->status)) {
+              iki_write_print_line_first(setting, main->error, F_true);
+              fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_partial_append_nulless", F_true);
+              iki_write_print_line_last(setting, main->error, F_true);
 
-                break;
-              }
+              return;
             }
-
-            status = iki_write_process(&data, file, object, content, &escaped);
-            if (F_status_is_error(status)) break;
-
-            fll_print_dynamic_raw(f_string_eol_s, file.stream);
-
-            object_ended = F_false;
           }
-          else {
-            object.used = 0;
 
-            status = f_string_dynamic_partial_append_nulless(buffer, range, &object);
+          setting->status = iki_write_process(main, setting, setting->object, setting->content);
+          if (F_status_is_error(setting->status)) return;
 
-            if (F_status_is_error(status)) {
-              fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true);
+          fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
 
-              break;
-            }
-
-            object_ended = F_true;
-          }
-
-          // Restore the range, positioned after the new line.
-          range.start = range.stop + 2;
-          range.stop = buffer.used - 1;
+          object_ended = F_false;
+        }
+        else {
+          setting->object.used = 0;
 
-          // only clear the buffer and reset the start when the entire buffer has been processed.
-          if (range.start > range.stop) {
-            range.start = 0;
-            buffer.used = 0;
-          }
+          setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->object);
 
-          if (status_pipe == F_none_eof && !buffer.used && !object_ended) break;
-        } // for
+          if (F_status_is_error(setting->status)) {
+            iki_write_print_line_first(setting, main->error, F_true);
+            fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_partial_append_nulless", F_true);
+            iki_write_print_line_last(setting, main->error, F_true);
 
-        if (F_status_is_error_not(status) && object_ended) {
-          if (main->error.verbosity != f_console_verbosity_quiet_e) {
-            fll_print_format("%r%[%QThe pipe has an object without content.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+            return;
           }
 
-          status = F_status_set_error(F_parameter);
+          object_ended = F_true;
         }
 
-        f_string_dynamic_resize(0, &buffer);
-        f_string_dynamic_resize(0, &object);
-        f_string_dynamic_resize(0, &content);
-      }
+        // Restore the range, positioned after the new line.
+        range.start = range.stop + 2;
+        range.stop = setting->buffer.used - 1;
 
-      if (F_status_is_error_not(status)) {
-        for (f_array_length_t i = 0; i < main->parameters.array[iki_write_parameter_object_e].values.used; ++i) {
-
-          if (!((++main->signal_check) % iki_write_signal_check_d)) {
-            if (fll_program_standard_signal_received(main)) {
-              status = F_status_set_error(F_interrupt);
+        // 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;
+        }
 
-              break;
-            }
+      } while (status != F_none_eof || setting->buffer.used || object_ended);
 
-            main->signal_check = 0;
-          }
+      if (object_ended) {
+        setting->status = F_status_set_error(F_parameter);
 
-          status = iki_write_process(&data, file, data.argv[main->parameters.array[iki_write_parameter_object_e].values.array[i]], data.argv[main->parameters.array[iki_write_parameter_content_e].values.array[i]], &escaped);
-          if (F_status_is_error(status)) break;
+        iki_write_print_line_first(setting, main->error, F_true);
+        fll_program_print_error_pipe_object_without_content(main->error);
+        iki_write_print_line_last(setting, main->error, F_true);
 
-          fll_print_dynamic_raw(f_string_eol_s, file.stream);
-        } // for
-
-        // Ensure there is always a new line at the end, unless in quiet mode.
-        if (F_status_is_error_not(status) && main->error.verbosity != f_console_verbosity_quiet_e && main->error.verbosity != f_console_verbosity_error_e && main->parameters.array[iki_write_parameter_file_e].result == f_console_result_none_e) {
-          fll_print_dynamic_raw(f_string_eol_s, file.stream);
-        }
+        return;
       }
-
-      f_string_dynamic_resize(0, &escaped);
     }
 
-    if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_e) {
-      f_file_stream_flush(output);
-      f_file_stream_close(&file);
-    }
+    for (f_array_length_t i = 0; i < setting->objects.used; ++i) {
 
-    // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
-      if (F_status_is_error(status)) {
-        if (F_status_set_fine(status) == F_interrupt) {
-          fflush(main->output.to.stream);
+      if (!((++main->signal_check) % iki_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          setting->status = F_status_set_error(F_interrupt);
+
+          return;
         }
 
-        fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
+        main->signal_check = 0;
       }
-    }
 
-    iki_write_data_delete(&data);
+      setting->status = 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.stream);
+    } // for
 
-    return status;
+    // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
+    iki_write_print_line_last(setting, main->message, F_true);
   }
 #endif // _di_iki_write_main_
 
index 325155061ede24f0a2a5405256d8c2fa8d9e2138..6857588e21f48d5583e79f4084b99ec32dd3250a 100644 (file)
@@ -52,6 +52,7 @@
 
 // IKI Write includes.
 #include <program/iki_write/common.h>
+#include <program/iki_write/print.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -82,7 +83,7 @@ extern "C" {
  *     F_parameter (with error bit) if main is NULL or setting is NULL.
  */
 #ifndef _di_iki_write_main_
-  extern f_status_t iki_write_main(fll_program_data_t * const main, iki_write_setting_t * const setting);
+  extern void iki_write_main(fll_program_data_t * const main, iki_write_setting_t * const setting);
 #endif // _di_iki_write_main_
 
 #ifdef __cplusplus
index fa672df4df22c9de07482cfb3db8dad0fd77aced..b4dfcf8e85a0552dd3ee25beee8c3a87d0628b27 100644 (file)
@@ -30,5 +30,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(status) ? 1 : 0;
+  return F_status_is_error(setting.status) ? 1 : 0;
 }
index 0249187769c8f2d0b82da94b4340a04f1e2237b7..9c0ac56a4b1819a4621a2b9abdfa41b8a3c983c2 100644 (file)
@@ -33,6 +33,9 @@ extern "C" {
     fll_program_print_help_option(print, iki_write_short_object_s, iki_write_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to write.");
     fll_program_print_help_option(print, iki_write_short_single_s, iki_write_long_single_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes.");
 
+    f_print_dynamic_raw(f_string_eol_s, print.to.stream);
+    f_print_dynamic_raw(f_string_eol_s, print.to.stream);
+
     fll_program_print_help_usage(print, iki_write_program_name_s, f_string_empty_s);
 
     fl_print_format("%r %[Notes:%]%r", print.to.stream, f_string_eol_s, print.set->important, print.set->important, f_string_eol_s);
@@ -53,9 +56,9 @@ extern "C" {
 #endif // _di_iki_write_print_help_
 
 #ifndef _di_iki_write_print_line_first_
-  void iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print, const bool lock) {
+  f_status_t iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print, const bool lock) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     if (lock) {
       fll_print_dynamic_raw(setting->line_first, print.to.stream);
@@ -63,16 +66,16 @@ extern "C" {
     else {
       f_print_dynamic_raw(setting->line_first, print.to.stream);
     }
+
+    return F_none;
   }
 #endif // _di_iki_write_print_line_first_
 
 #ifndef _di_iki_write_print_line_last_
-  void iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print, const bool lock) {
+  f_status_t iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print, const bool lock) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
-    if (print.verbosity == f_console_verbosity_error_e && !F_status_is_error(setting->status)) return;
-    if (setting->flag & iki_write_main_flag_verify_e) return;
-    if ((setting->flag & iki_write_main_flag_file_to_e) && !F_status_is_error(setting->status)) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity == f_console_verbosity_error_e && !F_status_is_error(setting->status)) return F_output_not;
 
     if (lock) {
       fll_print_dynamic_raw(setting->line_last, print.to.stream);
@@ -80,9 +83,47 @@ extern "C" {
     else {
       f_print_dynamic_raw(setting->line_last, print.to.stream);
     }
+
+    return F_none;
   }
 #endif // _di_iki_write_print_line_last_
 
+#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.stream, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%r%r%]", print.to.stream, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_object_s, print.set->notable);
+    fl_print_format("%[' and the '%]", print.to.stream, print.set->error, print.set->error);
+    fl_print_format("%[%r%r%]", print.to.stream, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_content_s, print.set->notable);
+    fl_print_format("%[' parameters.%]%r", print.to.stream, 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.stream, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%]", print.to.stream, print.set->notable, object, print.set->notable);
+    fl_print_format("%[' is not a valid IKI Object.%]%r", print.to.stream, 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 7d27db1514910f5f2cd004e52712bbaed7b855c8..fd0801329e88afa00e6e1d58b58e900c18bc92f2 100644 (file)
@@ -23,6 +23,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #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);
@@ -41,9 +42,13 @@ extern "C" {
  * @param lock
  *   If TRUE, then lock the stream.
  *   If FALSE, then do not lock or unlock the stream.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_iki_write_print_line_first_
-  extern void iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print, const bool lock);
+  extern f_status_t iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print, const bool lock);
 #endif // _di_iki_write_print_line_first_
 
 /**
@@ -59,11 +64,51 @@ extern "C" {
  * @param lock
  *   If TRUE, then lock the stream.
  *   If FALSE, then do not lock or unlock the stream.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_iki_write_print_line_last_
-  extern void iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print, const bool lock);
+  extern f_status_t iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print, const bool lock);
 #endif // _di_iki_write_print_line_last_
 
+/**
+ * Print error message about "main" Object being missing.
+ *
+ * @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_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 error message about an Object not being valid.
+ *
+ * @param setting
+ *   The main program settings.
+ *   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_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a14b2d90714a28b4416ea9c0cd9ea9a2fa12afe9..f860d81060770eaf3d0720f022f3c0229834be46 100644 (file)
@@ -5,13 +5,6 @@
 extern "C" {
 #endif
 
-#ifndef _di_iki_write_data_delete_
-  void iki_write_data_delete(iki_write_data_t *data) {
-
-    // Nothing to deallocate.
-  }
-#endif // _di_iki_write_data_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 54c09450d31c15206adff5ef7b7851e105b56933..b84006a95e96dbc8b176641172b3bb2ba0fd2a06 100644 (file)
@@ -13,29 +13,6 @@ extern "C" {
 #endif
 
 /**
- * The program data.
- *
- * argv:  The argument structure in the progam data parameters for simplifying syntax.
- * main:  The main program data.
- * quote: The quote to use when writing.
- */
-#ifndef _di_iki_write_data_t_
-  typedef struct {
-    fll_program_data_t *main;
-    f_string_static_t *argv;
-
-    f_string_static_t quote;
-  } iki_write_data_t;
-
-  #define iki_write_data_t_initialize \
-    { \
-      0, \
-      0, \
-      f_string_static_t_initialize, \
-    }
-#endif // _di_iki_write_data_t_
-
-/**
  * Provide common/generic definitions.
  *
  * iki_write_common_allocation_*:
@@ -47,19 +24,6 @@ extern "C" {
   #define iki_write_common_allocation_small_d 16
 #endif // _di_iki_write_common_
 
-/**
- * Deallocate program data.
- *
- * @param data
- *   The program data.
- *
- * @return
- *   F_none on success.
- */
-#ifndef _di_iki_write_data_delete_
-  extern void iki_write_data_delete(iki_write_data_t *data) F_attribute_visibility_internal_d;
-#endif // _di_iki_write_data_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 8e5db8f38427ebe5ee2b6c544277e63f964c2a2d..8036182880e4584d1c37f5f9a080ff8180d39c89 100644 (file)
@@ -7,18 +7,10 @@ extern "C" {
 #endif
 
 #ifndef _di_iki_write_process_
-  f_status_t iki_write_process(fll_program_data_t * const main, status_code_setting_t * const setting, iki_write_data_t * const data, const f_file_t output, const f_string_static_t object, const f_string_static_t content, f_string_dynamic_t *escaped) {
+  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) {
 
     if (!object.used) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
-        flockfile(data->main->error.to.stream);
-
-        fl_print_format("%r%[%QThe object is missing, it must not have a length of %]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
-        fl_print_format("%[0%]", data->main->error.to.stream, data->main->error.notable, data->main->error.notable);
-        fl_print_format("%[.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
-
-        funlockfile(data->main->error.to.stream);
-      }
+      fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
 
       return F_status_set_error(F_failure);
     }
@@ -26,35 +18,28 @@ extern "C" {
     f_status_t status = f_iki_object_is(object);
 
     if (status == F_false) {
-      if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
-        flockfile(data->main->error.to.stream);
-
-        fl_print_format("%r%[%QThe object '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
-        fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, object, data->main->error.notable);
-        fl_print_format("%[' is not a valid IKI object.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
-
-        funlockfile(data->main->error.to.stream);
-      }
+      iki_write_print_error_object_not_valid(setting, main->error, object);
 
       return F_status_set_error(F_failure);
     }
-    else if (F_status_is_error(status)) {
-      fll_error_print(data->main->error, F_status_set_fine(status), "f_iki_object_is", F_true);
+
+    if (F_status_is_error(status)) {
+      fll_error_print(main->error, F_status_set_fine(status), "f_iki_object_is", F_true);
 
       return F_status_set_error(F_failure);
     }
 
-    escaped->used = 0;
+    setting->escaped.used = 0;
 
-    status = fll_iki_content_escape(content, data->quote, escaped);
+    status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
 
     if (F_status_is_error(status)) {
-      fll_error_print(data->main->error, F_status_set_fine(status), "fll_iki_content_escape", F_true);
+      fll_error_print(main->error, F_status_set_fine(status), "fll_iki_content_escape", F_true);
 
       return F_status_set_error(F_failure);
     }
 
-    fl_print_format("%Q%r%r%Q%r", output, object, f_iki_syntax_separator_s, data->quote, *escaped, data->quote);
+    fl_print_format("%Q%r%r%Q%r", main->output.to.stream, object, f_iki_syntax_separator_s, setting->quote, setting->escaped, setting->quote);
 
     return F_none;
   }
index 1743b9b88cd16c73a6ec9d8b33a8be3a2b053221..266882a5b17e6c3e20fd197eb6368aaaeb57bf8a 100644 (file)
@@ -15,23 +15,22 @@ extern "C" {
 /**
  * Process a given object and content, printing the IKI if valid or an error if invalid.
  *
- * @param data
- *   The program data.
- * @param output
- *   The file to output to.
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
  * @param object
  *   The object to validate and print.
  * @param content
  *   The content to escape and print.
- * @param escaped
- *   A string buffer used as a string cache to save the string into while escaping.
  *
  * @return
  *   F_none on success.
+ *
  *   F_failure (with error bit) for any othe failure.
  */
 #ifndef _di_iki_write_process_
-  extern f_status_t iki_write_process(fll_program_data_t * const main, status_code_setting_t * const setting, iki_write_data_t * const data, const f_file_t output, const f_string_static_t object, const f_string_static_t content, f_string_dynamic_t *escaped) F_attribute_visibility_internal_d;
+  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;
 #endif // _di_iki_write_process_
 
 #ifdef __cplusplus
index f6466066bf20bdb803588d2fac362a2d62b9a3fd..d4506876cb595465eaf4422e182d64a6f727ff00 100644 (file)
@@ -55,7 +55,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)) {
+      status_code_print_line_first(setting, main->error, F_true);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      status_code_print_line_last(setting, main->error, F_true);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -145,43 +152,43 @@ extern "C" {
     if (setting->flag & status_code_main_flag_error_e) {
       if (setting->flag & status_code_main_flag_warning_e) {
         if (!(setting->flag & status_code_main_flag_number_e)) {
+          setting->status = F_status_set_error(F_parameter);
+
           status_code_print_line_first(setting, main->error, F_true);
           status_code_print_error_cannot_error_warning_number(setting, main->error);
           status_code_print_line_last(setting, main->error, F_true);
 
-          setting->status = F_status_set_error(F_parameter);
-
           return;
         }
       }
 
       if (setting->flag & status_code_main_flag_fine_e) {
+        setting->status = F_status_set_error(F_parameter);
+
         status_code_print_line_first(setting, main->error, F_true);
-        fll_program_parameter_long_print_cannot_use_with(main->error, status_code_long_error_s, status_code_long_fine_s);
+        fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, status_code_long_error_s, status_code_long_fine_s);
         status_code_print_line_last(setting, main->error, F_true);
 
-        setting->status = F_status_set_error(F_parameter);
-
         return;
       }
     }
     else if (setting->flag & status_code_main_flag_warning_e && setting->flag & status_code_main_flag_fine_e) {
+      setting->status = F_status_set_error(F_parameter);
+
       status_code_print_line_first(setting, main->error, F_true);
-      fll_program_parameter_long_print_cannot_use_with(main->error, status_code_long_warning_s, status_code_long_fine_s);
+      fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_enable_s, status_code_long_warning_s, status_code_long_fine_s);
       status_code_print_line_last(setting, main->error, F_true);
 
-      setting->status = F_status_set_error(F_parameter);
-
       return;
     }
 
     if (main->parameters.remaining.used == 0 && !(main->pipe & fll_program_data_pipe_input_e)) {
+      setting->status = F_status_set_error(F_parameter);
+
       status_code_print_line_first(setting, main->error, F_true);
       status_code_print_error_no_status_codes(setting, main->error);
       status_code_print_line_last(setting, main->error, F_true);
 
-      setting->status = F_status_set_error(F_parameter);
-
       return;
     }
   }
index d28b8b1e30c8ee63a8aff7e55e96ea6e53ef00f7..29c5537a0cccb02dffa63d7834f362f2f35f56fa 100644 (file)
@@ -7,9 +7,9 @@ extern "C" {
 #endif
 
 #ifndef _di_status_code_print_error_cannot_error_warning_number_
-  void status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print) {
+  f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -22,15 +22,19 @@ extern "C" {
     fl_print_format("%[' parameter.%]%r", print.to.stream, print.context, print.context, f_string_eol_s);
 
     f_file_stream_unlock(print.to);
+
+    return F_none;
   }
 #endif // _di_status_code_print_error_cannot_error_warning_number_
 
 #ifndef _di_status_code_print_error_no_status_codes_
-  void status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print) {
+  f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     fll_print_format("%[No status code is specified.%]%r", print.to.stream, print.context, print.context, f_string_eol_s);
+
+    return F_none;
   }
 #endif // _di_status_code_print_error_no_status_codes_
 
@@ -52,6 +56,9 @@ extern "C" {
     fll_program_print_help_option(print, status_code_short_error_s, status_code_long_error_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "  Print F_true or F_false if status code is an error or print number with error code bit set.");
     fll_program_print_help_option(print, status_code_short_number_s, status_code_long_number_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number.");
 
+    f_print_dynamic_raw(f_string_eol_s, print.to.stream);
+    f_print_dynamic_raw(f_string_eol_s, print.to.stream);
+
     fll_program_print_help_usage(print, status_code_program_name_s, status_code_program_help_parameters_s);
 
     f_print_dynamic_raw(setting->line_last, print.to.stream);
@@ -64,9 +71,9 @@ extern "C" {
 #endif // _di_status_code_print_help_
 
 #ifndef _di_status_code_print_line_first_
-  void status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print, const bool lock) {
+  f_status_t status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print, const bool lock) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     if (lock) {
       fll_print_dynamic_raw(setting->line_first, print.to.stream);
@@ -74,14 +81,16 @@ extern "C" {
     else {
       f_print_dynamic_raw(setting->line_first, print.to.stream);
     }
+
+    return F_none;
   }
 #endif // _di_status_code_print_line_first_
 
 #ifndef _di_status_code_print_line_last_
-  void status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print, const bool lock) {
+  f_status_t status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print, const bool lock) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
-    if (print.verbosity == f_console_verbosity_error_e && !F_status_is_error(setting->status)) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity == f_console_verbosity_error_e && !F_status_is_error(setting->status)) return F_output_not;
 
     if (lock) {
       fll_print_dynamic_raw(setting->line_last, print.to.stream);
@@ -89,6 +98,8 @@ extern "C" {
     else {
       f_print_dynamic_raw(setting->line_last, print.to.stream);
     }
+
+    return F_none;
   }
 #endif // _di_status_code_print_line_last_
 
index e5410623301b574f840cba40f03d1060c3f6656e..99513e930da0a0d0cd5c7e23ce1bf489e00dcbd3 100644 (file)
@@ -20,9 +20,13 @@ extern "C" {
  *   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_status_code_print_error_cannot_error_warning_number_
-  extern void status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print);
+  extern f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print);
 #endif // _di_status_code_print_error_cannot_error_warning_number_
 
 /**
@@ -33,9 +37,13 @@ extern "C" {
  *   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_status_code_print_error_no_status_codes_
-  extern void status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print);
+  extern f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print);
 #endif // _di_status_code_print_error_no_status_codes_
 
 /**
@@ -49,6 +57,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_status_code_print_help_
   extern f_status_t status_code_print_help(status_code_setting_t * const setting, const fl_print_t print);
@@ -67,9 +76,13 @@ extern "C" {
  * @param lock
  *   If TRUE, then lock the stream.
  *   If FALSE, then do not lock or unlock the stream.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_status_code_print_line_first_
-  extern void status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print, const bool lock);
+  extern f_status_t status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print, const bool lock);
 #endif // _di_status_code_print_line_first_
 
 /**
@@ -85,9 +98,13 @@ extern "C" {
  * @param lock
  *   If TRUE, then lock the stream.
  *   If FALSE, then do not lock or unlock the stream.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_status_code_print_line_last_
-  extern void status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print, const bool lock);
+  extern f_status_t status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print, const bool lock);
 #endif // _di_status_code_print_line_last_
 
 #ifdef __cplusplus
index 94fe552f8e9cbbc95eea5674da1073afad3c72d0..8e3a00db0f4685b9c06958abf406a81d83cf4c58 100644 (file)
@@ -9,17 +9,7 @@ extern "C" {
 #ifndef _di_status_code_main_
   void status_code_main(fll_program_data_t * const main, status_code_setting_t * const setting) {
 
-    if (!main || !setting) {
-      status_code_print_line_first(setting, main->error, F_true);
-      fll_error_print(main->error, F_parameter, "status_code_main", F_true);
-      status_code_print_line_last(setting, main->error, F_true);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-
-    if (F_status_is_error(setting->status)) return;
+    if (!main || !setting || F_status_is_error(setting->status)) return;
 
     setting->status = F_none;
 
@@ -39,7 +29,7 @@ extern "C" {
 
     if (setting->flag & status_code_main_flag_number_e) {
       if (main->pipe & fll_program_data_pipe_input_e) {
-        // @todo call status_code_process_number() here for all main from pipe that is space separated.
+        // @todo call status_code_process_number() here for all main from pipe that are space separated.
       }
 
       if (main->parameters.remaining.used) {
@@ -51,9 +41,9 @@ extern "C" {
             if (fll_program_standard_signal_received(main)) {
               fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-              setting->status = F_status_set_error(F_signal);
+              setting->status = F_status_set_error(F_interrupt);
 
-              break;
+              return;
             }
 
             main->signal_check = 0;
@@ -83,9 +73,9 @@ extern "C" {
             if (fll_program_standard_signal_received(main)) {
               fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-              setting->status = F_status_set_error(F_signal);
+              setting->status = F_status_set_error(F_interrupt);
 
-              break;
+              return;
             }
 
             main->signal_check = 0;
@@ -115,9 +105,9 @@ extern "C" {
             if (fll_program_standard_signal_received(main)) {
               fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-              setting->status = F_status_set_error(F_signal);
+              setting->status = F_status_set_error(F_interrupt);
 
-              break;
+              return;
             }
 
             main->signal_check = 0;
index 1555f6bd7ecaaddec4d9267c982da76cb49e6fbc..0ae9def7939100c8af4e40f4fa1b6868af8ba130 100644 (file)
@@ -81,6 +81,7 @@ extern "C" {
 
     f_string_dynamics_resize(0, &setting->path_files_from);
     f_string_dynamics_resize(0, &setting->path_files_to);
+    f_string_dynamics_resize(0, &setting->remaining);
 
     return F_none;
   }
@@ -93,7 +94,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)) {
+      utf8_print_line_first(setting, main->error, F_true);
+      fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+      utf8_print_line_last(setting, main->error, F_true);
+
+      return;
+    }
 
     {
       f_array_length_t choice = 0;
@@ -281,10 +289,11 @@ extern "C" {
 
     if (main->parameters.array[utf8_parameter_to_file_e].result == f_console_result_additional_e) {
       if (main->parameters.array[utf8_parameter_to_file_e].values.used > 1) {
-        utf8_print_error_parameter_file_to_too_many(main, setting);
-
         setting->status = F_status_set_error(F_parameter);
 
+        utf8_print_error_parameter_file_to_too_many(main, setting);
+        utf8_print_line_last(setting, main->error, F_true);
+
         return;
       }
 
@@ -292,19 +301,35 @@ extern "C" {
         setting->path_files_to.used = 0;
 
         setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
-        if (F_status_is_error(setting->status)) return;
+
+        if (F_status_is_error(setting->status)) {
+          utf8_print_line_first(setting, main->error, F_true);
+          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_increase_by", F_true);
+          utf8_print_line_last(setting, main->error, F_true);
+
+          return;
+        }
 
         setting->path_files_to.array[setting->path_files_to.used].used = 0;
 
         setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
-        if (F_status_is_error(setting->status)) return;
+
+        if (F_status_is_error(setting->status)) {
+          utf8_print_line_first(setting, main->error, F_true);
+          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
+          utf8_print_line_last(setting, main->error, F_true);
+
+          return;
+        }
 
         ++setting->path_files_to.used;
 
         setting->status = f_file_stream_open(args[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(setting, main->error, F_true);
           fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", F_true, args[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(setting, main->error, F_true);
 
           return;
         }
@@ -312,7 +337,9 @@ extern "C" {
         setting->flag |= utf8_main_flag_file_to_e;
       }
       else {
+        utf8_print_line_first(setting, main->error, F_true);
         utf8_print_error_parameter_file_name_empty(main, setting, main->parameters.array[utf8_parameter_to_file_e].values.array[0]);
+        utf8_print_line_last(setting, main->error, F_true);
 
         setting->status = F_status_set_error(F_parameter);
 
@@ -320,10 +347,12 @@ extern "C" {
       }
     }
     else if (main->parameters.array[utf8_parameter_to_file_e].result == f_console_result_found_e) {
-      utf8_print_error_no_value(main, setting, utf8_long_to_file_s);
-
       setting->status = F_status_set_error(F_parameter);
 
+      utf8_print_line_first(setting, main->error, F_true);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, utf8_long_to_file_s);
+      utf8_print_line_last(setting, main->error, F_true);
+
       return;
     }
     else {
@@ -338,7 +367,14 @@ extern "C" {
       setting->path_files_from.used = 0;
 
       setting->status = f_string_dynamics_increase_by(main->parameters.array[utf8_parameter_from_file_e].values.used, &setting->path_files_from);
-      if (F_status_is_error(setting->status)) return;
+
+      if (F_status_is_error(setting->status)) {
+        utf8_print_line_first(setting, main->error, F_true);
+        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_increase_by", F_true);
+        utf8_print_line_last(setting, main->error, F_true);
+
+        return;
+      }
 
       setting->path_files_from.used = main->parameters.array[utf8_parameter_from_file_e].values.used;
 
@@ -351,7 +387,13 @@ extern "C" {
         setting->path_files_from.array[i].used = 0;
 
         setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
-        if (F_status_is_error(setting->status)) return;
+
+        if (F_status_is_error(setting->status)) {
+          utf8_print_line_first(setting, main->error, F_true);
+          fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
+
+          break;
+        }
 
         if (args[index].used) {
           if (f_file_exists(args[index], F_true) != F_true) {
@@ -371,15 +413,21 @@ extern "C" {
         }
       } // for
 
-      if (F_status_is_error(setting->status)) return;
+      if (F_status_is_error(setting->status)) {
+        utf8_print_line_last(setting, main->error, F_true);
+
+        return;
+      }
 
       setting->flag |= utf8_main_flag_file_from_e;
     }
     else if (main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_found_e) {
-      utf8_print_error_no_value(main, setting, utf8_long_from_file_s);
-
       setting->status = F_status_set_error(F_parameter);
 
+      utf8_print_line_first(setting, main->error, F_true);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, utf8_long_from_file_s);
+      utf8_print_line_last(setting, main->error, F_true);
+
       return;
     }
     else {
@@ -388,12 +436,37 @@ extern "C" {
       }
     }
 
-    if (F_status_is_error(setting->status)) return;
+    if (main->parameters.remaining.used) {
+      setting->remaining.used = 0;
+
+      setting->status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->remaining);
+
+      if (F_status_is_error(setting->status)) {
+        utf8_print_line_first(setting, main->error, F_true);
+        fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
+        utf8_print_line_last(setting, main->error, F_true);
+
+        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->remaining.used < main->parameters.remaining.used; ) {
+
+        index = main->parameters.remaining.array[setting->remaining.used];
+
+        setting->remaining.array[setting->remaining.used].string = main->parameters.arguments.array[index].string;
+        setting->remaining.array[setting->remaining.used].used = main->parameters.arguments.array[index].used;
+        setting->remaining.array[setting->remaining.used++].size = 0;
+      } // for
+    }
 
     if (main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_none_e && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
+      setting->status = F_status_set_error(F_parameter);
+
       utf8_print_error_no_from(main, setting);
+      utf8_print_line_last(setting, main->error, F_true);
 
-      setting->status = F_status_set_error(F_parameter);
+      return;
     }
 
     if (!(setting->mode & utf8_mode_to_bytesequence_e)) {
index 8fe80085f9fb80c8bc5c9b9316be244735b90d20..22b8881ac68fbc562c7136f4f78cd080d42cb4b1 100644 (file)
@@ -311,10 +311,10 @@ extern "C" {
  *   - codepoint:    The input format is codepoint (U+XXXX or U+XXXXXX).
  *
  * utf8_mode_to_*_e:
- *   - bytesequence: The outout format is bytesequence.
- *   - codepoint:    The outout format is codepoint (U+XXXX or U+XXXXXX).
- *   - combining:    The outout format is whether or not character is combining (may be used with "width").
- *   - width:        The outout format is how wide the character is (may be used with "combining").
+ *   - bytesequence: The output format is bytesequence.
+ *   - codepoint:    The output format is codepoint (U+XXXX or U+XXXXXX).
+ *   - combining:    The output format is whether or not character is combining (may be used with "width").
+ *   - width:        The output format is how wide the character is (may be used with "combining").
  */
 #ifndef _di_utf8_modes_e_
   enum {
@@ -332,15 +332,15 @@ extern "C" {
  * Flags used to represent flags passed to the main function.
  *
  * utf8_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.
+ *   - file_from:      Using a specified source file.
+ *   - file_to:        Using a specified destination file.
+ *   - header:         Enable printing of headers.
+ *   - help:           Print help.
+ *   - separate:       Enable printing of separators.
+ *   - strip_invalid:  Using strip invalid character mode.
+ *   - verify:         Using verify mode.
+ *   - version:        Print version.
  */
 #ifndef _di_utf8_main_flag_e_
   enum {
@@ -381,6 +381,7 @@ extern "C" {
  *
  * path_files_from: An array of all "from" file paths for when the flag utf8_main_flag_file_from_e is set.
  * path_files_to:   An array of all "to" file paths for when the flag utf8_main_flag_file_to_e is set.
+ * remaining:       An array containing all remaining arguments passed to the program.
  */
 #ifndef _di_utf8_setting_t_
   typedef struct {
@@ -403,6 +404,7 @@ extern "C" {
 
     f_string_dynamics_t path_files_from;
     f_string_dynamics_t path_files_to;
+    f_string_dynamics_t remaining;
   } utf8_setting_t;
 
   #define utf8_setting_t_initialize \
@@ -420,6 +422,7 @@ extern "C" {
       f_string_dynamic_t_initialize, \
       f_string_dynamics_t_initialize, \
       f_string_dynamics_t_initialize, \
+      f_string_dynamics_t_initialize, \
     }
 #endif // _di_utf8_setting_t_
 
index 5e87a364163aaa12bf8ca61acee55d43f76fe159..b1f85fa43a623f62e190ad28faa6d41fd02d9471 100644 (file)
@@ -6,17 +6,19 @@ extern "C" {
 #endif
 
 #ifndef _di_utf8_print_bytesequence_
-  void utf8_print_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
+  f_status_t utf8_print_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
 
     fl_print_format("%r%r%r", main->output.to.stream, setting->prepend, sequence, setting->append);
+
+    return F_none;
   }
 #endif // _di_utf8_print_bytesequence_
 
 #ifndef _di_utf8_print_character_invalid_
-  void utf8_print_character_invalid(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t invalid) {
+  f_status_t utf8_print_character_invalid(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t invalid) {
 
-    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return;
-    if (!invalid.used) return;
+    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
+    if (!invalid.used) return F_output_not;
 
     if ((setting->mode & utf8_mode_to_combining_e) || (setting->mode & utf8_mode_to_width_e)) {
       utf8_print_combining_or_width(main, setting, invalid);
@@ -36,11 +38,13 @@ extern "C" {
 
       fl_print_format("%]%r", main->output.to.stream, setting->valid_not, setting->append);
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_character_invalid_
 
 #ifndef _di_utf8_print_codepoint_
-  void utf8_print_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const uint32_t codepoint) {
+  f_status_t utf8_print_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const uint32_t codepoint) {
 
     if (codepoint < 0x10000) {
       fl_print_format("%rU+%04_U%r", main->output.to.stream, setting->prepend, codepoint, setting->append);
@@ -51,11 +55,13 @@ extern "C" {
     else {
       fl_print_format("%rU+%06_U%r", main->output.to.stream, setting->prepend, codepoint, setting->append);
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_codepoint_
 
 #ifndef _di_utf8_print_combining_or_width_
-  void utf8_print_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
+  f_status_t utf8_print_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
 
     if (setting->mode & utf8_mode_to_combining_e) {
       f_status_t status = f_utf_is_combining(sequence.string, sequence.used);
@@ -83,23 +89,27 @@ extern "C" {
     else if (setting->mode & utf8_mode_to_width_e) {
       utf8_print_width(main, setting, sequence);
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_combining_or_width_
 
 #ifndef _di_utf8_print_error_combining_or_width_
-  void utf8_print_error_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting) {
+  f_status_t utf8_print_error_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting) {
 
-    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return;
+    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     fl_print_format("%r%[%r%]%r", main->output.to.stream, setting->prepend, setting->valid_not, utf8_string_unknown_s, setting->valid_not, setting->append);
+
+    return F_none;
   }
 #endif // _di_utf8_print_error_combining_or_width_
 
 #ifndef _di_utf8_print_error_decode_
-  void utf8_print_error_decode(fll_program_data_t * const main, utf8_setting_t * const setting, const f_status_t status, const f_string_static_t invalid) {
+  f_status_t utf8_print_error_decode(fll_program_data_t * const main, utf8_setting_t * const setting, const f_status_t status, const f_string_static_t invalid) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
-    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return;
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     utf8_print_line_first(setting, main->error, F_false);
 
@@ -129,13 +139,15 @@ extern "C" {
       fl_print_format("%[%ui%]", main->error.to.stream, main->context.set.notable, F_status_set_fine(status), main->context.set.notable);
       fl_print_format("%[.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_error_decode_
 
 #ifndef _di_utf8_print_error_encode_
-  void utf8_print_error_encode(fll_program_data_t * const main, utf8_setting_t * const setting, const f_status_t status, const uint32_t codepoint) {
+  f_status_t utf8_print_error_encode(fll_program_data_t * const main, utf8_setting_t * const setting, const f_status_t status, const uint32_t codepoint) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     utf8_print_line_first(setting, main->error, F_false);
 
@@ -150,41 +162,28 @@ extern "C" {
       fl_print_format("%[%ui%]", main->error.to.stream, main->context.set.notable, F_status_set_fine(status), main->context.set.notable);
       fl_print_format("%[.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_error_encode_
 
 #ifndef _di_utf8_print_error_no_from_
-  void utf8_print_error_no_from(fll_program_data_t * const main, utf8_setting_t * const setting) {
+  f_status_t utf8_print_error_no_from(fll_program_data_t * const main, utf8_setting_t * const setting) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     utf8_print_line_first(setting, main->error, F_true);
 
     fll_print_format("%[%QNo from sources are specified, please pipe data, designate a file, or add parameters.%]%r", main->error.to.stream, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
-  }
-#endif // _di_utf8_print_error_no_from_
-
-#ifndef _di_utf8_print_error_no_value_
-  void utf8_print_error_no_value(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t parameter) {
-
-    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
-
-    f_file_stream_lock(main->error.to);
-
-    utf8_print_line_first(setting, main->error, F_false);
 
-    fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
-    fl_print_format("%[%r%r%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, parameter, main->context.set.notable);
-    fl_print_format("%[' is specified, but no value was given.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
-
-    f_file_stream_unlock(main->error.to);
+    return F_none;
   }
-#endif // _di_utf8_print_error_no_value_
+#endif // _di_utf8_print_error_no_from_
 
 #ifndef _di_utf8_print_error_parameter_file_name_empty_
-  void utf8_print_error_parameter_file_name_empty(fll_program_data_t * const main, utf8_setting_t * const setting, const f_array_length_t index) {
+  f_status_t utf8_print_error_parameter_file_name_empty(fll_program_data_t * const main, utf8_setting_t * const setting, const f_array_length_t index) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(main->error.to);
 
@@ -195,13 +194,15 @@ extern "C" {
     fl_print_format("%[.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
     f_file_stream_unlock(main->error.to);
+
+    return F_none;
   }
 #endif // _di_utf8_print_error_parameter_file_name_empty_
 
 #ifndef _di_utf8_print_error_parameter_file_not_found_
-  void utf8_print_error_parameter_file_not_found(fll_program_data_t * const main, utf8_setting_t * const setting, const bool from, const f_string_static_t name) {
+  f_status_t utf8_print_error_parameter_file_not_found(fll_program_data_t * const main, utf8_setting_t * const setting, const bool from, const f_string_static_t name) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(main->error.to);
 
@@ -212,24 +213,28 @@ extern "C" {
     fl_print_format("%['.%]%r", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
 
     f_file_stream_unlock(main->error.to);
+
+    return F_none;
   }
 #endif // _di_utf8_print_error_parameter_file_not_found_
 
 #ifndef _di_utf8_print_error_parameter_file_to_too_many_
-  void utf8_print_error_parameter_file_to_too_many(fll_program_data_t * const main, utf8_setting_t * const setting) {
+  f_status_t utf8_print_error_parameter_file_to_too_many(fll_program_data_t * const main, utf8_setting_t * const setting) {
 
-    if (main->error.verbosity == f_console_verbosity_quiet_e) return;
+    if (main->error.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     utf8_print_line_first(setting, main->error, F_true);
 
-    fll_print_format("%[%QToo many %r files specified, there may only be one to file.%]%r", main->error.to.stream, main->context.set.error, main->error.prefix, utf8_string_to_s, main->context.set.error, f_string_eol_s);
+    fll_print_format("%[%QToo many '%r' files specified, there may only be one '%r' file.%]%r", main->error.to.stream, main->context.set.error, main->error.prefix, utf8_string_to_s, utf8_string_to_s, main->context.set.error, f_string_eol_s);
+
+    return F_none;
   }
 #endif // _di_utf8_print_error_parameter_file_to_too_many_
 
 #ifndef _di_utf8_print_flush_
-  void utf8_print_flush(fll_program_data_t * const main, utf8_setting_t * const setting) {
+  f_status_t utf8_print_flush(fll_program_data_t * const main, utf8_setting_t * const setting) {
 
-    if (setting->flag & utf8_main_flag_verify_e) return;
+    if (setting->flag & utf8_main_flag_verify_e) return F_output_not;
 
     if (setting->status == F_interrupt) {
       if (main->output.verbosity != f_console_verbosity_quiet_e) {
@@ -242,6 +247,8 @@ extern "C" {
         }
       }
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_flush_
 
@@ -277,6 +284,9 @@ extern "C" {
     fll_program_print_help_option(print, utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Strip invalid Unicode characters (do not print invalid sequences).");
     fll_program_print_help_option(print, utf8_short_verify_s, utf8_long_verify_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "       Only perform verification of valid sequences.");
 
+    f_print_dynamic_raw(f_string_eol_s, print.to.stream);
+    f_print_dynamic_raw(f_string_eol_s, print.to.stream);
+
     fll_program_print_help_usage(print, utf8_program_name_s, utf8_program_help_parameters_s);
 
     fl_print_format("%r  The default behavior is to assume the expected input is byte sequence from the command line to be print.to to the screen as codepoints.%r%r", print.to.stream, f_string_eol_s, f_string_eol_s, f_string_eol_s);
@@ -300,9 +310,9 @@ extern "C" {
 #endif // _di_utf8_print_help_
 
 #ifndef _di_utf8_print_line_first_
-  void utf8_print_line_first(utf8_setting_t * const setting, const fl_print_t print, const bool lock) {
+  f_status_t utf8_print_line_first(utf8_setting_t * const setting, const fl_print_t print, const bool lock) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     if (lock) {
       fll_print_dynamic_raw(setting->line_first, print.to.stream);
@@ -310,16 +320,20 @@ extern "C" {
     else {
       f_print_dynamic_raw(setting->line_first, print.to.stream);
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_line_first_
 
 #ifndef _di_utf8_print_line_last_
-  void utf8_print_line_last(utf8_setting_t * const setting, const fl_print_t print, const bool lock) {
+  f_status_t utf8_print_line_last(utf8_setting_t * const setting, const fl_print_t print, const bool lock) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return;
-    if (print.verbosity == f_console_verbosity_error_e && !F_status_is_error(setting->status)) return;
-    if (setting->flag & utf8_main_flag_verify_e) return;
-    if ((setting->flag & utf8_main_flag_file_to_e) && !F_status_is_error(setting->status)) return;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    if (!F_status_is_error(setting->status)) {
+      if (print.verbosity == f_console_verbosity_error_e) return F_output_not;
+      if (setting->flag & (utf8_main_flag_verify_e | utf8_main_flag_file_to_e)) return F_output_not;
+    }
 
     if (lock) {
       fll_print_dynamic_raw(setting->line_last, print.to.stream);
@@ -327,13 +341,15 @@ extern "C" {
     else {
       f_print_dynamic_raw(setting->line_last, print.to.stream);
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_line_last_
 
 #ifndef _di_utf8_print_raw_bytesequence_
-  void utf8_print_raw_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_utf_char_t raw, const uint8_t width) {
+  f_status_t utf8_print_raw_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_utf_char_t raw, const uint8_t width) {
 
-    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return;
+    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     f_string_static_t character = macro_f_string_static_t_initialize(0, 0, width);
 
@@ -366,22 +382,26 @@ extern "C" {
     }
 
     fl_print_format("%r%[%r%]%r", main->output.to.stream, setting->prepend, setting->valid_not, character, setting->valid_not, setting->append);
+
+    return F_none;
   }
 #endif // _di_utf8_print_raw_bytesequence_
 
 #ifndef _di_utf8_print_raw_codepoint_
-  void utf8_print_raw_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t raw) {
+  f_status_t utf8_print_raw_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t raw) {
 
-    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return;
+    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     fl_print_format("%r%[%r%]%r", main->output.to.stream, setting->prepend, setting->valid_not, raw, setting->valid_not, setting->append);
+
+    return F_none;
   }
 #endif // _di_utf8_print_raw_codepoint_
 
 #ifndef _di_utf8_print_raw_combining_or_width_
-  void utf8_print_raw_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting, const uint8_t width) {
+  f_status_t utf8_print_raw_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting, const uint8_t width) {
 
-    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return;
+    if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     if (setting->mode & utf8_mode_to_combining_e) {
       utf8_print_error_combining_or_width(main, setting);
@@ -412,16 +432,18 @@ extern "C" {
 
       fl_print_format("%r%[%r%]%r", main->output.to.stream, setting->prepend, setting->valid_not, *character, setting->valid_not, setting->append);
     }
+
+    return F_none;
   }
 #endif // _di_utf8_print_raw_combining_or_width_
 
 #ifndef _di_utf8_print_section_header_file_
-  void utf8_print_section_header_file(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t name, const f_array_length_t index) {
+  f_status_t utf8_print_section_header_file(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t name, const f_array_length_t index) {
 
-    if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return;
-    if (setting->flag & utf8_main_flag_verify_e) return;
+    if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not;
+    if (setting->flag & utf8_main_flag_verify_e) return F_output_not;
 
-    flockfile(main->output.to.stream);
+    f_file_stream_lock(main->output.to);
 
     if ((main->pipe & fll_program_data_pipe_input_e) || index) {
       f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -441,17 +463,19 @@ extern "C" {
       }
     }
 
-    funlockfile(main->output.to.stream);
+    f_file_stream_unlock(main->output.to);
+
+    return F_none;
   }
 #endif // _di_utf8_print_section_header_file_
 
 #ifndef _di_utf8_print_section_header_parameter_
-  void utf8_print_section_header_parameter(fll_program_data_t * const main, utf8_setting_t * const setting, const f_array_length_t index) {
+  f_status_t utf8_print_section_header_parameter(fll_program_data_t * const main, utf8_setting_t * const setting, const f_array_length_t index) {
 
-    if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return;
-    if (setting->flag & utf8_main_flag_verify_e) return;
+    if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not;
+    if (setting->flag & utf8_main_flag_verify_e) return F_output_not;
 
-    flockfile(main->output.to.stream);
+    f_file_stream_lock(main->output.to);
 
     if ((main->pipe & fll_program_data_pipe_input_e) || (setting->flag & utf8_main_flag_file_from_e) || index) {
       f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -465,17 +489,19 @@ extern "C" {
       fl_print_format("%[%ul%]:%r", main->output.to.stream, main->output.set->notable, index, main->output.set->notable, f_string_eol_s);
     }
 
-    funlockfile(main->output.to.stream);
+    f_file_stream_unlock(main->output.to);
+
+    return F_none;
   }
 #endif // _di_utf8_print_section_header_parameter_
 
 #ifndef _di_utf8_print_section_header_pipe_
-  void utf8_print_section_header_pipe(fll_program_data_t * const main, utf8_setting_t * const setting) {
+  f_status_t utf8_print_section_header_pipe(fll_program_data_t * const main, utf8_setting_t * const setting) {
 
-    if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return;
-    if (setting->flag & utf8_main_flag_verify_e) return;
+    if (!(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not;
+    if (setting->flag & utf8_main_flag_verify_e) return F_output_not;
 
-    flockfile(main->output.to.stream);
+    f_file_stream_lock(main->output.to);
 
     f_print_dynamic_raw(setting->line_first, main->output.to.stream);
 
@@ -483,19 +509,21 @@ extern "C" {
       fl_print_format("%[Pipe%]:%r", main->output.to.stream, main->output.set->title, main->output.set->title, f_string_eol_s);
     }
 
-    funlockfile(main->output.to.stream);
+    f_file_stream_unlock(main->output.to);
+
+    return F_none;
   }
 #endif // _di_utf8_print_section_header_pipe_
 
 #ifndef _di_utf8_print_width_
-  void utf8_print_width(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
+  f_status_t utf8_print_width(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
 
     f_status_t status = f_utf_is_wide(sequence.string, sequence.used);
 
     if (status == F_true) {
       fl_print_format("%r%r%r", main->output.to.stream, setting->prepend, utf8_string_width_2_s, setting->append);
 
-      return;
+      return F_output_not;
     }
 
     if (status == F_false) {
@@ -504,17 +532,19 @@ extern "C" {
       if (status == F_true) {
         fl_print_format("%r%r%r", main->output.to.stream, setting->prepend, utf8_string_width_1_s, setting->append);
 
-        return;
+        return F_output_not;
       }
 
       if (status == F_false) {
         fl_print_format("%r%r%r", main->output.to.stream, setting->prepend, utf8_string_width_0_s, setting->append);
 
-        return;
+        return F_output_not;
       }
     }
 
     utf8_print_error_combining_or_width(main, setting);
+
+    return F_none;
   }
 #endif // _di_utf8_print_width_
 
index c02b5e3f8e96a7d4e7675ee35f00f15b974745d2..785e0a32e832678a3c0a7e3286f6520d385c738d 100644 (file)
@@ -23,9 +23,13 @@ extern "C" {
  *   Assumed to always be non-NULL.
  * @param sequence
  *   A byte sequences representing a single character to print.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_bytesequence_
-  extern void utf8_print_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence);
+  extern f_status_t utf8_print_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence);
 #endif // _di_utf8_print_bytesequence_
 
 /**
@@ -42,10 +46,14 @@ extern "C" {
  * @param invalid
  *   The byte sequence string or unicode codepoint string representing a single character to print.
  *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
  * @see utf8_print_combining_or_width()
  */
 #ifndef _di_utf8_print_character_invalid_
-  extern void utf8_print_character_invalid(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t invalid);
+  extern f_status_t utf8_print_character_invalid(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t invalid);
 #endif // _di_utf8_print_character_invalid_
 
 /**
@@ -60,9 +68,13 @@ extern "C" {
  * @param codepoint
  *   The codepoint to print.
  *   This is the code that represents a single character.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_codepoint_
-  extern void utf8_print_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const uint32_t codepoint);
+  extern f_status_t utf8_print_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const uint32_t codepoint);
 #endif // _di_utf8_print_codepoint_
 
 /**
@@ -78,9 +90,13 @@ extern "C" {
  *   A byte sequences representing a single character to print.
  *
  * @see utf8_print_width()
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_combining_or_width_
-  extern void utf8_print_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence);
+  extern f_status_t utf8_print_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence);
 #endif // _di_utf8_print_combining_or_width_
 
 /**
@@ -92,9 +108,13 @@ extern "C" {
  *   The main program settings.
  *
  *   Assumed to always be non-NULL.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_error_combining_or_width_
-  extern void utf8_print_error_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting);
+  extern f_status_t utf8_print_error_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting);
 #endif // _di_utf8_print_error_combining_or_width_
 
 /**
@@ -108,9 +128,13 @@ extern "C" {
  *   Assumed to always be non-NULL.
  * @param invalid
  *   The byte sequence string or unicode codepoint string representing a single character to print.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_error_decode_
-  extern void utf8_print_error_decode(fll_program_data_t * const main, utf8_setting_t * const setting, const f_status_t status, const f_string_static_t invalid);
+  extern f_status_t utf8_print_error_decode(fll_program_data_t * const main, utf8_setting_t * const setting, const f_status_t status, const f_string_static_t invalid);
 #endif // _di_utf8_print_error_decode_
 
 /**
@@ -124,9 +148,13 @@ extern "C" {
  *   Assumed to always be non-NULL.
  * @param codepoint
  *   The codepoint that is invalid.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_error_encode_
-  extern void utf8_print_error_encode(fll_program_data_t * const main, utf8_setting_t * const setting, const f_status_t status, const uint32_t codepoint);
+  extern f_status_t utf8_print_error_encode(fll_program_data_t * const main, utf8_setting_t * const setting, const f_status_t status, const uint32_t codepoint);
 #endif // _di_utf8_print_error_encode_
 
 /**
@@ -138,28 +166,16 @@ extern "C" {
  *   The main program settings.
  *
  *   Assumed to always be non-NULL.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_error_no_from_
-  extern void utf8_print_error_no_from(fll_program_data_t * const main, utf8_setting_t * const setting);
+  extern f_status_t utf8_print_error_no_from(fll_program_data_t * const main, utf8_setting_t * const setting);
 #endif // _di_utf8_print_error_no_from_
 
 /**
- * Print error message for when no sources are provided.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *
- *   Assumed to always be non-NULL.
- * @param parameter
- *   The long parameter name.
- */
-#ifndef _di_utf8_print_error_no_value_
-  extern void utf8_print_error_no_value(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t parameter);
-#endif // _di_utf8_print_error_no_value_
-
-/**
  * Print error message for when the file parameter is an empty string.
  *
  * @param main
@@ -170,9 +186,13 @@ extern "C" {
  *   Assumed to always be non-NULL.
  * @param index
  *   The index within the argv[] array where the empty string is found.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_error_parameter_file_name_empty_
-  extern void utf8_print_error_parameter_file_name_empty(fll_program_data_t * const main, utf8_setting_t * const setting, const f_array_length_t index);
+  extern f_status_t utf8_print_error_parameter_file_name_empty(fll_program_data_t * const main, utf8_setting_t * const setting, const f_array_length_t index);
 #endif // _di_utf8_print_error_parameter_file_name_empty_
 
 /**
@@ -189,9 +209,13 @@ extern "C" {
  *   If FALSE, then this is a to file (destination file).
  * @param name
  *   The file path name.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_error_parameter_file_not_found_
-  extern void utf8_print_error_parameter_file_not_found(fll_program_data_t * const main, utf8_setting_t * const setting, const bool from, const f_string_static_t name);
+  extern f_status_t utf8_print_error_parameter_file_not_found(fll_program_data_t * const main, utf8_setting_t * const setting, const bool from, const f_string_static_t name);
 #endif // _di_utf8_print_error_parameter_file_not_found_
 
 /**
@@ -203,9 +227,13 @@ extern "C" {
  *   The main program settings.
  *
  *   Assumed to always be non-NULL.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_error_parameter_file_to_too_many_
-  extern void utf8_print_error_parameter_file_to_too_many(fll_program_data_t * const main, utf8_setting_t * const setting);
+  extern f_status_t utf8_print_error_parameter_file_to_too_many(fll_program_data_t * const main, utf8_setting_t * const setting);
 #endif // _di_utf8_print_error_parameter_file_to_too_many_
 
 /**
@@ -218,9 +246,13 @@ extern "C" {
  * @param setting
  *   The main program settings.
  *   This does not alter setting.status.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_flush_
-  extern void utf8_print_flush(fll_program_data_t * const main, utf8_setting_t * const setting);
+  extern f_status_t utf8_print_flush(fll_program_data_t * const main, utf8_setting_t * const setting);
 #endif // _di_utf8_print_flush_
 
 /**
@@ -234,6 +266,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_help_
   extern f_status_t utf8_print_help(utf8_setting_t * const setting, const fl_print_t print);
@@ -252,9 +285,13 @@ extern "C" {
  * @param lock
  *   If TRUE, then lock the stream.
  *   If FALSE, then do not lock or unlock the stream.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_line_first_
-  extern void utf8_print_line_first(utf8_setting_t * const setting, const fl_print_t print, const bool lock);
+  extern f_status_t utf8_print_line_first(utf8_setting_t * const setting, const fl_print_t print, const bool lock);
 #endif // _di_utf8_print_line_first_
 
 /**
@@ -270,9 +307,13 @@ extern "C" {
  * @param lock
  *   If TRUE, then lock the stream.
  *   If FALSE, then do not lock or unlock the stream.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_line_last_
-  extern void utf8_print_line_last(utf8_setting_t * const setting, const fl_print_t print, const bool lock);
+  extern f_status_t utf8_print_line_last(utf8_setting_t * const setting, const fl_print_t print, const bool lock);
 #endif // _di_utf8_print_line_last_
 
 /**
@@ -288,9 +329,13 @@ extern "C" {
  *   The raw string in integer format.
  * @param width
  *   The width the raw character represents (a value inclusively from 1 to 4).
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_raw_bytesequence_
-  extern void utf8_print_raw_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_utf_char_t raw, const uint8_t width);
+  extern f_status_t utf8_print_raw_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_utf_char_t raw, const uint8_t width);
 #endif // _di_utf8_print_raw_bytesequence_
 
 /**
@@ -304,9 +349,13 @@ extern "C" {
  *   Assumed to always be non-NULL.
  * @param raw
  *   The raw string already in codepoint format.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_raw_codepoint_
-  extern void utf8_print_raw_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t raw);
+  extern f_status_t utf8_print_raw_codepoint(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t raw);
 #endif // _di_utf8_print_raw_codepoint_
 
 /**
@@ -321,10 +370,14 @@ extern "C" {
  * @param width
  *   The pre-calculated width.
  *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
  * @see utf8_print_width()
  */
 #ifndef _di_utf8_print_raw_combining_or_width_
-  extern void utf8_print_raw_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting, const uint8_t width);
+  extern f_status_t utf8_print_raw_combining_or_width(fll_program_data_t * const main, utf8_setting_t * const setting, const uint8_t width);
 #endif // _di_utf8_print_raw_combining_or_width_
 
 /**
@@ -340,9 +393,13 @@ extern "C" {
  *   The name of the file.
  * @param index
  *   The index position of the file.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_section_header_file_
-  extern void utf8_print_section_header_file(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t name, const f_array_length_t index);
+  extern f_status_t utf8_print_section_header_file(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t name, const f_array_length_t index);
 #endif // _di_utf8_print_section_header_file_
 
 /**
@@ -356,9 +413,13 @@ extern "C" {
  *   Assumed to always be non-NULL.
  * @param index
  *   The index position of the parameter.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_section_header_parameter_
-  extern void utf8_print_section_header_parameter(fll_program_data_t * const main, utf8_setting_t * const setting, const f_array_length_t index);
+  extern f_status_t utf8_print_section_header_parameter(fll_program_data_t * const main, utf8_setting_t * const setting, const f_array_length_t index);
 #endif // _di_utf8_print_section_header_parameter_
 
 /**
@@ -370,9 +431,13 @@ extern "C" {
  *   The main program settings.
  *
  *   Assumed to always be non-NULL.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_section_header_pipe_
-  extern void utf8_print_section_header_pipe(fll_program_data_t * const main, utf8_setting_t * const setting);
+  extern f_status_t utf8_print_section_header_pipe(fll_program_data_t * const main, utf8_setting_t * const setting);
 #endif // _di_utf8_print_section_header_pipe_
 
 /**
@@ -386,9 +451,13 @@ extern "C" {
  *   Assumed to always be non-NULL.
  * @param sequence
  *   A byte sequences representing a single character whose width is to be printed.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_utf8_print_width_
-  extern void utf8_print_width(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence);
+  extern f_status_t utf8_print_width(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence);
 #endif // _di_utf8_print_width_
 
 #ifdef __cplusplus
index 9dfc146bde453cca2b169e2444d84cc358916382..2d278a58b64f03d7bd9c5853907fe5dede01feed 100644 (file)
@@ -11,17 +11,7 @@ extern "C" {
 #ifndef _di_utf8_main_
   void utf8_main(fll_program_data_t * const main, utf8_setting_t * const setting) {
 
-    if (!main || !setting) {
-      utf8_print_line_first(setting, main->error, F_true);
-      fll_error_print(main->error, F_parameter, "utf8_main", F_true);
-      utf8_print_line_last(setting, main->error, F_true);
-
-      setting->status = F_status_set_error(F_parameter);
-
-      return;
-    }
-
-    if (F_status_is_error(setting->status)) return;
+    if (!main || !setting || F_status_is_error(setting->status)) return;
 
     setting->status = F_none;
 
@@ -56,7 +46,7 @@ extern "C" {
           if (setting->flag & utf8_main_flag_header_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
           }
-          else if ((setting->flag & utf8_main_flag_separate_e) && ((setting->flag & utf8_main_flag_file_from_e) || main->parameters.remaining.used)) {
+          else if ((setting->flag & (utf8_main_flag_separate_e | utf8_main_flag_file_from_e)) || setting->remaining.used) {
             fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
           }
         }
@@ -67,15 +57,11 @@ extern "C" {
       }
     }
 
+    // Process "from" files.
     if (F_status_is_error_not(setting->status) && setting->status != F_interrupt && (setting->flag & utf8_main_flag_file_from_e)) {
-      f_array_length_t i = 0;
-      f_array_length_t index = 0;
-
       f_file_t file = macro_f_file_t_initialize(0, -1, F_file_flag_read_only_d, 32768, F_file_default_write_size_d);
 
-      f_string_static_t * const args = main->parameters.arguments.array;
-
-      for (; i < main->parameters.array[utf8_parameter_from_file_e].values.used && setting->status != F_interrupt; ++i) {
+      for (f_array_length_t i = 0; i < setting->path_files_from.used && setting->status != F_interrupt; ++i) {
 
         if (!((++main->signal_check) % utf8_signal_check_d)) {
           if (fll_program_standard_signal_received(main)) {
@@ -87,14 +73,12 @@ extern "C" {
           main->signal_check = 0;
         }
 
-        index = main->parameters.array[utf8_parameter_from_file_e].values.array[i];
-
-        utf8_print_section_header_file(main, setting, args[index], i);
+        utf8_print_section_header_file(main, setting, setting->path_files_from.array[i], i);
 
-        setting->status = f_file_stream_open(args[index], f_string_empty_s, &file);
+        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, args[index], f_file_operation_open_s, fll_error_file_type_file_e);
+          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);
 
           break;
         }
@@ -120,7 +104,7 @@ extern "C" {
             if (setting->flag & utf8_main_flag_header_e) {
               fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
             }
-            else if ((setting->flag & utf8_main_flag_separate_e) && (main->parameters.remaining.used || i + 1 < main->parameters.array[utf8_parameter_from_file_e].values.used)) {
+            else if ((setting->flag & utf8_main_flag_separate_e) && (setting->remaining.used || setting->path_files_from.used)) {
               fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
             }
           }
@@ -134,15 +118,16 @@ 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, args[index], f_file_operation_process_s, fll_error_file_type_file_e);
+          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);
 
           break;
         }
       } // for
     }
 
-    if (F_status_is_error_not(setting->status) && setting->status != F_interrupt && main->parameters.remaining.used) {
-      for (f_array_length_t i = 0; F_status_is_error_not(setting->status) && i < main->parameters.remaining.used; ++i) {
+    // Process remaining parameters.
+    if (F_status_is_error_not(setting->status) && setting->status != F_interrupt && setting->remaining.used) {
+      for (f_array_length_t i = 0; F_status_is_error_not(setting->status) && i < setting->remaining.used; ++i) {
 
         if (!((++main->signal_check) % utf8_signal_check_d)) {
           if (fll_program_standard_signal_received(main)) {