]> Kevux Git Server - fll/commitdiff
Update: Finish updating fss_write.
authorKevin Day <thekevinday@gmail.com>
Sat, 10 Dec 2022 17:28:35 +0000 (11:28 -0600)
committerKevin Day <thekevinday@gmail.com>
Sat, 10 Dec 2022 17:28:35 +0000 (11:28 -0600)
Remove the unused files.
Simplify the processing callbacks using ternary operators.
Resolve the void_setting to the specific setting for easier to read code at the cost of allocation more memory (1 memory address variable per function).
Implement the ignore functionality.
Make sure the multiple Content is supported where appropriate.
The flags must not be reset at the start of the setting load so that main.c programs can pre-fill the flags.
Add all of the supported write program setting files.
Other miscellaneous changes and fixes.

The pipe data is lacking and will need future reviews and probably will need fixes.
The original fss_*_write pipe data is also lacking so I feel that it is fine to leave it alone for now to be addressed later on.

72 files changed:
level_3/fss_write/c/basic/fss_write.c
level_3/fss_write/c/basic/main.c
level_3/fss_write/c/basic/print.c
level_3/fss_write/c/basic/private-common.c [deleted file]
level_3/fss_write/c/basic/private-common.h [deleted file]
level_3/fss_write/c/basic/private-print.c [deleted file]
level_3/fss_write/c/basic/private-print.h [deleted file]
level_3/fss_write/c/basic/private-write.c [deleted file]
level_3/fss_write/c/basic/private-write.h [deleted file]
level_3/fss_write/c/basic_list/fss_write.c
level_3/fss_write/c/basic_list/main.c
level_3/fss_write/c/basic_list/print.c
level_3/fss_write/c/basic_list/private-common.c [deleted file]
level_3/fss_write/c/basic_list/private-common.h [deleted file]
level_3/fss_write/c/basic_list/private-print.c [deleted file]
level_3/fss_write/c/basic_list/private-print.h [deleted file]
level_3/fss_write/c/basic_list/private-write.c [deleted file]
level_3/fss_write/c/basic_list/private-write.h [deleted file]
level_3/fss_write/c/embedded_list/fss_write.c
level_3/fss_write/c/embedded_list/main.c
level_3/fss_write/c/embedded_list/print.c
level_3/fss_write/c/embedded_list/private-common.c [deleted file]
level_3/fss_write/c/embedded_list/private-common.h [deleted file]
level_3/fss_write/c/embedded_list/private-print.c [deleted file]
level_3/fss_write/c/embedded_list/private-print.h [deleted file]
level_3/fss_write/c/embedded_list/private-write.c [deleted file]
level_3/fss_write/c/embedded_list/private-write.h [deleted file]
level_3/fss_write/c/extended/fss_write.c
level_3/fss_write/c/extended/main.c
level_3/fss_write/c/extended/print.c
level_3/fss_write/c/extended/private-common.c [deleted file]
level_3/fss_write/c/extended/private-common.h [deleted file]
level_3/fss_write/c/extended/private-print.c [deleted file]
level_3/fss_write/c/extended/private-print.h [deleted file]
level_3/fss_write/c/extended/private-write.c [deleted file]
level_3/fss_write/c/extended/private-write.h [deleted file]
level_3/fss_write/c/extended_list/fss_write.c
level_3/fss_write/c/extended_list/main.c
level_3/fss_write/c/extended_list/print.c
level_3/fss_write/c/extended_list/private-common.c [deleted file]
level_3/fss_write/c/extended_list/private-common.h [deleted file]
level_3/fss_write/c/extended_list/private-print.c [deleted file]
level_3/fss_write/c/extended_list/private-print.h [deleted file]
level_3/fss_write/c/extended_list/private-write.c [deleted file]
level_3/fss_write/c/extended_list/private-write.h [deleted file]
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/private-common.c [deleted file]
level_3/fss_write/c/main/private-common.h [deleted file]
level_3/fss_write/c/main/private-write.c [deleted file]
level_3/fss_write/c/main/private-write.h [deleted file]
level_3/fss_write/c/payload/fss_write.c
level_3/fss_write/c/payload/fss_write.h
level_3/fss_write/c/payload/main.c
level_3/fss_write/c/payload/print.c
level_3/fss_write/c/payload/private-common.c [deleted file]
level_3/fss_write/c/payload/private-common.h [deleted file]
level_3/fss_write/c/payload/private-print.c [deleted file]
level_3/fss_write/c/payload/private-print.h [deleted file]
level_3/fss_write/c/payload/private-write.c [deleted file]
level_3/fss_write/c/payload/private-write.h [deleted file]
level_3/fss_write/data/build/fakefile
level_3/fss_write/data/build/settings
level_3/fss_write/data/build/settings.basic [new file with mode: 0644]
level_3/fss_write/data/build/settings.basic_list [new file with mode: 0644]
level_3/fss_write/data/build/settings.embedded_list [new file with mode: 0644]
level_3/fss_write/data/build/settings.extended [new file with mode: 0644]
level_3/fss_write/data/build/settings.extended_list [new file with mode: 0644]

index 92f604827856c10a5a86480ff8b1eb9c5bdc4c0b..57c01c336ea89187708c0b13c715811ca3170334 100644 (file)
@@ -1,6 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
 #include "../main/fss_write.h"
 
 #ifdef __cplusplus
@@ -8,39 +6,32 @@ 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 bool last) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_basic_content_write(
-        *macro_fss_write_setting(setting)->content,
-        f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
-        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(
-        *macro_fss_write_setting(setting)->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
-      );
-    }
+  void fss_write_basic_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_basic_content_write(
+      *setting->content,
+      (setting->flag & fss_write_flag_partial_e)
+        ? f_fss_complete_partial_e
+        : f_fss_complete_full_e,
+      setting->state,
+      &setting->range,
+      &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_support_not);
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_basic_content_write");
 
       return;
     }
@@ -50,50 +41,44 @@ extern "C" {
 #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(macro_fss_write_setting(setting), main->message);
+    fss_write_basic_print_help(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) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_basic_object_write(
-        *macro_fss_write_setting(setting)->object,
-        macro_fss_write_setting(setting)->quote.used
-          ? macro_fss_write_setting(setting)->quote.string[0]
-          : f_fss_quote_double_s.string[0],
-        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(
-        *macro_fss_write_setting(setting)->object,
-        macro_fss_write_setting(setting)->quote.used
-          ? macro_fss_write_setting(setting)->quote.string[0]
-          : f_fss_quote_double_s.string[0],
-        (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_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+  void fss_write_basic_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_basic_object_write(
+      *setting->object,
+      setting->quote.used
+        ? setting->quote.string[0]
+        : f_fss_quote_double_s.string[0],
+      (setting->flag & fss_write_flag_partial_e)
+        ? (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_partial_trim_e
+          : f_fss_complete_partial_e
+        : (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_full_trim_e
+          : f_fss_complete_full_e,
+      setting->state,
+      &setting->range,
+      &setting->buffer
+    );
+
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_not);
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_basic_object_write");
     }
   }
 #endif // _di_fss_write_basic_process_object_
index c329c3c9b6af826acd809d9b0616780ef3f93574..2037ba2952508f4b9ddc8cd82b32f3a4641c05c7 100644 (file)
@@ -1,18 +1,20 @@
 #include "fss_write.h"
+#include "../main/fss_write.h"
 
 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.standard = fss_write_basic_standard_s;
   setting.program_name = &fss_write_basic_program_name_s;
   setting.program_name_long = &fss_write_basic_program_name_long_s;
   setting.process_content = &fss_write_basic_process_content;
   setting.process_help = &fss_write_basic_process_help;
-  setting.process_normal = &fss_write_basic_process_normal;
+  setting.process_normal = &fss_write_process_normal;
   setting.process_object = &fss_write_basic_process_object;
   setting.process_pipe = &fss_write_process_pipe;
-  setting.process_set = &fss_write_process_normal;
+  setting.process_set = &fss_write_process_set;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -32,7 +34,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
-  fss_write_basic_main(&data, &setting);
+  fss_write_main(&data, &setting);
 
   fss_write_setting_unload(&data, &setting);
 
index 75ff0f7a3abf3b1148fe7245209f6c8769d22cfb..d34c78b00f8f72619f8fa9e2db6c6223b23fbd94 100644 (file)
@@ -1,5 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/fss_write/c/basic/private-common.c b/level_3/fss_write/c/basic/private-common.c
deleted file mode 100644 (file)
index 8ae3dfd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/basic/private-common.h b/level_3/fss_write/c/basic/private-common.h
deleted file mode 100644 (file)
index 372a8f3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_common_h
-#define _PRIVATE_fss_write_basic_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_common_h
diff --git a/level_3/fss_write/c/basic/private-print.c b/level_3/fss_write/c/basic/private-print.c
deleted file mode 100644 (file)
index 0f7be74..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/basic/private-print.h b/level_3/fss_write/c/basic/private-print.h
deleted file mode 100644 (file)
index d5185f4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_print_h
-#define _PRIVATE_fss_write_basic_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_print_h
diff --git a/level_3/fss_write/c/basic/private-write.c b/level_3/fss_write/c/basic/private-write.c
deleted file mode 100644 (file)
index e3c2ad5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/basic/private-write.h b/level_3/fss_write/c/basic/private-write.h
deleted file mode 100644 (file)
index 0c87310..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_write_h
-#define _PRIVATE_fss_write_basic_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_write_h
index f2d86a1207aa7829f63c458d3fd084b14ea1d521..df635927ce2a2fe0c177e954d39694299036e9f9 100644 (file)
@@ -1,6 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
 #include "../main/fss_write.h"
 
 #ifdef __cplusplus
@@ -8,41 +6,35 @@ 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 bool last) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_basic_list_content_write(
-        *macro_fss_write_setting(setting)->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(
-        *macro_fss_write_setting(setting)->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_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+  void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_basic_list_content_write(
+      *setting->content,
+      (setting->flag & fss_write_flag_partial_e)
+        ? f_fss_complete_partial_e
+        : (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_full_trim_e
+          : f_fss_complete_full_e,
+      &setting->prepend,
+      setting->state,
+      &setting->range,
+      &setting->buffer
+    );
+
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_not);
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_basic_list_content_write");
 
       return;
     }
@@ -52,44 +44,41 @@ extern "C" {
 #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(macro_fss_write_setting(setting), main->message);
+    fss_write_basic_list_print_help(setting, main->message);
   }
 #endif // _di_fss_write_basic_list_process_help_
 
 #ifndef _di_fss_write_basic_list_process_object_
-  void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const setting) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_basic_list_object_write(
-        *macro_fss_write_setting(setting)->object,
-        f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
-        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(
-        *macro_fss_write_setting(setting)->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_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+  void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_basic_list_object_write(
+      *setting->object,
+      (setting->flag & fss_write_flag_partial_e)
+        ? (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_partial_trim_e
+          : f_fss_complete_partial_e
+        : (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_full_trim_e
+          : f_fss_complete_full_e,
+      setting->state,
+      &setting->range,
+      &setting->buffer
+    );
+
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_not);
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_basic_list_object_write");
     }
   }
 #endif // _di_fss_write_basic_list_process_object_
index 2c5b01ff5afed8a5f4111ec61897cfd1ba86ed19..31017867894a4858b450441f7703f4160cc6b5ab 100644 (file)
@@ -1,18 +1,20 @@
 #include "fss_write.h"
+#include "../main/fss_write.h"
 
 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.standard = fss_write_basic_list_standard_s;
   setting.program_name = &fss_write_basic_list_program_name_s;
   setting.program_name_long = &fss_write_basic_list_program_name_long_s;
   setting.process_content = &fss_write_basic_list_process_content;
   setting.process_help = &fss_write_basic_list_process_help;
-  setting.process_normal = &fss_write_basic_list_process_normal;
+  setting.process_normal = &fss_write_process_normal;
   setting.process_object = &fss_write_basic_list_process_object;
-  setting.process_pipe = &fss_write_basic_list_process_pipe;
-  setting.process_set = &fss_write_process_normal;
+  setting.process_pipe = &fss_write_process_pipe;
+  setting.process_set = &fss_write_process_set;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -32,7 +34,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
-  fss_write_basic_list_main(&data, &setting);
+  fss_write_main(&data, &setting);
 
   fss_write_setting_unload(&data, &setting);
 
index 78a16fab92ccb162417ba19fe93fcb2accb36f74..2ee5e26deef82740c3ace8b6a60f56f2b445bf3c 100644 (file)
@@ -1,5 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/fss_write/c/basic_list/private-common.c b/level_3/fss_write/c/basic_list/private-common.c
deleted file mode 100644 (file)
index 8ae3dfd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/basic_list/private-common.h b/level_3/fss_write/c/basic_list/private-common.h
deleted file mode 100644 (file)
index 15d08f1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_list_common_h
-#define _PRIVATE_fss_write_basic_list_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_list_common_h
diff --git a/level_3/fss_write/c/basic_list/private-print.c b/level_3/fss_write/c/basic_list/private-print.c
deleted file mode 100644 (file)
index 0f7be74..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/basic_list/private-print.h b/level_3/fss_write/c/basic_list/private-print.h
deleted file mode 100644 (file)
index a73b839..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_list_print_h
-#define _PRIVATE_fss_write_basic_list_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_list_print_h
diff --git a/level_3/fss_write/c/basic_list/private-write.c b/level_3/fss_write/c/basic_list/private-write.c
deleted file mode 100644 (file)
index e3c2ad5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/basic_list/private-write.h b/level_3/fss_write/c/basic_list/private-write.h
deleted file mode 100644 (file)
index dbe4d7f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_list_write_h
-#define _PRIVATE_fss_write_basic_list_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_list_write_h
index 69c27436c06f721c584765ca2d3e1f7e51064e3b..c3a4756736f35d0fa4b2b60c56440f9d0a15a593 100644 (file)
@@ -1,6 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
 #include "../main/fss_write.h"
 
 #ifdef __cplusplus
@@ -8,43 +6,36 @@ 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 bool last) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_embedded_list_content_write(
-        *macro_fss_write_setting(setting)->content,
-        f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
-        &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(
-        *macro_fss_write_setting(setting)->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_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+  void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_embedded_list_content_write(
+      *setting->content,
+      (setting->flag & fss_write_flag_partial_e)
+        ? f_fss_complete_partial_e
+        : last
+          ? f_fss_complete_end_e
+          : f_fss_complete_next_e,
+      &setting->prepend,
+      setting->ignores,
+      setting->state,
+      &setting->range,
+      &setting->buffer
+    );
+
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_not);
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_embedded_list_content_write");
 
       return;
     }
@@ -54,44 +45,41 @@ extern "C" {
 #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(macro_fss_write_setting(setting), main->message);
+    fss_write_embedded_list_print_help(setting, main->message);
   }
 #endif // _di_fss_write_embedded_list_process_help_
 
 #ifndef _di_fss_write_embedded_list_process_object_
-  void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const setting) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_embedded_list_object_write(
-        *macro_fss_write_setting(setting)->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(
-        *macro_fss_write_setting(setting)->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_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+  void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_embedded_list_object_write(
+      *setting->object,
+      (setting->flag & fss_write_flag_partial_e)
+        ? (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_partial_trim_e
+          : f_fss_complete_partial_e
+        : (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_full_trim_e
+          : f_fss_complete_full_e,
+      setting->state,
+      &setting->range,
+      &setting->buffer
+    );
+
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_not);
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_embedded_list_object_write");
     }
   }
 #endif // _di_fss_write_embedded_list_process_object_
index 253b605d7e5d073f69ab15d2f252b4b9d603b64c..bde0b1950bfa2f3bb0c81e9e67c9ca1a5c29caca 100644 (file)
@@ -1,19 +1,22 @@
 #include "fss_write.h"
+#include "../main/fss_write.h"
 
 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.standard = fss_write_embedded_list_standard_s;
   setting.program_name = &fss_write_embedded_list_program_name_s;
   setting.program_name_long = &fss_write_embedded_list_program_name_long_s;
   setting.process_content = &fss_write_embedded_list_process_content;
   setting.process_help = &fss_write_embedded_list_process_help;
-  setting.process_normal = &fss_write_embedded_list_process_normal;
+  setting.process_normal = &fss_write_process_normal;
   setting.process_object = &fss_write_embedded_list_process_object;
-  setting.process_pipe = &fss_write_embedded_list_process_pipe;
-  setting.process_set = &fss_write_process_normal;
+  setting.process_pipe = &fss_write_process_pipe;
+  setting.process_set = &fss_write_process_set;
   setting.flag |= fss_write_flag_ignore_e;
+  setting.flag |= fss_write_flag_content_multiple_e;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -33,7 +36,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
-  fss_write_embedded_list_main(&data, &setting);
+  fss_write_main(&data, &setting);
 
   fss_write_setting_unload(&data, &setting);
 
index 20255fd3a65d1ed405a497d8b055daea1045c3de..a5c338a729212a4f50fe26b8d043b39c16f4862f 100644 (file)
@@ -1,5 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/fss_write/c/embedded_list/private-common.c b/level_3/fss_write/c/embedded_list/private-common.c
deleted file mode 100644 (file)
index 8ae3dfd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/embedded_list/private-common.h b/level_3/fss_write/c/embedded_list/private-common.h
deleted file mode 100644 (file)
index 3cc9f06..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_embedded_list_common_h
-#define _PRIVATE_fss_write_embedded_list_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_embedded_list_common_h
diff --git a/level_3/fss_write/c/embedded_list/private-print.c b/level_3/fss_write/c/embedded_list/private-print.c
deleted file mode 100644 (file)
index 0f7be74..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/embedded_list/private-print.h b/level_3/fss_write/c/embedded_list/private-print.h
deleted file mode 100644 (file)
index 26e7567..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_embedded_list_print_h
-#define _PRIVATE_fss_write_embedded_list_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_embedded_list_print_h
diff --git a/level_3/fss_write/c/embedded_list/private-write.c b/level_3/fss_write/c/embedded_list/private-write.c
deleted file mode 100644 (file)
index e3c2ad5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/embedded_list/private-write.h b/level_3/fss_write/c/embedded_list/private-write.h
deleted file mode 100644 (file)
index 1b3876b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_embedded_list_write_h
-#define _PRIVATE_fss_write_embedded_list_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_embedded_list_write_h
index 8885091f1628a161aa78c2a723327ce305deada5..6093ece123eb858182948c25df9aa0c35d137b63 100644 (file)
@@ -1,6 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
 #include "../main/fss_write.h"
 
 #ifdef __cplusplus
@@ -8,45 +6,37 @@ 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 bool last) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_extended_content_write(
-        *macro_fss_write_setting(setting)->content,
-        macro_fss_write_setting(setting)->quote.used
-          ? macro_fss_write_setting(setting)->quote.string[0]
-          : f_fss_quote_double_s.string[0],
-        f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
-        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(
-        *macro_fss_write_setting(setting)->content,
-        macro_fss_write_setting(setting)->quote.used
-          ? macro_fss_write_setting(setting)->quote.string[0]
-          : f_fss_quote_double_s.string[0],
-        (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_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+  void fss_write_extended_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_extended_content_write(
+      *setting->content,
+      setting->quote.used
+        ? setting->quote.string[0]
+        : f_fss_quote_double_s.string[0],
+      (setting->flag & fss_write_flag_partial_e)
+        ? f_fss_complete_partial_e
+        : last
+          ? f_fss_complete_end_e
+          : f_fss_complete_next_e,
+      setting->state,
+      &setting->range,
+      &setting->buffer
+    );
+
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_not);
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_extended_content_write");
 
       return;
     }
@@ -56,50 +46,44 @@ extern "C" {
 #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(macro_fss_write_setting(setting), main->message);
+    fss_write_extended_print_help(setting, main->message);
   }
 #endif // _di_fss_write_extended_process_help_
 
 #ifndef _di_fss_write_extended_process_object_
-  void fss_write_extended_process_object(fll_program_data_t * const main, void * const setting) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_extended_object_write(
-        *macro_fss_write_setting(setting)->object,
-        macro_fss_write_setting(setting)->quote.used
-          ? macro_fss_write_setting(setting)->quote.string[0]
-          : f_fss_quote_double_s.string[0],
-        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(
-        *macro_fss_write_setting(setting)->object,
-        macro_fss_write_setting(setting)->quote.used
-          ? macro_fss_write_setting(setting)->quote.string[0]
-          : f_fss_quote_double_s.string[0],
-        (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_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+  void fss_write_extended_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_extended_object_write(
+      *setting->object,
+      setting->quote.used
+        ? setting->quote.string[0]
+        : f_fss_quote_double_s.string[0],
+      (setting->flag & fss_write_flag_partial_e)
+        ? (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_partial_trim_e
+          : f_fss_complete_partial_e
+        : (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_full_trim_e
+          : f_fss_complete_full_e,
+      setting->state,
+      &setting->range,
+      &setting->buffer
+    );
+
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_not);
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_extended_object_write");
     }
   }
 #endif // _di_fss_write_extended_process_object_
index 322f590f840c681c8e91e8e6130dc523ea26e9db..37bfa076ca50f6f0fa66828da29f341295f78764 100644 (file)
@@ -1,18 +1,21 @@
 #include "fss_write.h"
+#include "../main/fss_write.h"
 
 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.standard = fss_write_extended_standard_s;
   setting.program_name = &fss_write_extended_program_name_s;
   setting.program_name_long = &fss_write_extended_program_name_long_s;
-  setting.process_content = &fss_write_exended_process_content;
+  setting.process_content = &fss_write_extended_process_content;
   setting.process_help = &fss_write_extended_process_help;
-  setting.process_normal = &fss_write_extended_process_normal;
-  setting.process_object = &fss_write_exended_process_object;
-  setting.process_pipe = &fss_write_extended_process_pipe;
-  setting.process_set = &fss_write_process_normal;
+  setting.process_normal = &fss_write_process_normal;
+  setting.process_object = &fss_write_extended_process_object;
+  setting.process_pipe = &fss_write_process_pipe;
+  setting.process_set = &fss_write_process_set;
+  setting.flag |= fss_write_flag_content_multiple_e;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -32,7 +35,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
-  fss_write_extended_main(&data, &setting);
+  fss_write_main(&data, &setting);
 
   fss_write_setting_unload(&data, &setting);
 
index ec4ff7fe9e5594b555b079c8b50f92b7eaa01bd7..887bd3a254bbda70cc5c415626b129157473226b 100644 (file)
@@ -1,5 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/fss_write/c/extended/private-common.c b/level_3/fss_write/c/extended/private-common.c
deleted file mode 100644 (file)
index 8ae3dfd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/extended/private-common.h b/level_3/fss_write/c/extended/private-common.h
deleted file mode 100644 (file)
index 75ef75a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_common_h
-#define _PRIVATE_fss_write_extended_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_common_h
diff --git a/level_3/fss_write/c/extended/private-print.c b/level_3/fss_write/c/extended/private-print.c
deleted file mode 100644 (file)
index 0f7be74..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/extended/private-print.h b/level_3/fss_write/c/extended/private-print.h
deleted file mode 100644 (file)
index c9a1b96..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_print_h
-#define _PRIVATE_fss_write_extended_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_print_h
diff --git a/level_3/fss_write/c/extended/private-write.c b/level_3/fss_write/c/extended/private-write.c
deleted file mode 100644 (file)
index e3c2ad5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/extended/private-write.h b/level_3/fss_write/c/extended/private-write.h
deleted file mode 100644 (file)
index 449dab4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_write_h
-#define _PRIVATE_fss_write_extended_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_write_h
index a0b587180eb8e8d29c9645e1916abab7de7796ef..0bce5f4fd67f471e02ae313adb5ec4ff7f1f3e58 100644 (file)
@@ -1,6 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
 #include "../main/fss_write.h"
 
 #ifdef __cplusplus
@@ -8,43 +6,36 @@ 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 bool last) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_extended_list_content_write(
-        *macro_fss_write_setting(setting)->content,
-        last ? f_fss_complete_partial_e : f_fss_complete_partial_trim_e, // @fixme each of these needs to have "partial", "trim", etc..
-        &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(
-        *macro_fss_write_setting(setting)->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_support_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_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+  void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_extended_list_content_write(
+      *setting->content,
+      (setting->flag & fss_write_flag_partial_e)
+        ? last
+          ? f_fss_complete_none_e
+          : f_fss_complete_partial_e
+        : f_fss_complete_full_e,
+      &setting->prepend,
+      setting->ignores,
+      setting->state,
+      &setting->range,
+      &setting->buffer
+    );
+
+    if (F_status_set_fine(setting->status) == F_none_eol) {
+      setting->status = F_status_set_error(F_support_not);
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_error_unsupported_eol(setting, main->error);
+      fss_write_print_line_last_locked(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");
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "fl_fss_extended_list_content_write");
 
       return;
     }
@@ -59,26 +50,23 @@ extern "C" {
 #endif // _di_fss_write_extended_list_process_help_
 
 #ifndef _di_fss_write_extended_list_process_object_
-  void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const setting) {
-
-    if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-      macro_fss_write_setting(setting)->status = fl_fss_extended_list_object_write(
-        *macro_fss_write_setting(setting)->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(
-        *macro_fss_write_setting(setting)->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
-      );
-    }
+  void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->status = fl_fss_extended_list_object_write(
+      *setting->object,
+      (setting->flag & fss_write_flag_partial_e)
+        ? (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_partial_trim_e
+          : f_fss_complete_partial_e
+        : (setting->flag & fss_write_flag_trim_e)
+          ? f_fss_complete_full_trim_e
+          : f_fss_complete_full_e,
+      setting->state,
+      &setting->range,
+      &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_support_not);
index 8bd3e77783ad98dfb2996dc1666efbbb75821749..33dad7b3019c0e7b094abc8b79ee1eedcf853fe1 100644 (file)
@@ -1,18 +1,20 @@
 #include "fss_write.h"
+#include "../main/fss_write.h"
 
 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.standard = fss_write_extended_list_standard_s;
   setting.program_name = &fss_write_extended_list_program_name_s;
   setting.program_name_long = &fss_write_extended_list_program_name_long_s;
-  setting.process_content = &fss_write_exended_list_process_content;
+  setting.process_content = &fss_write_extended_list_process_content;
   setting.process_help = &fss_write_extended_list_process_help;
-  setting.process_normal = &fss_write_extended_list_process_normal;
-  setting.process_object = &fss_write_exended_list_process_object;
-  setting.process_pipe = &fss_write_extended_list_process_pipe;
-  setting.process_set = &fss_write_process_normal;
+  setting.process_normal = &fss_write_process_normal;
+  setting.process_object = &fss_write_extended_list_process_object;
+  setting.process_pipe = &fss_write_process_pipe;
+  setting.process_set = &fss_write_process_set;
   setting.flag |= fss_write_flag_ignore_e;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
@@ -33,7 +35,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
-  fss_write_extended_list_main(&data, &setting);
+  fss_write_main(&data, &setting);
 
   fss_write_setting_unload(&data, &setting);
 
index 0409242f5d9a197dff7630635a7657fda593cd8e..8622e55f97d49e9f9fe07ba7054f735a45cef9c1 100644 (file)
@@ -1,5 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/fss_write/c/extended_list/private-common.c b/level_3/fss_write/c/extended_list/private-common.c
deleted file mode 100644 (file)
index 8ae3dfd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/extended_list/private-common.h b/level_3/fss_write/c/extended_list/private-common.h
deleted file mode 100644 (file)
index 87f37d3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_list_common_h
-#define _PRIVATE_fss_write_extended_list_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_list_common_h
diff --git a/level_3/fss_write/c/extended_list/private-print.c b/level_3/fss_write/c/extended_list/private-print.c
deleted file mode 100644 (file)
index 0f7be74..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/extended_list/private-print.h b/level_3/fss_write/c/extended_list/private-print.h
deleted file mode 100644 (file)
index 7fea7e6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_list_print_h
-#define _PRIVATE_fss_write_extended_list_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_list_print_h
diff --git a/level_3/fss_write/c/extended_list/private-write.c b/level_3/fss_write/c/extended_list/private-write.c
deleted file mode 100644 (file)
index e3c2ad5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/extended_list/private-write.h b/level_3/fss_write/c/extended_list/private-write.h
deleted file mode 100644 (file)
index 8e5cc56..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_list_write_h
-#define _PRIVATE_fss_write_extended_list_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_list_write_h
index f21c0ba6ca4812e8fb7c247b11b8c6e906d4cd84..3811190c97b62c31f4b510a3c67fdd0d83968f2f 100644 (file)
@@ -72,8 +72,6 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
-
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
 
@@ -235,7 +233,7 @@ extern "C" {
 
     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 (setting->flag & fss_write_flag_object_e) {
+      if (setting->flag & fss_write_flag_object_e) {
         if (!(setting->flag & fss_write_flag_content_multiple_e)) {
           if (main->parameters.array[fss_write_parameter_content_e].values.used > main->parameters.array[fss_write_parameter_object_e].values.used) {
             setting->status = F_status_set_error(F_support_not);
index acbb7915354631c4328d755103d22b13673f3f0f..03cbe4e1c8aeeda5c9f8fae424dae0986d384f46 100644 (file)
@@ -112,8 +112,6 @@ 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_pipe_s_
 
 /**
@@ -325,7 +323,6 @@ extern "C" {
  * content:  A pointer to a specific Content used during processing.
  * contents: A pointer to a specific set of Content used during processing.
  *
- * content_separator: A standard format specific string used to separate Content.
  * program_name:      The short name of the program.
  * program_name_long: The human friendly name of the program.
  *
@@ -365,7 +362,6 @@ extern "C" {
     f_string_static_t *content;
     f_string_statics_t *contents;
 
-    const f_string_static_t *content_separator;
     const f_string_static_t *program_name;
     const f_string_static_t *program_name_long;
 
@@ -405,7 +401,6 @@ extern "C" {
       0, \
       0, \
       0, \
-      0, \
     }
 #endif // _di_fss_write_setting_t_
 
index ae13fce3377bb3c5c7f114dda2b12002a6392734..a1e0cc08995f1932e5caf6735347dcb146143660 100644 (file)
@@ -1,6 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -106,13 +104,17 @@ extern "C" {
 
     f_array_length_t total = 0;
     f_array_length_t length = 0;
-    f_array_length_t ignore_start = 0;
+    f_array_length_t ignore = 0;
     f_string_range_t range = f_string_range_t_initialize;
 
     const f_array_length_t used_objects = setting->objects.used;
     const f_array_length_t used_contentss = setting->contentss.used;
     const f_array_length_t used_ignoress = setting->ignoress.used;
 
+    setting->object = &setting->objects.array[used_objects];
+    setting->contents = &setting->contentss.array[used_contentss];
+    setting->ignores = &setting->ignoress.array[used_ignoress];
+
     // 0x0 = nothing printed, 0x1 = something printed, 0x2 = ignore enabled, 0x4 = added Content for Object.
     uint8_t flag = 0;
 
@@ -137,23 +139,28 @@ extern "C" {
       return;
     }
 
-    // This is processed in a single set, so there is only ever one Ignores added.
-    setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
+    setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
 
     if (F_status_is_error(setting->status)) {
-      fss_write_print_error(setting, main->error, "f_string_rangess_increase");
+      fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
 
       return;
     }
 
-    setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+    // This is processed in a single set, so there is only ever one Ignores added.
+    setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
 
     if (F_status_is_error(setting->status)) {
-      fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
+      fss_write_print_error(setting, main->error, "f_string_rangess_increase");
 
       return;
     }
 
+    // Reset all of the used data before starting the loop.
+    setting->object->used = 0;
+    setting->contents->used = 0;
+    setting->ignores->used = 0;
+
     for (;;) {
 
       if (!((++main->signal_check) % fss_write_signal_check_d)) {
@@ -192,48 +199,57 @@ extern "C" {
       // Start Object.
       if (!state || state == 0x1) {
         if (!state) {
-          setting->objects.array[used_objects].used = 0;
+          setting->object->used = 0;
 
           state = 0x1;
         }
 
         // Reset the "has Content for Object" flag and associated contents array used length.
         flag -= flag | 0x4;
-        setting->contentss.array[used_contentss].used = 0;
+        setting->contents->used = 0;
 
-        if (setting->objects.array[used_objects].used + setting->block.used > setting->objects.array[used_objects].size) {
-          setting->status = f_string_dynamic_increase_by(setting->block.used, &setting->objects.array[used_objects]);
+        setting->status = f_string_dynamic_increase_by(setting->block.used, 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(setting->status)) {
+          fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
-            break;
-          }
+          break;
         }
 
         for (; range.start <= range.stop; ++range.start) {
 
-          if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
-            state = 0x2;
-            ++range.start;
+          // Do not handle start/end while inside an ignore set.
+          if (!(flag & 0x2)) {
+            if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+              state = 0x2;
+              ++range.start;
 
-            break;
-          }
+              break;
+            }
 
-          if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
-            state = 0x3;
-            ++range.start;
+            if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+              state = 0x3;
+              ++range.start;
 
-            break;
+              break;
+            }
           }
 
+          // There currently is no support for "ignore" in Objects, but the Ignore should still be processed.
           if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
 
-            // @todo implement this, populating the ignores array, continue until no ignores is found, so set a new state to represent this.
+            // Ignore is enabled.
+            if (flag & 0x2) {
+              flag -= 0x2;
+            }
+            else {
+              flag |= 0x2;
+            }
+
             continue;
           }
 
-          setting->objects.array[used_objects].string[setting->objects.array[used_objects].used++] = setting->block.string[range.start];
+          setting->object->string[setting->object->used++] = setting->block.string[range.start];
         } // for
 
         if (F_status_is_error(setting->status)) break;
@@ -258,7 +274,7 @@ extern "C" {
             break;
           }
 
-          setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+          setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
 
           if (F_status_is_error(setting->status)) {
             fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
@@ -275,7 +291,7 @@ extern "C" {
         }
 
         if (total) {
-          setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used]);
+          setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
 
           if (F_status_is_error(setting->status)) {
             fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
@@ -285,33 +301,58 @@ extern "C" {
 
           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_support_not);
+            // Do not handle start/end while inside an ignore set.
+            if (!(flag & 0x2)) {
+              if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+                if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+                  setting->status = F_status_set_error(F_support_not);
 
-              fss_write_print_error_one_content_only(setting, main->error);
+                  fss_write_print_error_one_content_only(setting, main->error);
 
-              break;
-            }
+                  break;
+                }
+              }
 
-            if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
-              state = 0x3;
-              ++range.start;
+              if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+                state = 0x3;
+                ++range.start;
 
-              break;
+                break;
+              }
             }
 
             if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
 
-              // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit). (also consider delimits for other special escapes as well.)
+              // Ignore is enabled.
+              if (flag & 0x2) {
+                setting->status = f_string_ranges_increase(setting->state.step_small, setting->ignores);
+
+                if (F_status_is_error(setting->status)) {
+                  fss_write_print_error(setting, main->error, "f_string_ranges_increase");
+
+                  break;
+                }
+
+                setting->ignores->array[setting->ignores->used].start = setting->contents->array[setting->contents->used].used;
+                setting->ignores->array[setting->ignores->used].stop = range.start;
+
+                flag -= 0x2;
+              }
+              else {
+                ignore = setting->contents->array[setting->contents->used].used;
+
+                flag |= 0x2;
+              }
+
               continue;
             }
 
-            setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used].string[setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used].used++] = setting->block.string[range.start];
+            setting->contents->array[setting->contents->used].string[setting->contents->array[setting->contents->used].used++] = setting->block.string[range.start];
           } // for
 
           if (F_status_is_error(setting->status)) break;
 
-          ++setting->contentss.array[used_contentss].used;
+          ++setting->contents->used;
           flag |= 0x4;
         }
         else {
@@ -321,52 +362,23 @@ extern "C" {
 
       // End Object or Content set.
       if (state == 0x3) {
-        if (setting->flag & fss_write_flag_partial_e) {
-          if (setting->flag & fss_write_flag_content_e) {
-            setting->object = 0;
-            setting->contents = &setting->contentss.array[used_contentss];
-          }
-          else {
-            setting->object = &setting->objects.array[used_objects];
-            setting->contents = 0;
-          }
-        }
-        else {
-          setting->object = &setting->objects.array[used_objects];
-          setting->contents = &setting->contentss.array[used_contentss];
-        }
-
-        setting->ignores = &setting->ignoress.array[used_contentss];
-
         setting->process_set(main, void_setting);
         if (F_status_is_error(setting->status)) break;
 
         state = 0;
         flag |= 0x1;
 
+        // Reset all of the used data for next set.
+        setting->object->used = 0;
+        setting->contents->used = 0;
+        setting->ignores->used = 0;
+
         continue;
       }
     } // 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_flag_partial_e) {
-        if (setting->flag & fss_write_flag_content_e) {
-          setting->object = 0;
-          setting->contents = &setting->contentss.array[used_contentss];
-        }
-        else {
-          setting->object = &setting->objects.array[used_objects];
-          setting->contents = 0;
-        }
-      }
-      else {
-        setting->object = &setting->objects.array[used_objects];
-        setting->contents = &setting->contentss.array[used_contentss];
-      }
-
-      setting->ignores = &setting->ignoress.array[used_contentss];
-
       setting->process_set(main, void_setting);
 
       flag |= 0x1;
@@ -374,17 +386,15 @@ extern "C" {
 
     setting->block.used = 0;
     setting->buffer.used = 0;
+    setting->object->used = 0;
+    setting->contents->used = 0;
+    setting->ignores->used = 0;
     setting->ignoress.used = used_ignoress;
     setting->objects.used = used_objects;
     setting->contentss.used = used_contentss;
 
     if (F_status_is_error_not(setting->status)) {
       setting->status = (flag & 0x1) ? F_none : F_data_not;
-
-      // Print newline character to separate data printed from pipe.
-      if ((setting->flag & fss_write_flag_partial_e) && setting->objects.used) {
-        fll_print_dynamic(f_string_eol_s, main->output.to); // @fixme review this, should this be sending to message or not at all?
-      }
     }
   }
 #endif // _di_fss_write_process_pipe_
@@ -396,7 +406,7 @@ extern "C" {
 
     setting->buffer.used = 0;
 
-    if (setting->object) {
+    if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e)) && setting->object) {
       if (setting->object->used) {
         setting->range.start = 0;
         setting->range.stop = setting->object->used - 1;
@@ -410,7 +420,7 @@ extern "C" {
       if (F_status_is_error(setting->status)) return;
     }
 
-    if (setting->contents) {
+    if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_content_e)) && setting->contents) {
       for (f_array_length_t i = 0; i < setting->contents->used; ++i) {
 
         if (setting->contents->array[i].used) {
index 795a1cc1250f4a2bf4955f59cff21a056b175ca9..95f34343f6bf91fafae766bd17e2b541be1e50ed 100644 (file)
@@ -146,20 +146,11 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   Set setting.object to 0 to not use an Object.
- *   Set setting.contents to 0 to not use an Content set.
- *
  *   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 to setting.objects.used to not use.
- * @param content
- *   The content to escape and print.
- *   Set start to 1 and stop to 0 to not use.
  */
 #ifndef _di_fss_write_process_set_
   extern void fss_write_process_set(fll_program_data_t * const main, void * const setting);
index b1d92318824af970718a2ec77e904bcf90c578d8..9d2e0e1d848cc4cce2aa9168e4d7539c4bbe54ff 100644 (file)
@@ -61,9 +61,9 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     setting->program_name_long = &fss_write_program_name_long_s;
     setting->process_content = &fss_write_basic_process_content;
     setting->process_help = &fss_write_main_process_help;
+    setting->process_normal = &fss_write_process_normal;
     setting->process_object = &fss_write_basic_process_object;
     setting->process_pipe = &fss_write_process_pipe;
-    setting->process_normal = &fss_write_process_normal;
     setting->process_set = &fss_write_process_set;
 
     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) {
@@ -96,7 +96,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0001_s) == F_equal_to) {
 
           setting->standard = fss_write_extended_standard_s;
-          setting->content_separator = 0; // Not used by extended.
           setting->program_name = &fss_write_extended_program_name_s;
           setting->program_name_long = &fss_write_extended_program_name_long_s;
           setting->process_content = &fss_write_extended_process_content;
index cac7e2d9333b69c23a4b631bccb4ce643066a83a..f45278f4e2fb3eab74f33303dce11a058f07e0ed 100644 (file)
@@ -1,5 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/fss_write/c/main/private-common.c b/level_3/fss_write/c/main/private-common.c
deleted file mode 100644 (file)
index 8ae3dfd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/main/private-common.h b/level_3/fss_write/c/main/private-common.h
deleted file mode 100644 (file)
index d3b6b5e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_common_h
-#define _PRIVATE_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_common_h
diff --git a/level_3/fss_write/c/main/private-write.c b/level_3/fss_write/c/main/private-write.c
deleted file mode 100644 (file)
index e3c2ad5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/main/private-write.h b/level_3/fss_write/c/main/private-write.h
deleted file mode 100644 (file)
index 41cbaec..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_write_h
-#define _PRIVATE_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_write_h
index f6e672bdfb144a5b3f5b1ca71e15fbc8f795c483..08bf899635fdbb20bc9c25f934ebcabf0820b025 100644 (file)
@@ -1,7 +1,5 @@
 #include "fss_write.h"
 #include "../main/fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -32,16 +30,17 @@ extern "C" {
     const f_array_length_t used_contentss = setting->contentss.used;
     const f_array_length_t used_ignoress = setting->ignoress.used;
 
+    setting->object = &setting->objects.array[used_objects];
+    setting->contents = &setting->contentss.array[used_contentss];
+    setting->ignores = &setting->ignoress.array[used_ignoress];
+
     // 0x0 = nothing printed, 0x1 = something printed, 0x2 = ignore enabled, 0x4 = added Content for Object, 0x8 = "payload" matched.
     uint8_t flag = 0;
 
     // 0x0 = start new object/content set, 0x1 = processing object, 0x2 = processing content, 0x3 = end object/content set, 0x4 = processing payload content.
     uint8_t state = 0;
 
-    setting->objects.used = 0;
-    setting->contentss.used = 0;
-
-    // This is processed in a set, so there is only ever one Object.
+    // This is processed in a single set, so there is only ever one Object added.
     setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->objects);
 
     if (F_status_is_error(setting->status)) {
@@ -50,7 +49,7 @@ extern "C" {
       return;
     }
 
-    // This is processed in a set, so there is only ever one Content set.
+    // This is processed in a single set, so there is only ever one Content added.
     setting->status = f_string_dynamicss_increase(setting->state.step_small, &setting->contentss);
 
     if (F_status_is_error(setting->status)) {
@@ -59,7 +58,7 @@ extern "C" {
       return;
     }
 
-    setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[0]);
+    setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
 
     if (F_status_is_error(setting->status)) {
       fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
@@ -67,6 +66,20 @@ extern "C" {
       return;
     }
 
+    // This is processed in a single set, so there is only ever one Ignores added.
+    setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
+
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "f_string_rangess_increase");
+
+      return;
+    }
+
+    // Reset all of the used data before starting the loop.
+    setting->object->used = 0;
+    setting->contents->used = 0;
+    setting->ignores->used = 0;
+
     for (;;) {
 
       if (!((++main->signal_check) % fss_write_signal_check_d)) {
@@ -102,51 +115,60 @@ extern "C" {
         range.stop = setting->block.used - 1;
       }
 
-      // Begin Object.
+      // Start Object.
       if (!state || state == 0x1) {
         if (!state) {
-          setting->objects.array[used_objects].used = 0;
+          setting->object->used = 0;
 
           state = 0x1;
         }
 
         // Reset the "has Content for Object" flag and associated contents array used length.
         flag -= flag | 0x4;
-        setting->contentss.array[used_contentss].used = 0;
+        setting->contents->used = 0;
 
-        if (setting->objects.array[used_objects].used + setting->block.used > setting->objects.array[used_objects].size) {
-          setting->status = f_string_dynamic_increase_by(setting->block.used, &setting->objects.array[used_objects]);
+        setting->status = f_string_dynamic_increase_by(setting->block.used, 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(setting->status)) {
+          fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
-            break;
-          }
+          break;
         }
 
         for (; range.start <= range.stop; ++range.start) {
 
-          if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
-            state = 0x2;
-            ++range.start;
+          // Do not handle start/end while inside an ignore set.
+          if (!(flag & 0x2)) {
+            if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+              state = 0x2;
+              ++range.start;
 
-            break;
-          }
+              break;
+            }
 
-          if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
-            state = 0x3;
-            ++range.start;
+            if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+              state = 0x3;
+              ++range.start;
 
-            break;
+              break;
+            }
           }
 
+          // There currently is no support for "ignore" in Objects, but the Ignore should still be processed.
           if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
 
-            // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit). (also consider delimits for other special escapes as well.)
+            // Ignore is enabled.
+            if (flag & 0x2) {
+              flag -= 0x2;
+            }
+            else {
+              flag |= 0x2;
+            }
+
             continue;
           }
 
-          setting->objects.array[used_objects].string[setting->objects.array[used_objects].used++] = setting->block.string[range.start];
+          setting->object->string[setting->object->used++] = setting->block.string[range.start];
         } // for
 
         if (F_status_is_error(setting->status)) break;
@@ -171,7 +193,7 @@ extern "C" {
             break;
           }
 
-          setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+          setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
 
           if (F_status_is_error(setting->status)) {
             fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
@@ -188,9 +210,9 @@ extern "C" {
         }
 
         // When payload is provided, all data at this point is part of the payload until the end of the pipe.
-        if (fl_string_dynamic_compare(f_fss_payload_s, setting->objects.array[used_objects]) == F_equal_to) {
+        if (fl_string_dynamic_compare(f_fss_payload_s, *setting->object) == F_equal_to) {
           if (total > 1) {
-            setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[0]);
+            setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
 
             if (F_status_is_error(setting->status)) {
               fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
@@ -198,9 +220,9 @@ extern "C" {
               break;
             }
 
-            memcpy(setting->contentss.array[used_contentss].array[0].string, setting->block.string + range.start, sizeof(f_char_t) * total);
+            memcpy(setting->contents->array[setting->contents->used].string, setting->block.string + range.start, sizeof(f_char_t) * total);
 
-            setting->contentss.array[used_contentss].array[0].used += total;
+            setting->contents->array[setting->contents->used].used += total;
           }
 
           state = 0x4;
@@ -214,7 +236,7 @@ extern "C" {
         }
 
         if (total) {
-          setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[0]);
+          setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
 
           if (F_status_is_error(setting->status)) {
             fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
@@ -224,33 +246,44 @@ extern "C" {
 
           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_support_not);
+            // Do not handle start/end while inside an ignore set.
+            if (!(flag & 0x2)) {
+              if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+                setting->status = F_status_set_error(F_support_not);
 
-              fss_write_print_error_one_content_only(setting, main->error);
+                fss_write_print_error_one_content_only(setting, main->error);
 
-              break;
-            }
+                break;
+              }
 
-            if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
-              state = 0x3;
-              ++range.start;
+              if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+                state = 0x3;
+                ++range.start;
 
-              break;
+                break;
+              }
             }
 
+            // There currently is no support for "ignore" in Contents, but the Ignore should still be processed.
             if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
 
-              // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit).
+              // Ignore is enabled.
+              if (flag & 0x2) {
+                flag -= 0x2;
+              }
+              else {
+                flag |= 0x2;
+              }
+
               continue;
             }
 
-            setting->contentss.array[used_contentss].array[0].string[setting->contentss.array[used_contentss].array[0].used++] = setting->block.string[range.start];
+            setting->contents->array[setting->contents->used].string[setting->contents->array[setting->contents->used].used++] = setting->block.string[range.start];
           } // for
 
           if (F_status_is_error(setting->status)) break;
 
-          ++setting->contentss.array[used_contentss].used;
+          ++setting->contents->used;
           flag |= 0x4;
         }
         else {
@@ -260,29 +293,17 @@ extern "C" {
 
       // End Object or Content set.
       if (state == 0x3) {
-        if (setting->flag & fss_write_flag_partial_e) {
-          if (setting->flag & fss_write_flag_content_e) {
-            setting->object = 0;
-            setting->contents = &setting->contentss.array[used_contentss];
-          }
-          else {
-            setting->object = &setting->objects.array[used_objects];
-            setting->contents = 0;
-          }
-        }
-        else {
-          setting->object = &setting->objects.array[used_objects];
-          setting->contents = &setting->contentss.array[used_contentss];
-        }
-
-        setting->ignores = &setting->ignoress.array[used_ignoress];
-
         fss_write_payload_process_set(main, void_setting);
         if (F_status_is_error(setting->status)) break;
 
         state = 0;
         flag |= 0x1;
 
+        // Reset all of the used data for next set.
+        setting->object->used = 0;
+        setting->contents->used = 0;
+        setting->ignores->used = 0;
+
         continue;
       }
 
@@ -291,7 +312,7 @@ extern "C" {
         if (setting->block.used && range.start <= range.stop) {
           length = (range.stop - range.start) + 1;
 
-          setting->status = f_string_dynamic_increase_by(length + 1, &setting->contentss.array[used_contentss].array[0]);
+          setting->status = f_string_dynamic_increase_by(length + 1, &setting->contents->array[setting->contents->used]);
 
           if (F_status_is_error(setting->status)) {
             fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
@@ -299,36 +320,24 @@ extern "C" {
             break;
           }
 
-          memcpy(setting->contentss.array[used_contentss].array[0].string + range.start, setting->block.string, sizeof(f_char_t) * length);
+          memcpy(setting->contents->array[setting->contents->used].string + range.start, setting->block.string, sizeof(f_char_t) * length);
 
-          setting->contentss.array[used_contentss].array[0].used += length;
+          setting->contents->array[setting->contents->used].used += length;
         }
 
         // Designate to read next block from pipe.
         range.start = 1;
         range.stop = 0;
+
+        // Reset all of the used data for next set.
+        setting->object->used = 0;
+        setting->contents->used = 0;
+        setting->ignores->used = 0;
       }
     } // 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_flag_partial_e) {
-        if (setting->flag & fss_write_flag_content_e) {
-          setting->object = 0;
-          setting->contents = &setting->contentss.array[used_contentss];
-        }
-        else {
-          setting->object = &setting->objects.array[used_objects];
-          setting->contents = 0;
-        }
-      }
-      else {
-        setting->object = &setting->objects.array[used_objects];
-        setting->contents = &setting->contentss.array[used_contentss];
-      }
-
-      setting->ignores = &setting->ignoress.array[used_ignoress];
-
       fss_write_payload_process_set(main, void_setting);
 
       flag |= 0x1;
@@ -336,6 +345,9 @@ extern "C" {
 
     setting->block.used = 0;
     setting->buffer.used = 0;
+    setting->object->used = 0;
+    setting->contents->used = 0;
+    setting->ignores->used = 0;
     setting->objects.used = used_objects;
     setting->contentss.used = used_contentss;
     setting->ignoress.used = used_ignoress;
@@ -353,14 +365,9 @@ extern "C" {
         setting->status = F_data_not;
       }
 
-      // Print newline character to separate data printed from pipe.
-      if ((setting->flag & fss_write_flag_partial_e) && setting->objects.used) {
-        fll_print_dynamic(f_string_eol_s, main->output.to); // @fixme review this, should this be sending to message or not at all?
-      }
-      else if (setting->contentss.used) {
-        if (flag & 0x8) {
-          fll_print_dynamic(f_fss_payload_header_close_s, main->output.to);
-        }
+      // Payload.
+      if (setting->contentss.used && (flag & 0x8)) {
+        fll_print_dynamic(f_fss_payload_header_close_s, main->output.to);
       }
     }
   }
@@ -371,8 +378,8 @@ extern "C" {
 
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
-    if (setting->object) {
-      if (setting->contents && setting->contents->used) {
+    if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e)) && setting->object) {
+      if (!(setting->flag & fss_write_flag_partial_e) && setting->contents && setting->contents->used) {
         if (setting->object->used) {
           setting->range.start = 0;
           setting->range.stop = setting->object->used - 1;
@@ -382,7 +389,16 @@ extern "C" {
           setting->range.stop = 0;
         }
 
-        setting->status = fll_fss_payload_write(*setting->object, setting->contents->array[0], setting->flag & fss_write_flag_trim_e, setting->flag & fss_write_flag_prepend_e ? &setting->prepend : 0, setting->state, &setting->buffer);
+        setting->status = fll_fss_payload_write(
+          *setting->object,
+          setting->contents->array[0],
+          (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_support_not);
@@ -401,8 +417,6 @@ extern "C" {
         }
       }
       else {
-        bool complete = f_fss_complete_none_e;
-
         if (setting->object->used) {
           setting->range.start = 0;
           setting->range.stop = setting->object->used - 1;
@@ -412,16 +426,19 @@ extern "C" {
           setting->range.stop = 0;
         }
 
-        if (setting->contents && setting->contents->used) {
-          if (main->parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) {
-            complete = f_fss_complete_full_trim_e;
-          }
-          else {
-            complete = f_fss_complete_full_e;
-          }
-        }
-
-        setting->status = fl_fss_basic_list_object_write(*setting->object, complete, setting->state, &setting->range, &setting->buffer);
+        setting->status = fl_fss_basic_list_object_write(
+          *setting->object,
+          (setting->flag & fss_write_flag_partial_e)
+            ? (setting->flag & fss_write_flag_trim_e)
+              ? f_fss_complete_partial_trim_e
+              : f_fss_complete_partial_e
+            : (setting->flag & fss_write_flag_trim_e)
+              ? f_fss_complete_full_trim_e
+              : f_fss_complete_full_e,
+          setting->state,
+          &setting->range,
+          &setting->buffer
+        );
 
         if (F_status_set_fine(setting->status) == F_none_eol) {
           setting->status = F_status_set_error(F_support_not);
@@ -452,7 +469,16 @@ extern "C" {
         prepend = &main->parameters.arguments.array[index];
       }
 
-      setting->status = fl_fss_basic_list_content_write(setting->contents->array[0], setting->object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, setting->state, &setting->range, &setting->buffer);
+      setting->status = fl_fss_basic_list_content_write(
+        setting->contents->array[0],
+        setting->object
+          ? f_fss_complete_full_e
+          : f_fss_complete_none_e,
+        prepend,
+        setting->state,
+        &setting->range,
+        &setting->buffer
+      );
 
       if (F_status_is_error(setting->status)) {
         fss_write_print_error(setting, main->error, "fl_fss_payload_content_write");
index 12da9c622873d176ccbfaed9e72dcc600dbc4bc8..6efc164550ff30c11a6b58788c6b35f453a357e1 100644 (file)
@@ -102,9 +102,6 @@ extern "C" {
  *   The main program settings.
  *   Must be of type (fss_write_setting_t *).
  *
- *   Set setting.object to 0 to not use an Object.
- *   Set setting.contents to 0 to not use an Content set.
- *
  *   This standard only supports a single Content per Object.
  *   The setting.contents.array[0] must exist (settings.contents.used == 1), or it is treated as if (settings.contents == 0).
  *
index 7f9344fc1b7762af2ecc31addeb27b89c7551d74..7dcb8d4a48dfbeaf836a5dc3067e364b4282e091 100644 (file)
@@ -6,6 +6,7 @@ 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.standard = fss_write_payload_standard_s;
   setting.program_name = &fss_write_payload_program_name_s;
   setting.program_name_long = &fss_write_payload_program_name_long_s;
   setting.process_content = 0; // Not used by payload.
index 60a2ea0bb9e3c478bbf781891b077d6028212bed..1d1e4d2f05e1774da54cd6103d8dee269f2e2a08 100644 (file)
@@ -1,5 +1,4 @@
 #include "fss_write.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/fss_write/c/payload/private-common.c b/level_3/fss_write/c/payload/private-common.c
deleted file mode 100644 (file)
index 8ae3dfd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/payload/private-common.h b/level_3/fss_write/c/payload/private-common.h
deleted file mode 100644 (file)
index b6c0689..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_payload_common_h
-#define _PRIVATE_fss_write_payload_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_payload_common_h
diff --git a/level_3/fss_write/c/payload/private-print.c b/level_3/fss_write/c/payload/private-print.c
deleted file mode 100644 (file)
index 0f7be74..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/payload/private-print.h b/level_3/fss_write/c/payload/private-print.h
deleted file mode 100644 (file)
index 77d402f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_payload_print_h
-#define _PRIVATE_fss_write_payload_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_payload_print_h
diff --git a/level_3/fss_write/c/payload/private-write.c b/level_3/fss_write/c/payload/private-write.c
deleted file mode 100644 (file)
index e3c2ad5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/fss_write/c/payload/private-write.h b/level_3/fss_write/c/payload/private-write.h
deleted file mode 100644 (file)
index d04a353..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_payload_write_h
-#define _PRIVATE_fss_write_payload_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_payload_write_h
index 7bf428ace5225292be217ef7218c1bacda434a81..c2a49fcfe7c195a213607038e1f09f9af6fffaf4 100644 (file)
@@ -20,29 +20,29 @@ main:
 using_default:
   build settings
   build settings.main
-  #build settings.basic
-  #build settings.basic_list
-  #build settings.extended
-  #build settings.extended_list
-  #build settings.embedded_list
+  build settings.basic
+  build settings.basic_list
+  build settings.extended
+  build settings.extended_list
+  build settings.embedded_list
   build settings.payload
 
 using_mode:
   build settings parameter:'mode:value'
   build settings.main parameter:'mode:value'
-  #build settings.basic parameter:'mode:value'
-  #build settings.basic_list parameter:'mode:value'
-  #build settings.extended parameter:'mode:value'
-  #build settings.extended_list parameter:'mode:value'
-  #build settings.embedded_list parameter:'mode:value'
+  build settings.basic parameter:'mode:value'
+  build settings.basic_list parameter:'mode:value'
+  build settings.extended parameter:'mode:value'
+  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.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 caf6ea1c41b8870b8559a89d993d1ff68ce53c13..d283c3d73866c880889c38203c487fc8efaef0fe 100644 (file)
@@ -25,21 +25,21 @@ build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_pr
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library main/fss_write.c main/common.c main/print.c main/private-common.c main/private-write.c
-build_sources_library basic/fss_write.c basic/common.c basic/print.c basic/private-common.c basic/private-write.c basic/private-print.c
-build_sources_library basic_list/fss_write.c basic_list/common.c basic_list/print.c basic_list/private-common.c basic_list/private-write.c basic_list/private-print.c
-build_sources_library embedded_list/fss_write.c embedded_list/common.c embedded_list/print.c embedded_list/private-common.c embedded_list/private-write.c embedded_list/private-print.c
-build_sources_library extended/fss_write.c extended/common.c extended/print.c extended/private-common.c extended/private-write.c extended/private-print.c
-build_sources_library extended_list/fss_write.c extended_list/common.c extended_list/print.c extended_list/private-common.c extended_list/private-write.c extended_list/private-print.c
-build_sources_library payload/fss_write.c payload/common.c payload/print.c payload/private-common.c payload/private-write.c payload/private-print.c
+build_sources_library main/fss_write.c main/common.c main/print.c
+build_sources_library basic/fss_write.c basic/common.c basic/print.c
+build_sources_library basic_list/fss_write.c basic_list/common.c basic_list/print.c
+build_sources_library embedded_list/fss_write.c embedded_list/common.c embedded_list/print.c
+build_sources_library extended/fss_write.c extended/common.c extended/print.c
+build_sources_library extended_list/fss_write.c extended_list/common.c extended_list/print.c
+build_sources_library payload/fss_write.c payload/common.c payload/print.c
 
-build_sources_headers main/fss_write.h main/common.h main/print.h main/private-common.h main/private-write.h
-build_sources_headers basic/fss_write.h basic/common.h basic/print.h basic/private-common.h basic/private-write.h basic/private-print.h
-build_sources_headers basic_list/fss_write.h basic_list/common.h basic_list/print.h basic_list/private-common.h basic_list/private-write.h basic_list/private-print.h
-build_sources_headers embedded_list/fss_write.h embedded_list/common.h embedded_list/print.h embedded_list/private-common.h embedded_list/private-write.h embedded_list/private-print.h
-build_sources_headers extended/fss_write.h extended/common.h extended/print.h extended/private-common.h extended/private-write.h extended/private-print.h
-build_sources_headers extended_list/fss_write.h extended_list/common.h extended_list/print.h extended_list/private-common.h extended_list/private-write.h extended_list/private-print.h
-build_sources_headers payload/fss_write.h payload/common.h payload/print.h payload/private-common.h payload/private-write.h payload/private-print.h
+build_sources_headers main/fss_write.h main/common.h main/print.h main/private-common.h
+build_sources_headers basic/fss_write.h basic/common.h basic/print.h basic/private-common.h
+build_sources_headers basic_list/fss_write.h basic_list/common.h basic_list/print.h
+build_sources_headers embedded_list/fss_write.h embedded_list/common.h embedded_list/print.h
+build_sources_headers extended/fss_write.h extended/common.h extended/print.h
+build_sources_headers extended_list/fss_write.h extended_list/common.h extended_list/print.h
+build_sources_headers payload/fss_write.h payload/common.h payload/print.h
 
 build_script yes
 build_shared yes
diff --git a/level_3/fss_write/data/build/settings.basic b/level_3/fss_write/data/build/settings.basic
new file mode 100644 (file)
index 0000000..69073e0
--- /dev/null
@@ -0,0 +1,56 @@
+# fss-0001
+#
+# Builds the "basic" program (fss_basic_write).
+# This must be called after the "setting".
+#
+
+build_name fss_basic_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program basic/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
diff --git a/level_3/fss_write/data/build/settings.basic_list b/level_3/fss_write/data/build/settings.basic_list
new file mode 100644 (file)
index 0000000..ede5fc0
--- /dev/null
@@ -0,0 +1,56 @@
+# fss-0001
+#
+# Builds the "basic_list" program (fss_basic_list_write).
+# This must be called after the "setting".
+#
+
+build_name fss_basic_list_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program basic_list/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
diff --git a/level_3/fss_write/data/build/settings.embedded_list b/level_3/fss_write/data/build/settings.embedded_list
new file mode 100644 (file)
index 0000000..8bce02e
--- /dev/null
@@ -0,0 +1,56 @@
+# fss-0001
+#
+# Builds the "embedded_list" program (fss_embedded_list_write).
+# This must be called after the "setting".
+#
+
+build_name fss_embedded_list_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program embedded_list/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
diff --git a/level_3/fss_write/data/build/settings.extended b/level_3/fss_write/data/build/settings.extended
new file mode 100644 (file)
index 0000000..034dc25
--- /dev/null
@@ -0,0 +1,56 @@
+# fss-0001
+#
+# Builds the "extended" program (fss_extended_write).
+# This must be called after the "setting".
+#
+
+build_name fss_extended_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program extended/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
diff --git a/level_3/fss_write/data/build/settings.extended_list b/level_3/fss_write/data/build/settings.extended_list
new file mode 100644 (file)
index 0000000..9046be7
--- /dev/null
@@ -0,0 +1,56 @@
+# fss-0001
+#
+# Builds the "extended_list" program (fss_extended_list_write).
+# This must be called after the "setting".
+#
+
+build_name fss_extended_list_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program extended_list/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE