]> Kevux Git Server - fll/commitdiff
Progress: Continue program related work, updating fss_write.
authorKevin Day <thekevinday@gmail.com>
Sun, 4 Dec 2022 00:39:56 +0000 (18:39 -0600)
committerKevin Day <thekevinday@gmail.com>
Sun, 4 Dec 2022 00:39:56 +0000 (18:39 -0600)
Minor improvement to comments and specifications.

I've identified the structure I wanted and this is progress towards implementing the fss_write code across all currently supported formats.

35 files changed:
level_2/fll_program/c/program/common.h
level_3/fss_write/c/basic/fss_write.c
level_3/fss_write/c/basic/fss_write.h
level_3/fss_write/c/basic/main.c
level_3/fss_write/c/basic_list/fss_write.c
level_3/fss_write/c/basic_list/fss_write.h
level_3/fss_write/c/basic_list/main.c
level_3/fss_write/c/embedded_list/fss_write.c
level_3/fss_write/c/embedded_list/fss_write.h
level_3/fss_write/c/embedded_list/main.c
level_3/fss_write/c/extended/fss_write.c
level_3/fss_write/c/extended/fss_write.h
level_3/fss_write/c/extended/main.c
level_3/fss_write/c/extended_list/fss_write.c
level_3/fss_write/c/extended_list/fss_write.h
level_3/fss_write/c/extended_list/main.c
level_3/fss_write/c/main/common.c
level_3/fss_write/c/main/common.h
level_3/fss_write/c/main/fss_write.c
level_3/fss_write/c/main/fss_write.h
level_3/fss_write/c/main/main.c
level_3/fss_write/c/main/print.c
level_3/fss_write/c/main/print.h
level_3/fss_write/c/payload/common.c
level_3/fss_write/c/payload/common.h
level_3/fss_write/c/payload/fss_write.c
level_3/fss_write/c/payload/fss_write.h
level_3/fss_write/c/payload/main.c
level_3/fss_write/data/build/fakefile
level_3/iki_read/c/iki_read.c
level_3/iki_write/c/iki_write.c
specifications/fss-0000.txt
specifications/fss-0001.txt
specifications/fss-0009.txt
specifications/fss-000a.txt

index 8125fb0336f20379ae12e517f98e6709febe3c09..cd069157d70ac7f35c1cbac39758edea3bb152ff 100644 (file)
@@ -68,7 +68,7 @@ extern "C" {
  * signal:          The process signal management structure.
  *
  * message: The output file for normal output messages (often stdout).
- * output:  The output file for normal/non-message output (often stdout or a file).
+ * output:  The output file for normal/non-message output, aka data output (often stdout or a file).
  * error:   The output file for error output messages.
  * warning: The output file for warning output messages.
  *
index 9788cf090b6c5026fbba0fb0c24f2a0301a3e389..9f3a3a52e4082afbd34adde9d570f02c7369c241 100644 (file)
 extern "C" {
 #endif
 
+#ifndef _di_fss_write_basic_process_content_
+  void fss_write_basic_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_basic_content_write(
+        *content,
+        f_fss_complete_none_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_basic_content_write(
+        *content,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_basic_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_basic_content_write");
+
+      return;
+    }
+  }
+#endif // _di_fss_write_basic_process_content_
+
 #ifndef _di_fss_write_basic_process_help_
   void fss_write_basic_process_help(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_basic_print_help((fss_write_setting_t *) setting, main->message);
+    fss_write_basic_print_help(macro_fss_write_setting(setting), main->message);
   }
 #endif // _di_fss_write_basic_process_help_
 
+#ifndef _di_fss_write_basic_process_object_
+  void fss_write_basic_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_basic_object_write(
+        *object,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
+        f_fss_complete_none_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_basic_object_write(
+        *object,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_basic_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_basic_object_write");
+    }
+  }
+#endif // _di_fss_write_basic_process_object_
+
 #ifndef _di_fss_write_basic_process_normal_
   void fss_write_basic_process_normal(fll_program_data_t * const main, void * const setting) {
 
-    // @todo
+    f_string_statics_t * const data = (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e) ? &macro_fss_write_setting(setting)->objects : &macro_fss_write_setting(setting)->contents;
+
+    for (f_array_length_t i = 0; i < data->used; ++i) {
+
+      // @todo replace all signal checks with forked main process that independently checks and assigns main->signal_received.
+      if (!((++main->signal_check) % fss_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          macro_fss_write_setting(setting)->status = F_status_set_error(F_interrupt);
+
+          return;
+        }
+
+        main->signal_check = 0;
+      }
+
+      fss_write_process_set(
+        main,
+        macro_fss_write_setting(setting),
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e) ? &macro_fss_write_setting(setting)->objects.array[i] : 0,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_content_e) ? &macro_fss_write_setting(setting)->contents.array[i] : 0
+      );
+
+      if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
+    } // for
   }
 #endif // _di_fss_write_basic_process_normal_
 
index 701999f76990bcf96ddf80acea4787312f7daaf0..416d2f12d2392f06b0d215f6ce48cac42580f9f8 100644 (file)
@@ -39,7 +39,6 @@
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>
-#include <fll/level_2/fss/basic.h>
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
@@ -54,6 +53,24 @@ extern "C" {
 #endif
 
 /**
+ * Process a single Content, printing the FSS-0000 (Basic) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param content
+ *   The string representing the Content to write to the buffer.
+ */
+#ifndef _di_fss_write_basic_process_content_
+  extern void fss_write_basic_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+#endif // _di_fss_write_basic_process_content_
+
+/**
  * Process help for FSS-0000 (Basic).
  *
  * @param main
@@ -73,7 +90,7 @@ extern "C" {
 #endif // _di_fss_write_basic_process_help_
 
 /**
- * Process normally, writing to the output.
+ * Process normally, writing to the output for FSS-0000 (Basic).
  *
  * @param main
  *   The main program data.
@@ -92,7 +109,25 @@ extern "C" {
 #endif // _di_fss_write_basic_process_normal_
 
 /**
- * Process the pipe, reading from the pipe and writing to the output.
+ * Process a single Object, printing the FSS-0000 (Basic) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param object
+ *   The string representing the Object to write to the buffer.
+ */
+#ifndef _di_fss_write_basic_process_object_
+  extern void fss_write_basic_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+#endif // _di_fss_write_basic_process_object_
+
+/**
+ * Process the pipe, reading from the pipe and writing to the output for FSS-0000 (Basic).
  *
  * @param main
  *   The main program data.
index 2b95e0cbb91f5b353c0e05bbe84bdb0056b2ee94..9c1d28bc6a53e1022a83a56d0b213de2ae835277 100644 (file)
@@ -5,11 +5,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
   setting.state.data = (void *) &data;
+  setting.program_name = &fss_write_basic_program_name_s;
+  setting.program_name_long = &fss_write_basic_program_name_long_s;
   setting.process_help = &fss_write_basic_process_help;
   setting.process_pipe = &fss_write_basic_process_pipe;
   setting.process_normal = &fss_write_basic_process_normal;
-  setting.program_name = &fss_write_basic_program_name_s;
-  setting.program_name_long = &fss_write_basic_program_name_long_s;
+  setting.process_object = &fss_write_basic_process_object;
+  setting.process_content = &fss_write_basic_process_content;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index ebc7a2928b441b77cdf405b0a3f948cc8347824f..435c14d7d679b6d19b755cc447cc8396fc57f92d 100644 (file)
@@ -7,10 +7,52 @@
 extern "C" {
 #endif
 
+#ifndef _di_fss_write_basic_list_process_content_
+  void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_basic_list_content_write(
+        *content,
+        f_fss_complete_none_e,
+        &macro_fss_write_setting(setting)->prepend,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_basic_list_content_write(
+        *content,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        &macro_fss_write_setting(setting)->prepend,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_basic_list_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_basic_list_content_write");
+
+      return;
+    }
+  }
+#endif // _di_fss_write_basic_list_process_content_
+
 #ifndef _di_fss_write_basic_list_process_help_
   void fss_write_basic_list_process_help(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_basic_list_print_help((fss_write_setting_t *) setting, main->message);
+    fss_write_basic_list_print_help(macro_fss_write_setting(setting), main->message);
   }
 #endif // _di_fss_write_basic_list_process_help_
 
@@ -21,6 +63,44 @@ extern "C" {
   }
 #endif // _di_fss_write_basic_list_process_normal_
 
+#ifndef _di_fss_write_basic_list_process_object_
+  void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_basic_list_object_write(
+        *object,
+        f_fss_complete_none_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_basic_list_object_write(
+        *object,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_basic_list_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_basic_list_object_write");
+    }
+  }
+#endif // _di_fss_write_basic_list_process_object_
+
 #ifndef _di_fss_write_basic_list_process_pipe_
   void fss_write_basic_list_process_pipe(fll_program_data_t * const main, void * const setting) {
 
index d7391c32369a3fb641c8d4d3f37f9c783f9b7e40..6ea235fe013cd19fa500d16f156a9bce5fb26076 100644 (file)
@@ -54,6 +54,24 @@ extern "C" {
 #endif
 
 /**
+ * Process a single Content, printing the FSS-0002 (Basic List) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param content
+ *   The string representing the Content to write to the buffer.
+ */
+#ifndef _di_fss_write_basic_list_process_content_
+  extern void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+#endif // _di_fss_write_basic_list_process_content_
+
+/**
  * Process help for FSS-0002 (Basic List).
  *
  * @param main
@@ -92,6 +110,24 @@ extern "C" {
 #endif // _di_fss_write_basic_list_process_normal_
 
 /**
+ * Process a single Object, printing the FSS-0002 (Basic List) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param object
+ *   The string representing the Object to write to the buffer.
+ */
+#ifndef _di_fss_write_basic_list_process_object_
+  extern void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+#endif // _di_fss_write_basic_list_process_object_
+
+/**
  * Process the pipe, reading from the pipe and writing to the output.
  *
  * @param main
index 8e3452d890ee3d72d2511921c1a09ad4a99a5593..e8f6e86686f4680dca9642529cbc8a631d6682c0 100644 (file)
@@ -5,11 +5,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
   setting.state.data = (void *) &data;
+  setting.program_name = &fss_write_basic_list_program_name_s;
+  setting.program_name_long = &fss_write_basic_list_program_name_long_s;
   setting.process_help = &fss_write_basic_list_process_help;
   setting.process_pipe = &fss_write_basic_list_process_pipe;
   setting.process_normal = &fss_write_basic_list_process_normal;
-  setting.program_name = &fss_write_basic_list_program_name_s;
-  setting.program_name_long = &fss_write_basic_list_program_name_long_s;
+  setting.process_object = &fss_write_basic_list_process_object;
+  setting.process_content = &fss_write_basic_list_process_content;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index 4ad0c7f61c70eab2fb8ac2e5b79c2a11cf0e35c7..08d5669a9e51d01ed1925b7c27d332c6d93c70fe 100644 (file)
@@ -7,10 +7,54 @@
 extern "C" {
 #endif
 
+#ifndef _di_fss_write_embedded_list_process_content_
+  void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_embedded_list_content_write(
+        *content,
+        f_fss_complete_none_e,
+        &macro_fss_write_setting(setting)->prepend,
+        &macro_fss_write_setting(setting)->ignores,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_embedded_list_content_write(
+        *content,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        &macro_fss_write_setting(setting)->prepend,
+        &macro_fss_write_setting(setting)->ignores,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_embedded_list_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_embedded_list_content_write");
+
+      return;
+    }
+  }
+#endif // _di_fss_write_embedded_list_process_content_
+
 #ifndef _di_fss_write_embedded_list_process_help_
   void fss_write_embedded_list_process_help(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_embedded_list_print_help((fss_write_setting_t *) setting, main->message);
+    fss_write_embedded_list_print_help(macro_fss_write_setting(setting), main->message);
   }
 #endif // _di_fss_write_embedded_list_process_help_
 
@@ -21,6 +65,44 @@ extern "C" {
   }
 #endif // _di_fss_write_embedded_list_process_normal_
 
+#ifndef _di_fss_write_embedded_list_process_object_
+  void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_embedded_list_object_write(
+        *object,
+        f_fss_complete_none_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_embedded_list_object_write(
+        *object,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_embedded_list_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_embedded_list_object_write");
+    }
+  }
+#endif // _di_fss_write_embedded_list_process_object_
+
 #ifndef _di_fss_write_embedded_list_process_pipe_
   void fss_write_embedded_list_process_pipe(fll_program_data_t * const main, void * const setting) {
 
index 9483c6ef0980960106eb698b2e057aa46d7d70f1..c94289a0eab1b6c1f9dd4fdaf73db55bae655a8c 100644 (file)
@@ -53,6 +53,24 @@ extern "C" {
 #endif
 
 /**
+ * Process a single Content, printing the FSS-0008 (Embedded List) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param content
+ *   The string representing the Content to write to the buffer.
+ */
+#ifndef _di_fss_write_embedded_list_process_content_
+  extern void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+#endif // _di_fss_write_embedded_list_process_content_
+
+/**
  * Process help for FSS-0008 (Embedded List).
  *
  * @param main
@@ -91,6 +109,24 @@ extern "C" {
 #endif // _di_fss_write_embedded_list_process_normal_
 
 /**
+ * Process a single Object, printing the FSS-0008 (Embedded List) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param object
+ *   The string representing the Object to write to the buffer.
+ */
+#ifndef _di_fss_write_embedded_list_process_object_
+  extern void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+#endif // _di_fss_write_embedded_list_process_object_
+
+/**
  * Process the pipe, reading from the pipe and writing to the output.
  *
  * @param main
index 2652249598d53926c7bc0d371ed5699afeb75966..494543a76d558cf46b459bf5786c93a780a82d2e 100644 (file)
@@ -5,11 +5,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
   setting.state.data = (void *) &data;
+  setting.program_name = &fss_write_embedded_list_program_name_s;
+  setting.program_name_long = &fss_write_embedded_list_program_name_long_s;
   setting.process_help = &fss_write_embedded_list_process_help;
   setting.process_pipe = &fss_write_embedded_list_process_pipe;
   setting.process_normal = &fss_write_embedded_list_process_normal;
-  setting.program_name = &fss_write_embedded_list_program_name_s;
-  setting.program_name_long = &fss_write_embedded_list_program_name_long_s;
+  setting.process_object = &fss_write_embedded_list_process_object;
+  setting.process_content = &fss_write_embedded_list_process_content;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index e76f0f423f6b445042119a6f58cac5550dbfb63b..447a899863365792cd9974b8edcaa3d68644d4e1 100644 (file)
@@ -7,10 +7,52 @@
 extern "C" {
 #endif
 
+#ifndef _di_fss_write_extended_process_content_
+  void fss_write_extended_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_extended_content_write(
+        *content,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
+        f_fss_complete_none_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_extended_content_write(
+        *content,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_extended_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_extended_content_write");
+
+      return;
+    }
+  }
+#endif // _di_fss_write_extended_process_content_
+
 #ifndef _di_fss_write_extended_process_help_
   void fss_write_extended_process_help(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_extended_print_help((fss_write_setting_t *) setting, main->message);
+    fss_write_extended_print_help(macro_fss_write_setting(setting), main->message);
   }
 #endif // _di_fss_write_extended_process_help_
 
@@ -21,6 +63,46 @@ extern "C" {
   }
 #endif // _di_fss_write_extended_process_normal_
 
+#ifndef _di_fss_write_extended_process_object_
+  void fss_write_extended_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_extended_object_write(
+        *object,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
+        f_fss_complete_none_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_extended_object_write(
+        *object,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_extended_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_extended_object_write");
+    }
+  }
+#endif // _di_fss_write_extended_process_object_
+
 #ifndef _di_fss_write_extended_process_pipe_
   void fss_write_extended_process_pipe(fll_program_data_t * const main, void * const setting) {
 
index 0b7e9f4f49844787ba970d04af0f189564288187..74fd129d534c78c7c2234ab0cb4c5069fcedc49e 100644 (file)
@@ -39,7 +39,6 @@
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>
-#include <fll/level_2/fss/extended.h>
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
+
+/**
+ * Process a single Content, printing the FSS-0001 (Extended) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param content
+ *   The string representing the Content to write to the buffer.
+ */
+#ifndef _di_fss_write_extended_process_content_
+  extern void fss_write_extended_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+#endif // _di_fss_write_extended_process_content_
+
 /**
  * Process help for FSS-0001 (Extended).
  *
@@ -91,6 +109,24 @@ extern "C" {
 #endif // _di_fss_write_extended_process_normal_
 
 /**
+ * Process a single Object, printing the FSS-0001 (Extended) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param object
+ *   The string representing the Object to write to the buffer.
+ */
+#ifndef _di_fss_write_extended_process_object_
+  extern void fss_write_extended_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+#endif // _di_fss_write_extended_process_object_
+
+/**
  * Process the pipe, reading from the pipe and writing to the output.
  *
  * @param main
index e4777f3e1b870ab33de5749f312c2709c8272ec2..0da93cc3b72bf3161300ad7f8847c5432b2afcd9 100644 (file)
@@ -5,11 +5,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
   setting.state.data = (void *) &data;
+  setting.program_name = &fss_write_extended_program_name_s;
+  setting.program_name_long = &fss_write_extended_program_name_long_s;
   setting.process_help = &fss_write_extended_process_help;
   setting.process_pipe = &fss_write_extended_process_pipe;
   setting.process_normal = &fss_write_extended_process_normal;
-  setting.program_name = &fss_write_extended_program_name_s;
-  setting.program_name_long = &fss_write_extended_program_name_long_s;
+  setting.process_object = &fss_write_exended_process_object;
+  setting.process_content = &fss_write_exended_process_content;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index f0775dcacd1289122c0e13c2cf0e74c3c3ee911a..202015615f2643e25b9e870a6a27a70e7984deaa 100644 (file)
@@ -7,10 +7,54 @@
 extern "C" {
 #endif
 
+#ifndef _di_fss_write_extended_list_process_content_
+  void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_extended_list_content_write(
+        *content,
+        f_fss_complete_none_e,
+        &macro_fss_write_setting(setting)->prepend,
+        &macro_fss_write_setting(setting)->ignores,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_extended_list_content_write(
+        *content,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        &macro_fss_write_setting(setting)->prepend,
+        &macro_fss_write_setting(setting)->ignores,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_extended_list_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_extended_list_content_write");
+
+      return;
+    }
+  }
+#endif // _di_fss_write_extended_list_process_content_
+
 #ifndef _di_fss_write_extended_list_process_help_
   void fss_write_extended_list_process_help(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_extended_list_print_help((fss_write_setting_t *) setting, main->message);
+    fss_write_extended_list_print_help(macro_fss_write_setting(setting), main->message);
   }
 #endif // _di_fss_write_extended_list_process_help_
 
@@ -21,6 +65,44 @@ extern "C" {
   }
 #endif // _di_fss_write_extended_list_process_normal_
 
+#ifndef _di_fss_write_extended_list_process_object_
+  void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+
+    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+      macro_fss_write_setting(setting)->status = fl_fss_extended_list_object_write(
+        *object,
+        f_fss_complete_none_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+    else {
+      macro_fss_write_setting(setting)->status = fl_fss_extended_list_object_write(
+        *object,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
+        macro_fss_write_setting(setting)->state,
+        &macro_fss_write_setting(setting)->range,
+        &macro_fss_write_setting(setting)->buffer
+      );
+    }
+
+    if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+
+      fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_extended_list_standard_s);
+      fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+
+      return;
+    }
+
+    if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_extended_list_object_write");
+    }
+  }
+#endif // _di_fss_write_extended_list_process_object_
+
 #ifndef _di_fss_write_extended_list_process_pipe_
   void fss_write_extended_list_process_pipe(fll_program_data_t * const main, void * const setting) {
 
index 5f9d0945b150c893248c8452c16f117a451338be..0197115bfcbba14965f0a9942bb001bc21671ca3 100644 (file)
 
 // FLL-1 includes.
 #include <fll/level_1/conversion.h>
-#include <fll/level_1/fss/extended.h>
+#include <fll/level_1/fss/extended_list.h>
 #include <fll/level_1/print.h>
 #include <fll/level_1/string.h>
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>
-#include <fll/level_2/fss/extended.h>
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
@@ -54,6 +53,24 @@ extern "C" {
 #endif
 
 /**
+ * Process a single Content, printing the FSS-0003 (Extended List) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param content
+ *   The string representing the Content to write to the buffer.
+ */
+#ifndef _di_fss_write_extended_list_process_content_
+  extern void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+#endif // _di_fss_write_extended_list_process_content_
+
+/**
  * Process help for FSS-0003 (Extended List).
  *
  * @param main
@@ -92,6 +109,24 @@ extern "C" {
 #endif // _di_fss_write_extended_list_process_normal_
 
 /**
+ * Process a single Object, printing the FSS-0003 (Extended List) if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status.
+ *   This uses and alters setting.buffer.
+ * @param object
+ *   The string representing the Object to write to the buffer.
+ */
+#ifndef _di_fss_write_extended_list_process_object_
+  extern void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+#endif // _di_fss_write_extended_list_process_object_
+
+/**
  * Process the pipe, reading from the pipe and writing to the output.
  *
  * @param main
index 20d3dd4c0fae7d152ce51704a8b6b256445dc636..efd2e94df6ffb6525674418373de13adfe9ef6f9 100644 (file)
@@ -5,11 +5,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
   setting.state.data = (void *) &data;
+  setting.program_name = &fss_write_extended_list_program_name_s;
+  setting.program_name_long = &fss_write_extended_list_program_name_long_s;
   setting.process_help = &fss_write_extended_list_process_help;
   setting.process_pipe = &fss_write_extended_list_process_pipe;
   setting.process_normal = &fss_write_extended_list_process_normal;
-  setting.program_name = &fss_write_extended_list_program_name_s;
-  setting.program_name_long = &fss_write_extended_list_program_name_long_s;
+  setting.process_object = &fss_write_exended_list_process_object;
+  setting.process_content = &fss_write_exended_list_process_content;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index db0515f5ecfc73d3939dfd022ace16d6dc606806..ab242a4cfda721e2117ed35a3d4bde8b91d0cae7 100644 (file)
@@ -141,11 +141,11 @@ extern "C" {
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
     if (main->parameters.array[fss_write_parameter_help_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_main_flag_help_e;
+      setting->flag |= fss_write_flag_help_e;
     }
 
     if (main->parameters.array[fss_write_parameter_version_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_main_flag_version_e;
+      setting->flag |= fss_write_flag_version_e;
     }
 
     if (callback) {
@@ -162,7 +162,7 @@ extern "C" {
     if (main->parameters.array[fss_write_parameter_help_e].result & f_console_result_found_e) return;
     if (main->parameters.array[fss_write_parameter_version_e].result & f_console_result_found_e) return;
 
-    if (main->parameters.array[fss_write_parameter_file_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_file_e].values.used) {
+    if ((main->parameters.array[fss_write_parameter_file_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_file_e].values.used) {
       if (main->parameters.array[fss_write_parameter_file_e].values.used > 1) {
         setting->status = F_status_set_error(F_parameter);
 
@@ -186,7 +186,7 @@ extern "C" {
         return;
       }
 
-      setting->flag |= fss_write_main_flag_file_to_e;
+      setting->flag |= fss_write_flag_file_to_e;
     }
     else if (main->parameters.array[fss_write_parameter_file_e].result & f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
@@ -221,7 +221,7 @@ extern "C" {
         setting->objects.array[setting->objects.used++].size = 0;
       } // for
 
-      setting->flag |= fss_write_main_flag_object_e;
+      setting->flag |= fss_write_flag_object_e;
     }
     else if (main->parameters.array[fss_write_parameter_object_e].result & f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
@@ -233,7 +233,7 @@ extern "C" {
       return;
     }
 
-    if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_content_e].values.used) {
+    if ((main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_content_e].values.used) {
       f_array_lengths_t * const values = &main->parameters.array[fss_write_parameter_content_e].values;
 
       setting->contents.used = 0;
@@ -256,7 +256,7 @@ extern "C" {
         setting->contents.array[setting->contents.used++].size = 0;
       } // for
 
-      setting->flag |= fss_write_main_flag_content_e;
+      setting->flag |= fss_write_flag_content_e;
     }
     else if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
@@ -268,7 +268,7 @@ extern "C" {
       return;
     }
 
-    if (main->parameters.array[fss_write_parameter_prepend_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_prepend_e].values.used) {
+    if ((main->parameters.array[fss_write_parameter_prepend_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_prepend_e].values.used) {
       const f_array_length_t index = main->parameters.array[fss_write_parameter_prepend_e].values.array[main->parameters.array[fss_write_parameter_prepend_e].values.used - 1];
 
       setting->prepend.used = 0;
@@ -305,7 +305,7 @@ extern "C" {
         } // for
       }
 
-      setting->flag |= fss_write_main_flag_prepend_e;
+      setting->flag |= fss_write_flag_prepend_e;
     }
     else if (main->parameters.array[fss_write_parameter_prepend_e].result & f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
@@ -317,7 +317,7 @@ extern "C" {
       return;
     }
 
-    if (main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_ignore_e].values.used) {
+    if ((main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_ignore_e].values.used) {
 
       if (main->parameters.array[fss_write_parameter_ignore_e].values.used % 2 != 0) {
         setting->status = F_status_set_error(F_parameter);
@@ -380,7 +380,7 @@ extern "C" {
         ++setting->ignores.used;
       } // for
 
-      setting->flag |= fss_write_main_flag_ignore_e;
+      setting->flag |= fss_write_flag_ignore_e;
     }
     else if (main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
@@ -393,11 +393,11 @@ extern "C" {
     }
 
     if (main->parameters.array[fss_write_parameter_partial_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_main_flag_partial_e;
+      setting->flag |= fss_write_flag_partial_e;
     }
 
-    if (setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e)) {
-      if (setting->flag & fss_write_main_flag_object_e) {
+    if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e)) {
+      if (setting->flag & fss_write_flag_object_e) {
         if (main->parameters.array[fss_write_parameter_object_e].locations.used != main->parameters.array[fss_write_parameter_object_e].values.used) {
           setting->status = F_status_set_error(F_parameter);
 
@@ -418,7 +418,7 @@ extern "C" {
           return;
         }
 
-        if (main->parameters.array[fss_write_parameter_object_e].locations.used != main->parameters.array[fss_write_parameter_content_e].locations.used && !(setting->flag & fss_write_main_flag_partial_e)) {
+        if (main->parameters.array[fss_write_parameter_object_e].locations.used != main->parameters.array[fss_write_parameter_content_e].locations.used && !(setting->flag & fss_write_flag_partial_e)) {
           setting->status = F_status_set_error(F_parameter);
 
           fss_write_print_line_first_locked(setting, main->error);
@@ -428,7 +428,7 @@ extern "C" {
           return;
         }
 
-        if ((setting->flag & fss_write_main_flag_content_e) && (setting->flag & fss_write_main_flag_partial_e)) {
+        if ((setting->flag & fss_write_flag_content_e) && (setting->flag & fss_write_flag_partial_e)) {
           if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) {
             setting->status = F_status_set_error(F_parameter);
 
@@ -439,31 +439,6 @@ extern "C" {
             return;
           }
         }
-
-        if (setting->flag & fss_write_main_flag_content_e) {
-          f_array_length_t location_object = 0;
-          f_array_length_t location_content = 0;
-          f_array_length_t location_sub_object = 0;
-          f_array_length_t location_sub_content = 0;
-
-          for (f_array_length_t i = 0; i < main->parameters.array[fss_write_parameter_object_e].locations.used; ++i) {
-
-            location_object = main->parameters.array[fss_write_parameter_object_e].locations.array[i];
-            location_content = main->parameters.array[fss_write_parameter_content_e].locations.array[i];
-            location_sub_object = main->parameters.array[fss_write_parameter_object_e].locations_sub.array[i];
-            location_sub_content = main->parameters.array[fss_write_parameter_content_e].locations_sub.array[i];
-
-            if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) {
-              setting->status = F_status_set_error(F_parameter);
-
-              fss_write_print_line_first_locked(setting, main->error);
-              fss_write_print_error_object_not_before_content(setting, main->error);
-              fss_write_print_line_last_locked(setting, main->error);
-
-              break;
-            }
-          } // for
-        }
       }
     }
 
@@ -481,10 +456,10 @@ extern "C" {
     }
 
     if (main->parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_main_flag_trim_e;
+      setting->flag |= fss_write_flag_trim_e;
     }
 
-    if (!(setting->flag & (fll_program_data_pipe_input_e | fss_write_main_flag_content_e | fss_write_parameter_object_e))) {
+    if (!(setting->flag & (fll_program_data_pipe_input_e | fss_write_flag_content_e | fss_write_parameter_object_e))) {
       setting->status = F_data_not;
     }
   }
index a65ea8e31ae2ab81a3839000a568593d39c643d0..1e4a8246bfc429edd5459dd0598f83e625318e8a 100644 (file)
@@ -62,9 +62,21 @@ extern "C" {
 /**
  * The program defines.
  *
+ * The fss_write_pipe_content_*_s strings are strings rather than characters to allow for wide characters.
+ *
  * payload_write_common_allocation_*:
  *   - large: An allocation step used for buffers that are anticipated to have large buffers.
  *   - small: An allocation step used for buffers that are anticipated to have small buffers.
+ *
+ * fss_write_pipe_content_*_s:
+ *   - end:    The character representing the end of content.
+ *   - ignore: The character representing the start of or end of a set of characters to ignore.
+ *   - start:  The character representing the start of content.
+ *
+ * macro_fss_write_setting:
+ *   - Used to represent a cast to ((fss_write_setting_t *) setting).
+ *   - Simplifies the number of parenthesis used to make code slightly cleaner.
+ *   - Is wrapped in a parenthesis and not a block.
  */
 #ifndef _di_fss_write_defines_
   #define fss_write_signal_check_d 20000
@@ -83,6 +95,8 @@ extern "C" {
   extern const f_string_static_t fss_write_pipe_content_end_s;
   extern const f_string_static_t fss_write_pipe_content_ignore_s;
   extern const f_string_static_t fss_write_pipe_content_start_s;
+
+  #define macro_fss_write_setting(setting) ((fss_write_setting_t *) setting)
 #endif // _di_fss_write_defines_
 
 /**
@@ -225,7 +239,7 @@ extern "C" {
 /**
  * Flags used to represent flags passed to the main function.
  *
- * fss_write_main_flag_*_e:
+ * fss_write_flag_*_e:
  *   - none:    No modes in use.
  *   - content: The Content being written is specified.
  *   - double:  Operate using double quotes.
@@ -235,26 +249,28 @@ extern "C" {
  *   - object:  The Object being written is specified.
  *   - partial: Do not write end of Object/Content character.
  *   - prepend: Prepend the given white space characters to the start of each multi-line Content.
+ *   - printed: Designate that the first line has been print for the main output.
  *   - single:  Operate using single quotes.
  *   - trim:    Trim Object names.
  *   - version: Print version.
  */
-#ifndef _di_fss_write_main_flag_e_
+#ifndef _di_fss_write_flag_e_
   enum {
-    fss_write_main_flag_none_e    = 0x0,
-    fss_write_main_flag_content_e = 0x1,
-    fss_write_main_flag_double_e  = 0x2,
-    fss_write_main_flag_file_to_e = 0x4,
-    fss_write_main_flag_help_e    = 0x8,
-    fss_write_main_flag_ignore_e  = 0x10,
-    fss_write_main_flag_object_e  = 0x20,
-    fss_write_main_flag_partial_e = 0x40,
-    fss_write_main_flag_prepend_e = 0x80,
-    fss_write_main_flag_single_e  = 0x100,
-    fss_write_main_flag_trim_e    = 0x200,
-    fss_write_main_flag_version_e = 0x400,
+    fss_write_flag_none_e    = 0x0,
+    fss_write_flag_content_e = 0x1,
+    fss_write_flag_double_e  = 0x2,
+    fss_write_flag_file_to_e = 0x4,
+    fss_write_flag_help_e    = 0x8,
+    fss_write_flag_ignore_e  = 0x10,
+    fss_write_flag_object_e  = 0x20,
+    fss_write_flag_partial_e = 0x40,
+    fss_write_flag_prepend_e = 0x80,
+    fss_write_flag_printed_e = 0x100,
+    fss_write_flag_single_e  = 0x200,
+    fss_write_flag_trim_e    = 0x400,
+    fss_write_flag_version_e = 0x800,
   };
-#endif // _di_fss_write_main_flag_e_
+#endif // _di_fss_write_flag_e_
 
 /**
  * The fss payload write main program settings.
@@ -320,11 +336,13 @@ extern "C" {
     void (*process_help)(fll_program_data_t * const main, void * const setting);
     void (*process_normal)(fll_program_data_t * const main, void * const setting);
     void (*process_pipe)(fll_program_data_t * const main, void * const setting);
+    void (*process_object)(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+    void (*process_content)(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
   } fss_write_setting_t;
 
   #define fss_write_setting_t_initialize \
     { \
-      fss_write_main_flag_none_e, \
+      fss_write_flag_none_e, \
       F_none, \
       macro_f_state_t_initialize(fss_write_common_allocation_large_d, fss_write_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, 0, 0), \
       f_string_range_t_initialize, \
@@ -344,6 +362,8 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
+      0, \
     }
 #endif // _di_fss_write_setting_t_
 
index 2e7ec1bac91447ec20b84414ceeed84fe2bbfd8d..1989ec4de1447e60a8bfc21004435b3552642f9a 100644 (file)
@@ -13,13 +13,13 @@ extern "C" {
 
     setting->status = F_none;
 
-    if (setting->flag & fss_write_main_flag_help_e) {
+    if (setting->flag & fss_write_flag_help_e) {
       setting->process_help(main, (void *) setting);
 
       return;
     }
 
-    if (setting->flag & fss_write_main_flag_version_e) {
+    if (setting->flag & fss_write_flag_version_e) {
       fll_program_print_version(main->message, fss_write_program_version_s);
 
       return;
@@ -32,16 +32,62 @@ extern "C" {
       if (F_status_is_error(setting->status)) return;
     }
 
-    if (setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e)) {
+    if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e)) {
       setting->process_normal(main, setting);
       if (F_status_is_error(setting->status)) return;
     }
 
-    // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
+    // Ensure a new line is always put at the end of the program execution.
     fss_write_print_line_last_locked(setting, main->message);
   }
 #endif // _di_fss_write_main_
 
+#ifndef _di_fss_write_process_set_
+  void fss_write_process_set(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_string_static_t * const object, const f_string_static_t * const content) {
+
+    setting->buffer.used = 0;
+
+    if (object) {
+      if (object->used) {
+        setting->range.start = 0;
+        setting->range.stop = object->used - 1;
+      }
+      else {
+        setting->range.start = 1;
+        setting->range.stop = 0;
+      }
+
+      setting->process_object(main, (void *) setting, object);
+      if (F_status_is_error(setting->status)) return;
+    }
+
+    if (content) {
+      if (content->used) {
+        setting->range.start = 0;
+        setting->range.stop = content->used - 1;
+      }
+      else {
+        setting->range.start = 1;
+        setting->range.stop = 0;
+      }
+
+      setting->process_content(main, (void *) setting, content);
+      if (F_status_is_error(setting->status)) return;
+    }
+
+    if (setting->buffer.used) {
+      fss_write_print_line_first_locked(setting, main->message);
+
+      f_file_stream_lock(main->output.to);
+
+      f_print_dynamic(setting->buffer, main->output.to);
+      f_print_dynamic_raw(f_string_eol_s, main->output.to);
+
+      f_file_stream_unlock(main->output.to);
+    }
+  }
+#endif // _di_fss_write_process_set_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 4468f25ebfdf0c585cb6b0083e76469c40fe38d5..a5727a08412fab412068bf33b247d5e33f9e7423 100644 (file)
@@ -77,6 +77,30 @@ extern "C" {
   extern void fss_write_main(fll_program_data_t * const main, fss_write_setting_t * const setting);
 #endif // _di_fss_write_main_
 
+/**
+ * Process a given Object and Content, printing the assigned FSS format if valid or an error if invalid.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *
+ *   This alters setting.status:
+ *     F_none on success.
+ *     F_interrupt on (exit) signal received.
+ *
+ *     F_parameter (with error bit) if main is NULL or setting is NULL.
+ * @param object
+ *   The object to validate and print.
+ *   Set pointer address to 0 to not use.
+ * @param content
+ *   The content to escape and print.
+ *   Set pointer address to 0 to not use.
+ */
+#ifndef _di_fss_write_process_set_
+  extern void fss_write_process_set(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_string_static_t * const object, const f_string_static_t * const content);
+#endif // _di_fss_write_process_set_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index b6956065a6fae9876cf1447af9cb7285b35cdf02..f7ccea3900fede973892e67e65b480befc33f634 100644 (file)
@@ -47,20 +47,22 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 #ifndef _di_fss_write_main_process_help_
   void fss_write_main_process_help(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_main_print_help((fss_write_setting_t *) setting, main->message);
+    fss_write_main_print_help(macro_fss_write_setting(setting), main->message);
   }
 #endif // _di_fss_write_main_process_help_
 
 #ifndef _di_fss_write_main_setting_load_as_
   void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
 
-    if (!main || !setting || F_status_is_error(setting->status) || (setting->flag & fss_write_main_flag_version_e)) return;
+    if (!main || !setting || F_status_is_error(setting->status) || (setting->flag & fss_write_flag_version_e)) return;
 
     setting->program_name = &fss_write_program_name_s;
     setting->program_name_long = &fss_write_program_name_long_s;
     setting->process_help = &fss_write_main_process_help;
     setting->process_pipe = &fss_write_basic_process_pipe;
     setting->process_normal = &fss_write_basic_process_normal;
+    setting->process_object = &fss_write_basic_process_object;
+    setting->process_content = &fss_write_basic_process_content;
 
     if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_as_e].values.used) {
 
@@ -80,6 +82,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_help = &fss_write_basic_process_help;
           setting->process_pipe = &fss_write_basic_process_pipe;
           setting->process_normal = &fss_write_basic_process_normal;
+          setting->process_object = &fss_write_basic_process_object;
+          setting->process_content = &fss_write_basic_process_content;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0001_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0001_s) == F_equal_to ||
@@ -90,6 +94,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_help = &fss_write_extended_process_help;
           setting->process_pipe = &fss_write_extended_process_pipe;
           setting->process_normal = &fss_write_extended_process_normal;
+          setting->process_object = &fss_write_extended_process_object;
+          setting->process_content = &fss_write_extended_process_content;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0002_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0002_s) == F_equal_to ||
@@ -100,6 +106,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_help = &fss_write_basic_list_process_help;
           setting->process_pipe = &fss_write_basic_list_process_pipe;
           setting->process_normal = &fss_write_basic_list_process_normal;
+          setting->process_object = &fss_write_basic_list_process_object;
+          setting->process_content = &fss_write_basic_list_process_content;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0003_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0003_s) == F_equal_to ||
@@ -110,6 +118,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_help = &fss_write_extended_list_process_help;
           setting->process_pipe = &fss_write_extended_list_process_pipe;
           setting->process_normal = &fss_write_extended_list_process_normal;
+          setting->process_object = &fss_write_extended_list_process_object;
+          setting->process_content = &fss_write_extended_list_process_content;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0008_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0008_s) == F_equal_to ||
@@ -120,6 +130,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_help = &fss_write_embedded_list_process_help;
           setting->process_pipe = &fss_write_embedded_list_process_pipe;
           setting->process_normal = &fss_write_embedded_list_process_normal;
+          setting->process_object = &fss_write_embedded_list_process_object;
+          setting->process_content = &fss_write_embedded_list_process_content;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_000e_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_000e_s) == F_equal_to ||
@@ -130,10 +142,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_help = &fss_write_payload_process_help;
           setting->process_pipe = &fss_write_payload_process_pipe;
           setting->process_normal = &fss_write_payload_process_normal;
-
+          setting->process_object = 0; // Not used by payload.
+           setting->process_content = 0; // Not used by payload.
         }
         else {
-          if (setting->flag & fss_write_main_flag_help_e) {
+          if (setting->flag & fss_write_flag_help_e) {
             setting->status = F_status_set_error(F_parameter);
 
             break;
@@ -150,7 +163,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
       } // for
 
       if (F_status_is_error(setting->status)) {
-        if (setting->flag & fss_write_main_flag_help_e) {
+        if (setting->flag & fss_write_flag_help_e) {
           fss_write_main_process_help(main, setting);
         }
         else {
@@ -163,7 +176,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     else if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
 
-      if (setting->flag & fss_write_main_flag_help_e) {
+      if (setting->flag & fss_write_flag_help_e) {
         fss_write_main_process_help(main, setting);
 
         return;
index 10d656e5cb711c16cf104a5a202a4d5b24633dd5..3cee7a831382fd652feec8e54e3ddad44e0aa33f 100644 (file)
@@ -31,24 +31,51 @@ extern "C" {
   }
 #endif // _di_fss_write_print_error_file_
 
-#ifndef _di_fss_write_print_error_object_not_before_content_
-  f_status_t fss_write_print_error_object_not_before_content(fss_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_fss_write_print_error_parameter_same_times_
+  f_status_t fss_write_print_error_parameter_same_times(fss_write_setting_t * const setting, const fl_print_t print) {
 
     if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
-    fl_print_format("%r%[%QEach '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
-    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_object_s, print.set->notable);
-    fl_print_format("%[' parameter must be specified before a '%]", print.to, print.set->error, print.set->error);
-    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.set->notable);
-    fl_print_format("%[' parameter.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+    fss_write_print_line_first_unlocked(setting, print);
+    fl_print_format("%[%QMust specify the '%]", print.to, print.context, print.prefix, print.context);
+    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_object_s, print.notable);
+    fl_print_format("%[' parameter and the '%]", print.to, print.context, print.context);
+    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.notable);
+    fl_print_format("%[' parameter the same number of times when not specifying the '%]", print.to, print.context, print.context);
+    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_partial_s, print.notable);
+    fl_print_format("%[' parameter.%]%r", print.to, print.context, print.context, f_string_eol_s);
+    fss_write_print_line_last_unlocked(setting, print);
 
     f_file_stream_unlock(print.to);
 
     return F_none;
   }
-#endif // _di_fss_write_print_error_object_not_before_content_
+#endif // _di_fss_write_print_error_parameter_same_times_
+
+// @todo replace fss_basic_write_error_parameter_value_missing_print with fll_program_print_error_parameter_missing_value.
+
+#ifndef _di_fss_write_print_error_parameter_unsupported_eol_object_
+  f_status_t fss_write_print_error_parameter_unsupported_eol_object(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard) {
+
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fss_write_print_line_first_unlocked(setting, print);
+    fl_print_format("%[%QThe %r standard does not support end of line character '%]", print.to, print.context, print.prefix, standard, print.context);
+    fl_print_format("%[\\n%]", print.to, print.notable, print.notable);
+    fl_print_format("%[' (%]", print.to, print.context, print.context);
+    fl_print_format("%[U+000A%]", print.to, print.notable, print.notable);
+    fl_print_format("%[) in objects.%]%r", print.to, print.context, print.context, f_string_eol_s);
+    fss_write_print_line_last_unlocked(setting, print);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_fss_write_print_error_parameter_unsupported_eol_object_
 
 #ifndef _di_fss_write_print_error_one_content_only_
   f_status_t fss_write_print_error_one_content_only(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard) {
@@ -134,9 +161,17 @@ extern "C" {
 #ifndef _di_fss_write_print_line_first_locked_
   f_status_t fss_write_print_line_first_locked(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (setting->flag & fss_write_flag_printed_e) return F_output_not;
 
-    if (!F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->status)) {
+      if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    }
+    else {
+
+      // Always set to true to regardless of whether printed actually happened for non-errors.
+      setting->flag |= fss_write_flag_printed_e;
+
+      if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
       if (print.verbosity == f_console_verbosity_error_e) return F_output_not;
     }
 
@@ -149,9 +184,17 @@ extern "C" {
 #ifndef _di_fss_write_print_line_first_unlocked_
   f_status_t fss_write_print_line_first_unlocked(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (setting->flag & fss_write_flag_printed_e) return F_output_not;
 
-    if (!F_status_is_error(setting->status)) {
+    if (F_status_is_error(setting->status)) {
+      if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    }
+    else {
+
+      // Always set to true to regardless of whether printed actually happened for non-errors.
+      setting->flag |= fss_write_flag_printed_e;
+
+      if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
       if (print.verbosity == f_console_verbosity_error_e) return F_output_not;
     }
 
@@ -168,7 +211,7 @@ extern "C" {
 
     if (!F_status_is_error(setting->status)) {
       if (print.verbosity == f_console_verbosity_error_e) return F_output_not;
-      if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not;
+      if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
     }
 
     fll_print_dynamic_raw(setting->line_last, print.to);
@@ -184,7 +227,7 @@ extern "C" {
 
     if (!F_status_is_error(setting->status)) {
       if (print.verbosity == f_console_verbosity_error_e) return F_output_not;
-      if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not;
+      if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
     }
 
     f_print_dynamic_raw(setting->line_last, print.to);
index 781b4e0b45a66da00fb8dbb9b28713b6b47df441..5740c9c360c8ed69d25286a117e9b5158536a915 100644 (file)
@@ -62,7 +62,7 @@ extern "C" {
 #endif // _di_fss_write_print_error_file_
 
 /**
- * Print error message about each Object parameter not being specified before a Content parameter.
+ * Print an error message about the object and content parameters not being specified the same number of times.
  *
  * @param setting
  *   The main program settings.
@@ -74,10 +74,34 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_fss_write_print_error_parameter_same_times_
+  extern f_status_t fss_write_print_error_parameter_same_times(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_print_error_parameter_same_times_
+
+/**
+ * Print an error message about a parameter a new line character '\n' (U+000A) being unsupported for an Object for the given standard.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.status.
+ * @param print
+ *   Designates the how and where to print.
+ * @param standard
+ *   The string used to communicate the standad that does not support the EOL character.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
  */
-#ifndef _di_fss_write_print_error_object_not_before_content_
-  extern f_status_t fss_write_print_error_object_not_before_content(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_error_object_not_before_content_
+#ifndef _di_fss_write_print_error_parameter_unsupported_eol_object_
+  extern f_status_t fss_write_print_error_parameter_unsupported_eol_object(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard);
+#endif // _di_fss_write_print_error_parameter_unsupported_eol_object_
 
 /**
  * Print an message about a multiple Content being unsupported.
index 86411d2bef34f8fd08b8da176ef08c6d0af970ca..1b3494ee0c66045ddefc122e47ca74db2ea60d03 100644 (file)
@@ -17,30 +17,6 @@ extern "C" {
   const f_string_static_t fss_write_format_code_human_000e_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_human_000e_s, 0, FSS_WRITE_format_code_human_000e_s_length);
 #endif // _di_fss_write_payload_strings_
 
-#ifndef _di_fss_write_payload_setting_load_
-  void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
-
-    if (!main || !setting) return;
-
-    f_array_lengths_t * const values = &main->parameters.array[fss_write_parameter_object_e].values;
-    f_string_static_t * const argv = main->parameters.arguments.array;
-
-    if ((main->parameters.array[fss_write_parameter_object_e].result & f_console_result_value_e) && values->used) {
-
-      for (f_array_length_t i = 0; i < values->used; ++i) {
-
-        if (fl_string_dynamic_compare(argv[values->array[i]], fss_write_payload_s) == F_equal_to && i + 1 < values->used) {
-          setting->status = F_status_set_error(F_parameter);
-
-          fss_write_payload_print_error_payload_not_last(setting, main->error);
-
-          return;
-        }
-      } // for
-    }
-  }
-#endif // _di_fss_write_payload_setting_load_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index e3493f41e7ac834c4d6b6a1892914aef83b7ef6f..e34d452f07420bdbd3418b234196bcfa82cb237b 100644 (file)
@@ -54,39 +54,6 @@ extern "C" {
   extern const f_string_static_t fss_write_format_code_human_000e_s;
 #endif // _di_fss_write_payload_strings_
 
-/**
- * Perform the payload-specific program setting load process.
- *
- * This prints error messages as appropriate.
- *
- * If either main or setting is NULL, then this immediately retuns without doing anything.
- *
- * @param arguments
- *   The parameters passed to the process (often referred to as command line arguments).
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *
- *   This alters setting.process_help, setting.process_normal, and setting.process_pipe.
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- *     F_parameter (with error bit) on parameter error.
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_data_not on success but nothing was provided to operate with.
- *
- * @see fss_write_setting_load()
- */
-#ifndef _di_fss_write_payload_setting_load_
-  extern void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting);
-#endif // _di_fss_write_payload_setting_load_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 712af001dbbfcc82bde2bdd40fc0c3d0e397d394..63b8feeb77869cfbd1c562fe574c0812f8a01097 100644 (file)
@@ -10,33 +10,21 @@ extern "C" {
 #ifndef _di_fss_write_payload_process_help_
   void fss_write_payload_process_help(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_payload_print_help((fss_write_setting_t *) setting, main->message);
+    fss_write_payload_print_help(macro_fss_write_setting(setting), main->message);
   }
 #endif // _di_fss_write_payload_process_help_
 
 #ifndef _di_fss_write_payload_process_normal_
-  void fss_write_payload_process_normal(fll_program_data_t * const main, void * const void_setting) {
+  void fss_write_payload_process_normal(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_setting_t * const setting = (fss_write_setting_t *) void_setting;
-    f_string_statics_t *objects = &setting->objects;
-    f_string_statics_t *contents = &setting->contents;
-    f_string_statics_t *data = &setting->objects;
-
-    if (setting->flag & fss_write_main_flag_partial_e) {
-      if (setting->flag & fss_write_main_flag_content_e) {
-        data = &setting->contents;
-        objects = 0;
-      }
-      else {
-        contents = 0;
-      }
-    }
+    f_string_statics_t * const data = (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e) ? &macro_fss_write_setting(setting)->objects : &macro_fss_write_setting(setting)->contents;
 
     for (f_array_length_t i = 0; i < data->used; ++i) {
 
+      // @todo replace all signal checks with forked main process that independently checks and assigns main->signal_received.
       if (!((++main->signal_check) % fss_write_signal_check_d)) {
         if (fll_program_standard_signal_received(main)) {
-          setting->status = F_status_set_error(F_interrupt);
+          macro_fss_write_setting(setting)->status = F_status_set_error(F_interrupt);
 
           return;
         }
@@ -44,16 +32,21 @@ extern "C" {
         main->signal_check = 0;
       }
 
-      fss_write_payload_process_set(main, setting, objects ? &objects->array[i] : 0, contents ? &contents->array[i] : 0);
-      if (F_status_is_error(setting->status)) return;
+      fss_write_payload_process_set(
+        main,
+        macro_fss_write_setting(setting),
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e) ? &macro_fss_write_setting(setting)->objects.array[i] : 0,
+        (macro_fss_write_setting(setting)->flag & fss_write_flag_content_e) ? &macro_fss_write_setting(setting)->contents.array[i] : 0
+      );
+
+      if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
     } // for
   }
 #endif // _di_fss_write_payload_process_normal_
 
 #ifndef _di_fss_write_payload_process_pipe_
-  void fss_write_payload_process_pipe(fll_program_data_t * const main, void * const void_setting) {
+  void fss_write_payload_process_pipe(fll_program_data_t * const main, void * const setting) {
 
-    fss_write_setting_t * const setting = (fss_write_setting_t *) void_setting;
     f_status_t status_pipe = F_none;
     f_file_t input = f_file_t_initialize;
     input.id = F_type_descriptor_input_d;
@@ -73,9 +66,9 @@ extern "C" {
 
       if (!((++main->signal_check) % fss_write_signal_check_d)) {
         if (fll_program_standard_signal_received(main)) {
-          fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+          fll_program_print_signal_received(main->warning, macro_fss_write_setting(setting)->line_first, main->signal_received);
 
-          setting->status = F_status_set_error(F_interrupt);
+          macro_fss_write_setting(setting)->status = F_status_set_error(F_interrupt);
 
           break;
         }
@@ -86,37 +79,37 @@ extern "C" {
       if (range.start > range.stop) {
         if (status_pipe == F_none_eof) break;
 
-        setting->block.used = 0;
+        macro_fss_write_setting(setting)->block.used = 0;
 
-        status_pipe = f_file_read_block(input, &setting->block);
+        status_pipe = f_file_read_block(input, &macro_fss_write_setting(setting)->block);
 
         if (F_status_is_error(status_pipe)) {
-          fss_write_print_error(setting, main->error, "f_file_read_block");
+          fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_file_read_block");
 
           status_pipe = F_status_set_error(F_pipe);
 
           break;
         }
 
-        if (!setting->block.used) break;
+        if (!macro_fss_write_setting(setting)->block.used) break;
 
         range.start = 0;
-        range.stop = setting->block.used - 1;
+        range.stop = macro_fss_write_setting(setting)->block.used - 1;
       }
 
       if (!state || state == 0x1) {
         if (!state) {
-          setting->object.used = 0;
-          setting->content.used = 0;
+          macro_fss_write_setting(setting)->object.used = 0;
+          macro_fss_write_setting(setting)->content.used = 0;
 
           state = 0x1;
         }
 
-        if (setting->object.used + setting->block.used > setting->object.size) {
-          setting->status = f_string_dynamic_increase_by(setting->block.used, &setting->object);
+        if (macro_fss_write_setting(setting)->object.used + macro_fss_write_setting(setting)->block.used > macro_fss_write_setting(setting)->object.size) {
+          macro_fss_write_setting(setting)->status = f_string_dynamic_increase_by(macro_fss_write_setting(setting)->block.used, &macro_fss_write_setting(setting)->object);
 
-          if (F_status_is_error(setting->status)) {
-            fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
+          if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+            fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_string_dynamic_increase_by");
 
             break;
           }
@@ -124,30 +117,30 @@ extern "C" {
 
         for (; range.start <= range.stop; ++range.start) {
 
-          if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+          if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
             state = 0x2;
             ++range.start;
 
             break;
           }
 
-          if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+          if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
             state = 0x3;
             ++range.start;
 
             break;
           }
 
-          if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
+          if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
 
             // This is not used by objects.
             continue;
           }
 
-          setting->object.string[setting->object.used++] = setting->block.string[range.start];
+          macro_fss_write_setting(setting)->object.string[macro_fss_write_setting(setting)->object.used++] = macro_fss_write_setting(setting)->block.string[range.start];
         } // for
 
-        if (F_status_is_error(setting->status)) break;
+        if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
 
         // If the start of content was not found, then fetch the next block.
         if (state == 0x1) continue;
@@ -165,19 +158,19 @@ extern "C" {
         }
 
         // When payload is provided, all data at this point is part of the payload until the end of the pipe.
-        if (fl_string_dynamic_compare(f_fss_string_payload_s, setting->object) == F_equal_to) {
+        if (fl_string_dynamic_compare(f_fss_string_payload_s, macro_fss_write_setting(setting)->object) == F_equal_to) {
           if (total > 1) {
-            setting->status = f_string_dynamic_increase_by(total, &setting->content);
+            macro_fss_write_setting(setting)->status = f_string_dynamic_increase_by(total, &macro_fss_write_setting(setting)->content);
 
-            if (F_status_is_error(setting->status)) {
-              fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
+            if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+              fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_string_dynamic_increase_by");
 
               break;
             }
 
-            memcpy(setting->content.string, setting->block.string + range.start, sizeof(f_char_t) * total);
+            memcpy(macro_fss_write_setting(setting)->content.string, macro_fss_write_setting(setting)->block.string + range.start, sizeof(f_char_t) * total);
 
-            setting->content.used += total;
+            macro_fss_write_setting(setting)->content.used += total;
           }
 
           state = 0x4;
@@ -191,45 +184,45 @@ extern "C" {
         }
 
         if (total) {
-          setting->status = f_string_dynamic_increase_by(total, &setting->content);
+          macro_fss_write_setting(setting)->status = f_string_dynamic_increase_by(total, &macro_fss_write_setting(setting)->content);
 
-          if (F_status_is_error(setting->status)) {
-            fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
+          if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+            fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_string_dynamic_increase_by");
 
             break;
           }
 
           for (; range.start <= range.stop; ++range.start) {
 
-            if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
-              setting->status = F_status_set_error(F_supported_not);
+            if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+              macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
 
               if (main->error.verbosity > f_console_verbosity_quiet_e) {
-                fss_write_print_line_first_locked(setting, main->error);
-                fss_write_print_error_one_content_only(setting, main->error, fss_write_payload_standard_s);
-                fss_write_print_line_last_locked(setting, main->error);
+                fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
+                fss_write_print_error_one_content_only(macro_fss_write_setting(setting), main->error, fss_write_payload_standard_s);
+                fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
               }
 
               break;
             }
 
-            if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+            if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
               state = 0x3;
               ++range.start;
 
               break;
             }
 
-            if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
+            if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
 
               // This is not used by this program.
               continue;
             }
 
-            setting->content.string[setting->content.used++] = setting->block.string[range.start];
+            macro_fss_write_setting(setting)->content.string[macro_fss_write_setting(setting)->content.used++] = macro_fss_write_setting(setting)->block.string[range.start];
           } // for
 
-          if (F_status_is_error(setting->status)) break;
+          if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
         }
         else {
           state = 0x3;
@@ -237,19 +230,19 @@ extern "C" {
       }
 
       if (state == 0x3) {
-        if (setting->flag & fss_write_main_flag_partial_e) {
-          if (setting->flag & fss_write_main_flag_content_e) {
-            fss_write_payload_process_set(main, setting, 0, &setting->content);
+        if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+          if (macro_fss_write_setting(setting)->flag & fss_write_flag_content_e) {
+            fss_write_payload_process_set(main, macro_fss_write_setting(setting), 0, &macro_fss_write_setting(setting)->content);
           }
           else {
-            fss_write_payload_process_set(main, setting, &setting->object, 0);
+            fss_write_payload_process_set(main, macro_fss_write_setting(setting), &macro_fss_write_setting(setting)->object, 0);
           }
         }
         else {
-          fss_write_payload_process_set(main, setting, &setting->object, &setting->content);
+          fss_write_payload_process_set(main, macro_fss_write_setting(setting), &macro_fss_write_setting(setting)->object, &macro_fss_write_setting(setting)->content);
         }
 
-        if (F_status_is_error(setting->status)) break;
+        if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
 
         state = 0;
         printed |= 0x1;
@@ -258,20 +251,20 @@ extern "C" {
       }
 
       if (state == 0x4) {
-        if (setting->block.used && range.start <= range.stop) {
+        if (macro_fss_write_setting(setting)->block.used && range.start <= range.stop) {
           length = (range.stop - range.start) + 1;
 
-          setting->status = f_string_dynamic_increase_by(length + 1, &setting->content);
+          macro_fss_write_setting(setting)->status = f_string_dynamic_increase_by(length + 1, &macro_fss_write_setting(setting)->content);
 
-          if (F_status_is_error(setting->status)) {
-            fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
+          if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+            fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_string_dynamic_increase_by");
 
             break;
           }
 
-          memcpy(setting->content.string + range.start, setting->block.string, sizeof(f_char_t) * length);
+          memcpy(macro_fss_write_setting(setting)->content.string + range.start, macro_fss_write_setting(setting)->block.string, sizeof(f_char_t) * length);
 
-          setting->content.used += length;
+          macro_fss_write_setting(setting)->content.used += length;
         }
 
         // Designate to read next block from pipe.
@@ -281,45 +274,45 @@ extern "C" {
     } // for
 
     // If the pipe ended before finishing, then attempt to wrap up.
-    if (F_status_is_error_not(setting->status) && status_pipe == F_none_eof && state) {
-      if (setting->flag & fss_write_main_flag_partial_e) {
-        if (setting->flag & fss_write_main_flag_content_e) {
-          fss_write_payload_process_set(main, setting, 0, &setting->content);
+    if (F_status_is_error_not(macro_fss_write_setting(setting)->status) && status_pipe == F_none_eof && state) {
+      if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
+        if (macro_fss_write_setting(setting)->flag & fss_write_flag_content_e) {
+          fss_write_payload_process_set(main, macro_fss_write_setting(setting), 0, &macro_fss_write_setting(setting)->content);
         }
         else {
-          fss_write_payload_process_set(main, setting, &setting->object, 0);
+          fss_write_payload_process_set(main, macro_fss_write_setting(setting), &macro_fss_write_setting(setting)->object, 0);
         }
       }
       else {
-        fss_write_payload_process_set(main, setting, &setting->object, &setting->content);
+        fss_write_payload_process_set(main, macro_fss_write_setting(setting), &macro_fss_write_setting(setting)->object, &macro_fss_write_setting(setting)->content);
       }
 
       printed |= 0x1;
     }
 
-    setting->block.used = 0;
-    setting->object.used = 0;
-    setting->content.used = 0;
-    setting->buffer.used = 0;
+    macro_fss_write_setting(setting)->block.used = 0;
+    macro_fss_write_setting(setting)->object.used = 0;
+    macro_fss_write_setting(setting)->content.used = 0;
+    macro_fss_write_setting(setting)->buffer.used = 0;
 
-    if (F_status_is_error_not(setting->status)) {
+    if (F_status_is_error_not(macro_fss_write_setting(setting)->status)) {
       if (printed & 0x1) {
         if (printed & 0x2) {
-          setting->status = F_payload;
+          macro_fss_write_setting(setting)->status = F_payload;
         }
         else {
-          setting->status = F_none;
+          macro_fss_write_setting(setting)->status = F_none;
         }
       }
       else {
-        setting->status = F_data_not;
+        macro_fss_write_setting(setting)->status = F_data_not;
       }
 
       // Print newline character to separate data printed from pipe.
-      if ((setting->flag & fss_write_main_flag_partial_e) && setting->objects.used) {
+      if ((macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) && macro_fss_write_setting(setting)->objects.used) {
         fll_print_dynamic(f_string_eol_s, main->output.to);
       }
-      else if (setting->contents.used) {
+      else if (macro_fss_write_setting(setting)->contents.used) {
         fll_print_dynamic(f_fss_payload_header_close_s, main->output.to);
       }
     }
@@ -340,7 +333,7 @@ extern "C" {
           setting->range.stop = 0;
         }
 
-        setting->status = fll_fss_payload_write(*object, *content, setting->flag & fss_write_main_flag_trim_e, setting->flag & fss_write_main_flag_prepend_e ? &setting->prepend : 0, setting->state, &setting->buffer);
+        setting->status = fll_fss_payload_write(*object, *content, setting->flag & fss_write_flag_trim_e, setting->flag & fss_write_flag_prepend_e ? &setting->prepend : 0, setting->state, &setting->buffer);
 
         if (F_status_set_fine(setting->status) == F_none_eol) {
           setting->status = F_status_set_error(F_supported_not);
@@ -404,7 +397,7 @@ extern "C" {
 
       const f_string_static_t *prepend = 0;
 
-      if (setting->flag & fss_write_main_flag_prepend_e) {
+      if (setting->flag & fss_write_flag_prepend_e) {
         const f_array_length_t index = main->parameters.array[fss_write_parameter_prepend_e].values.array[main->parameters.array[fss_write_parameter_prepend_e].values.used - 1];
 
         prepend = &main->parameters.arguments.array[index];
@@ -436,6 +429,30 @@ extern "C" {
   }
 #endif // _di_fss_write_payload_process_set_
 
+#ifndef _di_fss_write_payload_setting_load_
+  void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
+
+    if (!main || !setting) return;
+
+    f_array_lengths_t * const values = &main->parameters.array[fss_write_parameter_object_e].values;
+    f_string_static_t * const argv = main->parameters.arguments.array;
+
+    if ((main->parameters.array[fss_write_parameter_object_e].result & f_console_result_value_e) && values->used) {
+
+      for (f_array_length_t i = 0; i < values->used; ++i) {
+
+        if (fl_string_dynamic_compare(argv[values->array[i]], fss_write_payload_s) == F_equal_to && i + 1 < values->used) {
+          setting->status = F_status_set_error(F_parameter);
+
+          fss_write_payload_print_error_payload_not_last(setting, main->error);
+
+          return;
+        }
+      } // for
+    }
+  }
+#endif // _di_fss_write_payload_setting_load_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index f956e52225d0266eed98a891fea8ea8971e15ca2..eb342b05d6c0cf77f73784926004f91dceb32b3c 100644 (file)
@@ -136,6 +136,39 @@ extern "C" {
   extern void fss_write_payload_process_set(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_string_static_t *object, const f_string_static_t *content);
 #endif // _di_fss_write_payload_process_set_
 
+/**
+ * Perform the payload-specific program setting load process.
+ *
+ * This prints error messages as appropriate.
+ *
+ * If either main or setting is NULL, then this immediately retuns without doing anything.
+ *
+ * @param arguments
+ *   The parameters passed to the process (often referred to as command line arguments).
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *
+ *   This alters setting.process_help, setting.process_normal, and setting.process_pipe.
+ *
+ *   This alters setting.status:
+ *     F_none on success.
+ *     F_interrupt on (exit) signal received.
+ *
+ *     F_parameter (with error bit) if main is NULL or setting is NULL.
+ *     F_parameter (with error bit) on parameter error.
+ *
+ *   This alters setting.status:
+ *     F_none on success.
+ *     F_data_not on success but nothing was provided to operate with.
+ *
+ * @see fss_write_setting_load()
+ */
+#ifndef _di_fss_write_payload_setting_load_
+  extern void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting);
+#endif // _di_fss_write_payload_setting_load_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 430b4654ac3f1725c0b53818a7c22ad036b4c533..eae873bd7e2dc3eb1285363d4aadf37637abd441 100644 (file)
@@ -6,11 +6,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
   setting.state.data = (void *) &data;
+  setting.program_name = &fss_write_payload_program_name_s;
+  setting.program_name_long = &fss_write_payload_program_name_long_s;
   setting.process_help = &fss_write_payload_process_help;
   setting.process_pipe = &fss_write_payload_process_pipe;
   setting.process_normal = &fss_write_payload_process_normal;
-  setting.program_name = &fss_write_payload_program_name_s;
-  setting.program_name_long = &fss_write_payload_program_name_long_s;
+  setting.process_object = 0; // Not used by payload.
+  setting.process_content = 0; // Not used by payload.
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index 1830cfc93e9ac1eaf89c335088fd1be63b6fa52a..7bf428ace5225292be217ef7218c1bacda434a81 100644 (file)
@@ -1,12 +1,14 @@
 # fss-0005 iki-0002
+#
+# Builds the fss_write library and all programs.
+#
+# An optional "install" is provided as a convience and a sort of documentation.
+# This "install" only provides a very basic setup and it is strongly recommended to install manually or through some other means.
+#
 
 settings:
   fail exit
 
-  compiler gcc
-  indexer ar
-  indexer_arguments rcs
-
   environment PATH LD_LIBRARY_PATH
 
 main:
@@ -34,3 +36,13 @@ using_mode:
   #build settings.extended_list parameter:'mode:value'
   #build settings.embedded_list parameter:'mode:value'
   build settings.payload parameter:'mode:value'
+
+install:
+  shell ./install.sh parameter:'work'
+  #shell ./install.sh parameter:'work' -s data/build/settings.main
+  #shell ./install.sh parameter:'work' -s data/build/settings.basic
+  #shell ./install.sh parameter:'work' -s data/build/settings.basic_list
+  #shell ./install.sh parameter:'work' -s data/build/settings.extended
+  #shell ./install.sh parameter:'work' -s data/build/settings.extended_list
+  #shell ./install.sh parameter:'work' -s data/build/settings.embedded_list
+  shell ./install.sh parameter:'work' -s data/build/settings.payload
index 1433f8a514690eb47bb38ea51224a93e04046c07..de9673126688d68845e96248e4c8288f23f52d57 100644 (file)
@@ -159,7 +159,7 @@ extern "C" {
       }
     }
 
-    // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
+    // Ensure a new line is always put at the end of the program execution.
     iki_read_print_line_last_locked(setting, main->message);
   }
 #endif // _di_iki_read_main_
index 136f7ef006b7da3e76aa845df9e295831f21ff56..8f09554defd44f918faae5e7a1d77b53ab51490e 100644 (file)
@@ -180,7 +180,7 @@ extern "C" {
       fll_print_dynamic_raw(f_string_eol_s, main->output.to);
     } // for
 
-    // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
+    // Ensure a new line is always put at the end of the program execution.
     iki_write_print_line_last_locked(setting, main->message);
   }
 #endif // _di_iki_write_main_
index 72304f1aae07fc73c6af20a1a9ce9fb1170276ab..7a56aa8138a0c9eecdf7cf2d36ba4e2d087ffc3d 100644 (file)
@@ -25,7 +25,7 @@ Featureless Settings Specification: 0000 - Basic:
   Key\:
     code:"\s" = White space, except newline.
     code:"\b" = Either white space or printable, except newline.
-    code:"\q" = Non-white space or quoted white space with no white space outside of the quotes.
+    code:"\q" = Non-white space or quoted white space (and non-whitespace) with no white space outside of the quotes.
     code:"\n" = Newline.
     code:"*" = Zero or more occurrences.
     code:"+" = One or more occurrences.
index d584c8294797f5077866d10f3b1b69d58da65d94..deb712438693b52aac86a0b1d092bbe572c06987 100644 (file)
@@ -23,7 +23,7 @@ Featureless Settings Specification: 0001 - Extended:
   Key\:
     code:"\s" = White space, except newline.
     code:"\b" = Either white space or printable, except newline.
-    code:"\q" = Non-white space or quoted white space, no white space outside of quotes.
+    code:"\q" = Non-white space or quoted white space (and non-whitespace) with no white space outside of the quotes.
     code:"\n" = Newline.
     code:"*" = Zero or more occurrences.
     code:"+" = One or more occurrences.
index 80da739f76d3a2e31d552f8478bbf3a7d6154695..35df069bbc5aa64af4b93c65c0e896be591447d4 100644 (file)
@@ -27,7 +27,7 @@ Featureless Settings Specification: 0009 - Reverse Mapping:
   Key\:
     code:"\s" = White space, except newline.
     code:"\b" = Either white space or printable, except newline.
-    code:"\q" = Non-white space or quoted white space with no white space outside of the quotes.
+    code:"\q" = Non-white space or quoted white space (and non-whitespace) with no white space outside of the quotes.
     code:"\n" = Newline.
     code:"*" = Zero or more occurrences.
     code:"+" = One or more occurrences.
index 5d8640b527327faadc14c4bb30e8df41a5ee6e0a..c15177d1c25c4e56653b075ac13347cedd20cdb6 100644 (file)
@@ -25,7 +25,7 @@ Featureless Settings Specification: 000A - Extended Reverse Mapping:
   Key\:
     code:"\s" = White space, except newline.
     code:"\b" = Either white space or printable, except newline.
-    code:"\q" = Non-white space or quoted white space, no white space outside of quotes.
+    code:"\q" = Non-white space or quoted white space (and non-whitespace) with no white space outside of the quotes.
     code:"\n" = Newline.
     code:"*" = Zero or more occurrences.
     code:"+" = One or more occurrences.