From bece22040c57a7a5c3ea6127a4ed28e12e1c583a Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 30 Jan 2022 22:40:58 -0600 Subject: [PATCH] Progress: Continue mass converting to f_string_static_t. The console program has been changed to populate an argv as a f_string_static_t. This avoids having to run strlen() and strnlen() everywhere for console parameter processing. The program that processes the parameters already does this, so save the values in an f_string_static_t. --- build/level_1/settings | 4 +- build/monolithic/settings | 4 +- level_0/f_color/c/color-common.c | 82 +- level_0/f_color/tests/c/test-color-save_1.c | 4 +- level_0/f_color/tests/c/test-color-save_2.c | 6 +- level_0/f_color/tests/c/test-color-save_3.c | 8 +- level_0/f_color/tests/c/test-color-save_4.c | 10 +- level_0/f_color/tests/c/test-color-save_5.c | 12 +- level_0/f_console/c/console-common.c | 102 +- level_0/f_console/c/console-common.h | 58 +- level_0/f_console/c/console.c | 224 ++--- level_0/f_console/c/console.h | 7 +- level_0/f_control_group/c/control_group-common.c | 6 +- level_0/f_directory/c/directory.c | 141 ++- level_0/f_directory/c/directory.h | 41 +- level_0/f_directory/c/private-directory.c | 8 +- level_0/f_directory/c/private-directory.h | 4 +- level_0/f_environment/c/environment.c | 128 +-- level_0/f_environment/c/environment.h | 106 +- level_0/f_environment/c/private-environment.c | 69 -- level_0/f_environment/c/private-environment.h | 77 -- level_0/f_file/c/file-common.c | 54 +- level_0/f_file/c/file-common.h | 110 ++ level_0/f_file/c/file.c | 697 ++++++------- level_0/f_file/c/file.h | 157 +-- level_0/f_file/c/private-file.c | 105 +- level_0/f_file/c/private-file.h | 50 +- level_0/f_fss/c/fss-common.c | 4 +- level_0/f_iki/c/iki-common.c | 36 +- level_0/f_path/c/path-common.c | 110 +- level_0/f_print/c/print-common.c | 72 +- level_0/f_serialize/c/serialize-common.c | 6 +- level_0/f_status_string/c/status_string.c | 1060 ++++++++++---------- level_0/f_string/c/string_dynamic.c | 266 ++--- level_0/f_string/c/string_dynamic.h | 8 +- level_0/f_utf/c/utf.h | 2 +- level_1/fl_control_group/c/control_group.c | 23 +- level_1/fl_directory/c/directory-common.c | 10 + level_1/fl_directory/c/directory-common.h | 68 ++ level_1/fl_directory/c/directory.c | 182 ++-- level_1/fl_directory/c/directory.h | 127 +-- level_1/fl_directory/c/private-directory.c | 240 +++-- level_1/fl_directory/c/private-directory.h | 10 +- level_1/fl_directory/data/build/settings | 2 +- level_1/fl_environment/c/environment.c | 335 ++----- level_1/fl_environment/c/environment.h | 86 +- level_1/fl_print/c/print-common.c | 6 +- level_2/fll_control_group/c/control_group.c | 21 +- level_2/fll_error/c/error-common.c | 9 +- level_2/fll_error/c/error-common.h | 5 + level_2/fll_error/c/error.c | 209 ++-- level_2/fll_error/c/error.h | 4 +- level_2/fll_execute/c/execute.c | 191 ++-- level_2/fll_execute/c/execute.h | 199 +--- level_2/fll_execute/c/private-execute.c | 168 ++-- level_2/fll_execute/c/private-execute.h | 44 +- level_2/fll_file/c/file.c | 34 +- level_2/fll_file/c/file.h | 11 +- level_2/fll_file/c/private-file.c | 93 +- level_2/fll_file/c/private-file.h | 4 +- .../fll_fss_status_string/c/fss_status_string.c | 24 +- level_2/fll_program/c/program.c | 6 +- level_2/fll_program/c/program.h | 2 +- level_3/byte_dump/c/byte_dump.c | 308 +++--- level_3/byte_dump/c/common.c | 95 +- level_3/byte_dump/c/common.h | 4 +- level_3/byte_dump/c/private-byte_dump.c | 60 +- level_3/byte_dump/c/private-byte_dump.h | 2 +- level_3/control/c/common.c | 25 +- level_3/control/c/common.h | 6 +- level_3/control/c/control.c | 152 +-- level_3/control/c/private-common.c | 52 +- level_3/control/c/private-common.h | 4 + level_3/control/c/private-control.c | 116 +-- level_3/control/c/private-control.h | 10 +- level_3/control/c/private-print.c | 50 +- level_3/control/c/private-print.h | 12 +- level_3/controller/c/common.c | 79 +- level_3/controller/c/common.h | 4 +- level_3/controller/c/common/private-common.c | 236 ++--- level_3/controller/c/common/private-rule.c | 4 +- level_3/controller/c/control/private-control.c | 2 +- level_3/controller/c/controller.c | 164 +-- .../controller/c/controller/private-controller.c | 10 +- .../c/controller/private-controller_print.c | 2 +- .../c/controller/private-controller_print.h | 2 +- level_3/controller/c/entry/private-entry.c | 42 +- level_3/controller/c/entry/private-entry_print.c | 12 +- level_3/controller/c/entry/private-entry_print.h | 2 +- level_3/controller/c/rule/private-rule.c | 26 +- level_3/controller/c/rule/private-rule_print.c | 4 +- level_3/controller/c/thread/private-thread.c | 8 +- level_3/controller/c/thread/private-thread_entry.c | 4 +- level_3/fake/c/common.c | 159 ++- level_3/fake/c/common.h | 4 +- level_3/fake/c/fake.c | 155 +-- level_3/fake/c/private-build-library.c | 129 ++- level_3/fake/c/private-build-load.c | 78 +- level_3/fake/c/private-build-load.h | 2 +- level_3/fake/c/private-build-objects.c | 30 +- level_3/fake/c/private-build-program.c | 88 +- level_3/fake/c/private-build.c | 213 ++-- level_3/fake/c/private-common.c | 475 ++++----- level_3/fake/c/private-common.h | 70 ++ level_3/fake/c/private-fake.c | 36 +- level_3/fake/c/private-fake.h | 2 +- level_3/fake/c/private-make-load_parameters.c | 42 +- level_3/fake/c/private-make-operate.c | 6 +- level_3/fake/c/private-make-operate_process.c | 6 +- level_3/fake/c/private-make-operate_process_type.c | 42 +- level_3/fake/c/private-make-operate_validate.c | 26 +- level_3/fake/c/private-print.c | 156 +-- level_3/fake/c/private-print.h | 38 +- level_3/fake/c/private-skeleton.c | 12 +- level_3/firewall/c/firewall.c | 157 ++- level_3/firewall/c/firewall.h | 4 +- level_3/firewall/c/private-firewall.c | 6 +- .../fss_basic_list_read/c/fss_basic_list_read.c | 157 ++- .../fss_basic_list_read/c/fss_basic_list_read.h | 4 +- level_3/fss_basic_list_read/c/private-print.c | 8 +- level_3/fss_basic_list_read/c/private-read.c | 62 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 221 ++-- .../fss_basic_list_write/c/fss_basic_list_write.h | 4 +- level_3/fss_basic_list_write/c/private-write.c | 2 +- level_3/fss_basic_read/c/fss_basic_read.c | 157 ++- level_3/fss_basic_read/c/fss_basic_read.h | 4 +- level_3/fss_basic_read/c/private-print.c | 4 +- level_3/fss_basic_read/c/private-read.c | 62 +- level_3/fss_basic_write/c/fss_basic_write.c | 223 ++-- level_3/fss_basic_write/c/fss_basic_write.h | 4 +- level_3/fss_basic_write/c/private-write.c | 2 +- .../c/fss_embedded_list_read.c | 167 ++- .../c/fss_embedded_list_read.h | 4 +- level_3/fss_embedded_list_read/c/private-print.c | 10 +- level_3/fss_embedded_list_read/c/private-read.c | 72 +- .../c/fss_embedded_list_write.c | 225 ++--- .../c/fss_embedded_list_write.h | 4 +- level_3/fss_embedded_list_write/c/private-write.c | 10 +- .../c/fss_extended_list_read.c | 157 ++- .../c/fss_extended_list_read.h | 4 +- level_3/fss_extended_list_read/c/private-print.c | 6 +- level_3/fss_extended_list_read/c/private-read.c | 62 +- .../c/fss_extended_list_write.c | 225 ++--- .../c/fss_extended_list_write.h | 4 +- level_3/fss_extended_list_write/c/private-write.c | 10 +- level_3/fss_extended_read/c/fss_extended_read.c | 157 ++- level_3/fss_extended_read/c/fss_extended_read.h | 4 +- level_3/fss_extended_read/c/private-print.c | 6 +- level_3/fss_extended_read/c/private-read.c | 60 +- level_3/fss_extended_write/c/fss_extended_write.c | 245 +++-- level_3/fss_extended_write/c/fss_extended_write.h | 4 +- level_3/fss_extended_write/c/private-write.c | 2 +- level_3/fss_identify/c/fss_identify.c | 163 ++- level_3/fss_identify/c/fss_identify.h | 4 +- level_3/fss_identify/c/private-identify.c | 6 +- level_3/fss_identify/c/private-print.c | 6 +- level_3/fss_payload_read/c/fss_payload_read.c | 157 ++- level_3/fss_payload_read/c/fss_payload_read.h | 4 +- level_3/fss_payload_read/c/private-print.c | 14 +- level_3/fss_payload_read/c/private-read.c | 66 +- level_3/fss_payload_write/c/fss_payload_write.c | 221 ++-- level_3/fss_payload_write/c/fss_payload_write.h | 4 +- level_3/fss_payload_write/c/private-write.c | 4 +- level_3/fss_status_code/c/fss_status_code.c | 149 ++- level_3/fss_status_code/c/fss_status_code.h | 4 +- .../fss_status_code/c/private-fss_status_code.c | 6 +- level_3/iki_read/c/iki_read.c | 193 ++-- level_3/iki_read/c/iki_read.h | 8 +- level_3/iki_read/c/private-read.c | 32 +- level_3/iki_write/c/iki_write.c | 175 ++-- level_3/iki_write/c/iki_write.h | 4 +- level_3/status_code/c/private-status_code.c | 6 +- level_3/status_code/c/status_code.c | 149 ++- level_3/status_code/c/status_code.h | 4 +- level_3/utf8/c/private-common.h | 3 + level_3/utf8/c/private-print.c | 24 +- level_3/utf8/c/private-utf8.c | 6 +- level_3/utf8/c/private-utf8_binary.c | 4 +- level_3/utf8/c/private-utf8_codepoint.c | 6 +- level_3/utf8/c/utf8.c | 348 ++++--- level_3/utf8/c/utf8.h | 10 +- 181 files changed, 6512 insertions(+), 7004 deletions(-) create mode 100644 level_1/fl_directory/c/directory-common.c create mode 100644 level_1/fl_directory/c/directory-common.h diff --git a/build/level_1/settings b/build/level_1/settings index e61030e..2fc1500 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -25,14 +25,14 @@ build_libraries-level -lfll_0 build_libraries-level_threadless -lfll_0 build_libraries_shared build_libraries_static -build_sources_library console.c control_group.c conversion.c private-conversion.c directory.c private-directory.c environment.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c iki.c print.c print-common.c private-print.c signal.c string.c private-string.c utf.c private-utf.c utf_file.c private-utf_file.c +build_sources_library console.c control_group.c conversion.c private-conversion.c directory.c directory-common.c private-directory.c environment.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c iki.c print.c print-common.c private-print.c signal.c string.c private-string.c utf.c private-utf.c utf_file.c private-utf_file.c build_sources_library-level build_sources_library_shared build_sources_library_static build_sources_program build_sources_program_shared build_sources_program_static -build_sources_headers console.h control_group.h conversion.h directory.h environment.h execute.h execute-common.h fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h iki.h print.h print-common.h signal.h signal-common.h string.h utf.h utf_file.h +build_sources_headers console.h control_group.h conversion.h directory.h directory-common.h environment.h execute.h execute-common.h fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h iki.h print.h print-common.h signal.h signal-common.h string.h utf.h utf_file.h build_sources_headers-level build_sources_headers_shared build_sources_headers_static diff --git a/build/monolithic/settings b/build/monolithic/settings index 9ceb952..8e2e758 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -25,14 +25,14 @@ build_libraries-monolithic build_libraries-monolithic_threadless build_libraries_shared build_libraries_static -build_sources_library level_0/account.c level_0/private-account.c level_0/capability.c level_0/color.c level_0/color-common.c level_0/console.c level_0/console-common.c level_0/control_group.c level_0/control_group-common.c level_0/conversion.c level_0/conversion-common.c level_0/private-conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/execute.c level_0/file.c level_0/file-common.c level_0/private-file.c level_0/fss.c level_0/private-fss.c level_0/fss-common.c level_0/fss_named.c level_0/fss_nest.c level_0/fss_set.c level_0/iki.c level_0/iki-common.c level_0/private-iki.c level_0/limit.c level_0/memory.c level_0/memory_structure.c level_0/private-memory.c level_0/path.c level_0/path-common.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/print_to.c level_0/print-common.c level_0/private-print.c level_0/private-print_to.c level_0/serialize.c level_0/serialize-common.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/status_string.c level_0/string.c level_0/string-common.c level_0/private-string.c level_0/string_dynamic.c level_0/string_map.c level_0/string_quantity.c level_0/string_range.c level_0/string_triple.c level_0/type_array.c level_0/private-type_array.c level_0/utf.c level_0/utf-common.c level_0/utf_dynamic.c level_0/utf_map.c level_0/utf_string.c level_0/utf_triple.c level_0/private-utf.c level_0/private-utf-is_unassigned.c level_0/private-utf_string.c level_1/console.c level_1/control_group.c level_1/conversion.c level_1/private-conversion.c level_1/directory.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/print-common.c level_1/private-print.c level_1/signal.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/control_group.c level_2/error.c level_2/error-common.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_payload.c level_2/fss_status_string.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/print.c level_2/program.c level_2/status_string.c +build_sources_library level_0/account.c level_0/private-account.c level_0/capability.c level_0/color.c level_0/color-common.c level_0/console.c level_0/console-common.c level_0/control_group.c level_0/control_group-common.c level_0/conversion.c level_0/conversion-common.c level_0/private-conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/execute.c level_0/file.c level_0/file-common.c level_0/private-file.c level_0/fss.c level_0/private-fss.c level_0/fss-common.c level_0/fss_named.c level_0/fss_nest.c level_0/fss_set.c level_0/iki.c level_0/iki-common.c level_0/private-iki.c level_0/limit.c level_0/memory.c level_0/memory_structure.c level_0/private-memory.c level_0/path.c level_0/path-common.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/print_to.c level_0/print-common.c level_0/private-print.c level_0/private-print_to.c level_0/serialize.c level_0/serialize-common.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/status_string.c level_0/string.c level_0/string-common.c level_0/private-string.c level_0/string_dynamic.c level_0/string_map.c level_0/string_quantity.c level_0/string_range.c level_0/string_triple.c level_0/type_array.c level_0/private-type_array.c level_0/utf.c level_0/utf-common.c level_0/utf_dynamic.c level_0/utf_map.c level_0/utf_string.c level_0/utf_triple.c level_0/private-utf.c level_0/private-utf-is_unassigned.c level_0/private-utf_string.c level_1/console.c level_1/control_group.c level_1/conversion.c level_1/private-conversion.c level_1/directory.c level_1/directory-common.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/print-common.c level_1/private-print.c level_1/signal.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/control_group.c level_2/error.c level_2/error-common.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_payload.c level_2/fss_status_string.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/print.c level_2/program.c level_2/status_string.c build_sources_library-monolithic level_0/thread.c level_0/private-thread.c build_sources_library_shared build_sources_library_static build_sources_program build_sources_program_shared build_sources_program_static -build_sources_headers level_0/account.h level_0/account-common.h level_0/capability.h level_0/capability-common.h level_0/color.h level_0/color-common.h level_0/console.h level_0/console-common.h level_0/control_group.h level_0/control_group-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/limit.h level_0/limit-common.h level_0/memory.h level_0/memory_structure.h level_0/memory-common.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/print_to.h level_0/print-common.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/status_string.h level_0/string.h level_0/string-common.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/type_array-common.h level_0/utf.h level_0/utf-common.h level_0/utf_dynamic.h level_0/utf_map.h level_0/utf_string.h level_0/utf_triple.h level_1/console.h level_1/control_group.h level_1/conversion.h level_1/directory.h level_1/environment.h level_1/execute.h level_1/execute-common.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/iki.h level_1/print.h level_1/print-common.h level_1/signal.h level_1/signal-common.h level_1/string.h level_1/utf.h level_1/utf_file.h level_2/control_group.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_payload.h level_2/fss_status_string.h level_2/iki.h level_2/path.h level_2/print.h level_2/program.h level_2/status_string.h +build_sources_headers level_0/account.h level_0/account-common.h level_0/capability.h level_0/capability-common.h level_0/color.h level_0/color-common.h level_0/console.h level_0/console-common.h level_0/control_group.h level_0/control_group-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/limit.h level_0/limit-common.h level_0/memory.h level_0/memory_structure.h level_0/memory-common.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/print_to.h level_0/print-common.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/status_string.h level_0/string.h level_0/string-common.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/type_array-common.h level_0/utf.h level_0/utf-common.h level_0/utf_dynamic.h level_0/utf_map.h level_0/utf_string.h level_0/utf_triple.h level_1/console.h level_1/control_group.h level_1/conversion.h level_1/directory.h level_1/directory-common.h level_1/environment.h level_1/execute.h level_1/execute-common.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/iki.h level_1/print.h level_1/print-common.h level_1/signal.h level_1/signal-common.h level_1/string.h level_1/utf.h level_1/utf_file.h level_2/control_group.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_payload.h level_2/fss_status_string.h level_2/iki.h level_2/path.h level_2/print.h level_2/program.h level_2/status_string.h build_sources_headers-monolithic level_0/thread.h level_0/thread-common.h build_sources_headers_shared build_sources_headers_static diff --git a/level_0/f_color/c/color-common.c b/level_0/f_color/c/color-common.c index e614d01..010b667 100644 --- a/level_0/f_color/c/color-common.c +++ b/level_0/f_color/c/color-common.c @@ -5,48 +5,48 @@ extern "C" { #endif #ifndef _di_f_color_strings_s_ - const f_string_static_t f_color_string_begin_s = macro_f_string_static_t_initialize2(F_color_string_begin_s, 0, F_color_string_begin_s_length); - const f_string_static_t f_color_string_end_s = macro_f_string_static_t_initialize2(F_color_string_end_s, 0, F_color_string_end_s_length); - const f_string_static_t f_color_string_medium_s = macro_f_string_static_t_initialize2(F_color_string_medium_s, 0, F_color_string_medium_s_length); + const f_string_static_t f_color_string_begin_s = macro_f_string_static_t_initialize(F_color_string_begin_s, 0, F_color_string_begin_s_length); + const f_string_static_t f_color_string_end_s = macro_f_string_static_t_initialize(F_color_string_end_s, 0, F_color_string_end_s_length); + const f_string_static_t f_color_string_medium_s = macro_f_string_static_t_initialize(F_color_string_medium_s, 0, F_color_string_medium_s_length); - const f_string_static_t f_color_string_code_reset_s = macro_f_string_static_t_initialize2(F_color_string_code_reset_s, 0, F_color_string_code_reset_s_length); - const f_string_static_t f_color_string_code_bold_s = macro_f_string_static_t_initialize2(F_color_string_code_bold_s, 0, F_color_string_code_bold_s_length); - const f_string_static_t f_color_string_code_underline_s = macro_f_string_static_t_initialize2(F_color_string_code_underline_s, 0, F_color_string_code_underline_s_length); - const f_string_static_t f_color_string_code_blink_s = macro_f_string_static_t_initialize2(F_color_string_code_blink_s, 0, F_color_string_code_blink_s_length); - const f_string_static_t f_color_string_code_reverse_s = macro_f_string_static_t_initialize2(F_color_string_code_reverse_s, 0, F_color_string_code_reverse_s_length); - const f_string_static_t f_color_string_code_conceal_s = macro_f_string_static_t_initialize2(F_color_string_code_conceal_s, 0, F_color_string_code_conceal_s_length); - const f_string_static_t f_color_string_code_black_s = macro_f_string_static_t_initialize2(F_color_string_code_black_s, 0, F_color_string_code_black_s_length); - const f_string_static_t f_color_string_code_red_s = macro_f_string_static_t_initialize2(F_color_string_code_red_s, 0, F_color_string_code_red_s_length); - const f_string_static_t f_color_string_code_green_s = macro_f_string_static_t_initialize2(F_color_string_code_green_s, 0, F_color_string_code_green_s_length); - const f_string_static_t f_color_string_code_yellow_s = macro_f_string_static_t_initialize2(F_color_string_code_yellow_s, 0, F_color_string_code_yellow_s_length); - const f_string_static_t f_color_string_code_blue_s = macro_f_string_static_t_initialize2(F_color_string_code_blue_s, 0, F_color_string_code_blue_s_length); - const f_string_static_t f_color_string_code_purple_s = macro_f_string_static_t_initialize2(F_color_string_code_purple_s, 0, F_color_string_code_purple_s_length); - const f_string_static_t f_color_string_code_teal_s = macro_f_string_static_t_initialize2(F_color_string_code_teal_s, 0, F_color_string_code_teal_s_length); - const f_string_static_t f_color_string_code_white_s = macro_f_string_static_t_initialize2(F_color_string_code_white_s, 0, F_color_string_code_white_s_length); - const f_string_static_t f_color_string_code_black_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_black_bg_s, 0, F_color_string_code_black_bg_s_length); - const f_string_static_t f_color_string_code_red_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_red_bg_s, 0, F_color_string_code_red_bg_s_length); - const f_string_static_t f_color_string_code_green_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_green_bg_s, 0, F_color_string_code_green_bg_s_length); - const f_string_static_t f_color_string_code_yellow_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_yellow_bg_s, 0, F_color_string_code_yellow_bg_s_length); - const f_string_static_t f_color_string_code_blue_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_blue_bg_s, 0, F_color_string_code_blue_bg_s_length); - const f_string_static_t f_color_string_code_purple_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_purple_bg_s, 0, F_color_string_code_purple_bg_s_length); - const f_string_static_t f_color_string_code_teal_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_teal_bg_s, 0, F_color_string_code_teal_bg_s_length); - const f_string_static_t f_color_string_code_white_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_white_bg_s, 0, F_color_string_code_white_bg_s_length); - const f_string_static_t f_color_string_code_bright_black_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_black_s, 0, F_color_string_code_bright_black_s_length); - const f_string_static_t f_color_string_code_bright_red_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_red_s, 0, F_color_string_code_bright_red_s_length); - const f_string_static_t f_color_string_code_bright_green_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_green_s, 0, F_color_string_code_bright_green_s_length); - const f_string_static_t f_color_string_code_bright_yellow_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_yellow_s, 0, F_color_string_code_bright_yellow_s_length); - const f_string_static_t f_color_string_code_bright_blue_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_blue_s, 0, F_color_string_code_bright_blue_s_length); - const f_string_static_t f_color_string_code_bright_purple_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_purple_s, 0, F_color_string_code_bright_purple_s_length); - const f_string_static_t f_color_string_code_bright_teal_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_teal_s, 0, F_color_string_code_bright_teal_s_length); - const f_string_static_t f_color_string_code_bright_white_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_white_s, 0, F_color_string_code_bright_white_s_length); - const f_string_static_t f_color_string_code_bright_black_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_black_bg_s, 0, F_color_string_code_bright_black_bg_s_length); - const f_string_static_t f_color_string_code_bright_red_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_red_bg_s, 0, F_color_string_code_bright_red_bg_s_length); - const f_string_static_t f_color_string_code_bright_green_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_green_bg_s, 0, F_color_string_code_bright_green_bg_s_length); - const f_string_static_t f_color_string_code_bright_yellow_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_yellow_bg_s, 0, F_color_string_code_bright_yellow_bg_s_length); - const f_string_static_t f_color_string_code_bright_blue_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_blue_bg_s, 0, F_color_string_code_bright_blue_bg_s_length); - const f_string_static_t f_color_string_code_bright_purple_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_purple_bg_s, 0, F_color_string_code_bright_purple_bg_s_length); - const f_string_static_t f_color_string_code_bright_teal_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_teal_bg_s, 0, F_color_string_code_bright_teal_bg_s_length); - const f_string_static_t f_color_string_code_bright_white_bg_s = macro_f_string_static_t_initialize2(F_color_string_code_bright_white_bg_s, 0, F_color_string_code_bright_white_bg_s_length); + const f_string_static_t f_color_string_code_reset_s = macro_f_string_static_t_initialize(F_color_string_code_reset_s, 0, F_color_string_code_reset_s_length); + const f_string_static_t f_color_string_code_bold_s = macro_f_string_static_t_initialize(F_color_string_code_bold_s, 0, F_color_string_code_bold_s_length); + const f_string_static_t f_color_string_code_underline_s = macro_f_string_static_t_initialize(F_color_string_code_underline_s, 0, F_color_string_code_underline_s_length); + const f_string_static_t f_color_string_code_blink_s = macro_f_string_static_t_initialize(F_color_string_code_blink_s, 0, F_color_string_code_blink_s_length); + const f_string_static_t f_color_string_code_reverse_s = macro_f_string_static_t_initialize(F_color_string_code_reverse_s, 0, F_color_string_code_reverse_s_length); + const f_string_static_t f_color_string_code_conceal_s = macro_f_string_static_t_initialize(F_color_string_code_conceal_s, 0, F_color_string_code_conceal_s_length); + const f_string_static_t f_color_string_code_black_s = macro_f_string_static_t_initialize(F_color_string_code_black_s, 0, F_color_string_code_black_s_length); + const f_string_static_t f_color_string_code_red_s = macro_f_string_static_t_initialize(F_color_string_code_red_s, 0, F_color_string_code_red_s_length); + const f_string_static_t f_color_string_code_green_s = macro_f_string_static_t_initialize(F_color_string_code_green_s, 0, F_color_string_code_green_s_length); + const f_string_static_t f_color_string_code_yellow_s = macro_f_string_static_t_initialize(F_color_string_code_yellow_s, 0, F_color_string_code_yellow_s_length); + const f_string_static_t f_color_string_code_blue_s = macro_f_string_static_t_initialize(F_color_string_code_blue_s, 0, F_color_string_code_blue_s_length); + const f_string_static_t f_color_string_code_purple_s = macro_f_string_static_t_initialize(F_color_string_code_purple_s, 0, F_color_string_code_purple_s_length); + const f_string_static_t f_color_string_code_teal_s = macro_f_string_static_t_initialize(F_color_string_code_teal_s, 0, F_color_string_code_teal_s_length); + const f_string_static_t f_color_string_code_white_s = macro_f_string_static_t_initialize(F_color_string_code_white_s, 0, F_color_string_code_white_s_length); + const f_string_static_t f_color_string_code_black_bg_s = macro_f_string_static_t_initialize(F_color_string_code_black_bg_s, 0, F_color_string_code_black_bg_s_length); + const f_string_static_t f_color_string_code_red_bg_s = macro_f_string_static_t_initialize(F_color_string_code_red_bg_s, 0, F_color_string_code_red_bg_s_length); + const f_string_static_t f_color_string_code_green_bg_s = macro_f_string_static_t_initialize(F_color_string_code_green_bg_s, 0, F_color_string_code_green_bg_s_length); + const f_string_static_t f_color_string_code_yellow_bg_s = macro_f_string_static_t_initialize(F_color_string_code_yellow_bg_s, 0, F_color_string_code_yellow_bg_s_length); + const f_string_static_t f_color_string_code_blue_bg_s = macro_f_string_static_t_initialize(F_color_string_code_blue_bg_s, 0, F_color_string_code_blue_bg_s_length); + const f_string_static_t f_color_string_code_purple_bg_s = macro_f_string_static_t_initialize(F_color_string_code_purple_bg_s, 0, F_color_string_code_purple_bg_s_length); + const f_string_static_t f_color_string_code_teal_bg_s = macro_f_string_static_t_initialize(F_color_string_code_teal_bg_s, 0, F_color_string_code_teal_bg_s_length); + const f_string_static_t f_color_string_code_white_bg_s = macro_f_string_static_t_initialize(F_color_string_code_white_bg_s, 0, F_color_string_code_white_bg_s_length); + const f_string_static_t f_color_string_code_bright_black_s = macro_f_string_static_t_initialize(F_color_string_code_bright_black_s, 0, F_color_string_code_bright_black_s_length); + const f_string_static_t f_color_string_code_bright_red_s = macro_f_string_static_t_initialize(F_color_string_code_bright_red_s, 0, F_color_string_code_bright_red_s_length); + const f_string_static_t f_color_string_code_bright_green_s = macro_f_string_static_t_initialize(F_color_string_code_bright_green_s, 0, F_color_string_code_bright_green_s_length); + const f_string_static_t f_color_string_code_bright_yellow_s = macro_f_string_static_t_initialize(F_color_string_code_bright_yellow_s, 0, F_color_string_code_bright_yellow_s_length); + const f_string_static_t f_color_string_code_bright_blue_s = macro_f_string_static_t_initialize(F_color_string_code_bright_blue_s, 0, F_color_string_code_bright_blue_s_length); + const f_string_static_t f_color_string_code_bright_purple_s = macro_f_string_static_t_initialize(F_color_string_code_bright_purple_s, 0, F_color_string_code_bright_purple_s_length); + const f_string_static_t f_color_string_code_bright_teal_s = macro_f_string_static_t_initialize(F_color_string_code_bright_teal_s, 0, F_color_string_code_bright_teal_s_length); + const f_string_static_t f_color_string_code_bright_white_s = macro_f_string_static_t_initialize(F_color_string_code_bright_white_s, 0, F_color_string_code_bright_white_s_length); + const f_string_static_t f_color_string_code_bright_black_bg_s = macro_f_string_static_t_initialize(F_color_string_code_bright_black_bg_s, 0, F_color_string_code_bright_black_bg_s_length); + const f_string_static_t f_color_string_code_bright_red_bg_s = macro_f_string_static_t_initialize(F_color_string_code_bright_red_bg_s, 0, F_color_string_code_bright_red_bg_s_length); + const f_string_static_t f_color_string_code_bright_green_bg_s = macro_f_string_static_t_initialize(F_color_string_code_bright_green_bg_s, 0, F_color_string_code_bright_green_bg_s_length); + const f_string_static_t f_color_string_code_bright_yellow_bg_s = macro_f_string_static_t_initialize(F_color_string_code_bright_yellow_bg_s, 0, F_color_string_code_bright_yellow_bg_s_length); + const f_string_static_t f_color_string_code_bright_blue_bg_s = macro_f_string_static_t_initialize(F_color_string_code_bright_blue_bg_s, 0, F_color_string_code_bright_blue_bg_s_length); + const f_string_static_t f_color_string_code_bright_purple_bg_s = macro_f_string_static_t_initialize(F_color_string_code_bright_purple_bg_s, 0, F_color_string_code_bright_purple_bg_s_length); + const f_string_static_t f_color_string_code_bright_teal_bg_s = macro_f_string_static_t_initialize(F_color_string_code_bright_teal_bg_s, 0, F_color_string_code_bright_teal_bg_s_length); + const f_string_static_t f_color_string_code_bright_white_bg_s = macro_f_string_static_t_initialize(F_color_string_code_bright_white_bg_s, 0, F_color_string_code_bright_white_bg_s_length); #endif // _di_f_color_strings_s_ #ifndef _di_f_color_set_string_empty_s_ diff --git a/level_0/f_color/tests/c/test-color-save_1.c b/level_0/f_color/tests/c/test-color-save_1.c index b83f1a7..2cdb00e 100644 --- a/level_0/f_color/tests/c/test-color-save_1.c +++ b/level_0/f_color/tests/c/test-color-save_1.c @@ -10,7 +10,7 @@ extern "C" { f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color = macro_f_string_static_t_initialize("color", 5); + const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); { const f_status_t status = f_color_save_1(format, color, 0); @@ -25,7 +25,7 @@ void test__f_color_save_1_works(void **state) { f_color_context_t context = f_color_context_t_initialize; f_string_dynamic_t buffer = f_string_dynamic_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color1 = macro_f_string_static_t_initialize("color1", 6); + const f_string_static_t color1 = macro_f_string_static_t_initialize2("color1", 6); { f_status_t status = F_none; diff --git a/level_0/f_color/tests/c/test-color-save_2.c b/level_0/f_color/tests/c/test-color-save_2.c index d041db7..c61832c 100644 --- a/level_0/f_color/tests/c/test-color-save_2.c +++ b/level_0/f_color/tests/c/test-color-save_2.c @@ -10,7 +10,7 @@ extern "C" { f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color = macro_f_string_static_t_initialize("color", 5); + const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); { const f_status_t status = f_color_save_2(format, color, color, 0); @@ -25,8 +25,8 @@ void test__f_color_save_2_works(void **state) { f_color_context_t context = f_color_context_t_initialize; f_string_dynamic_t buffer = f_string_dynamic_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color1 = macro_f_string_static_t_initialize("color1", 6); - const f_string_static_t color2 = macro_f_string_static_t_initialize("color2", 6); + const f_string_static_t color1 = macro_f_string_static_t_initialize2("color1", 6); + const f_string_static_t color2 = macro_f_string_static_t_initialize2("color2", 6); { f_status_t status = F_none; diff --git a/level_0/f_color/tests/c/test-color-save_3.c b/level_0/f_color/tests/c/test-color-save_3.c index 6e1aafb..e3e4c0e 100644 --- a/level_0/f_color/tests/c/test-color-save_3.c +++ b/level_0/f_color/tests/c/test-color-save_3.c @@ -10,7 +10,7 @@ extern "C" { f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color = macro_f_string_static_t_initialize("color", 5); + const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); { const f_status_t status = f_color_save_3(format, color, color, color, 0); @@ -25,9 +25,9 @@ void test__f_color_save_3_works(void **state) { f_color_context_t context = f_color_context_t_initialize; f_string_dynamic_t buffer = f_string_dynamic_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color1 = macro_f_string_static_t_initialize("color1", 6); - const f_string_static_t color2 = macro_f_string_static_t_initialize("color2", 6); - const f_string_static_t color3 = macro_f_string_static_t_initialize("color3", 6); + const f_string_static_t color1 = macro_f_string_static_t_initialize2("color1", 6); + const f_string_static_t color2 = macro_f_string_static_t_initialize2("color2", 6); + const f_string_static_t color3 = macro_f_string_static_t_initialize2("color3", 6); { f_status_t status = F_none; diff --git a/level_0/f_color/tests/c/test-color-save_4.c b/level_0/f_color/tests/c/test-color-save_4.c index d85b4d9..5656ab8 100644 --- a/level_0/f_color/tests/c/test-color-save_4.c +++ b/level_0/f_color/tests/c/test-color-save_4.c @@ -10,7 +10,7 @@ extern "C" { f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color = macro_f_string_static_t_initialize("color", 5); + const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); { const f_status_t status = f_color_save_4(format, color, color, color, color, 0); @@ -25,10 +25,10 @@ void test__f_color_save_4_works(void **state) { f_color_context_t context = f_color_context_t_initialize; f_string_dynamic_t buffer = f_string_dynamic_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color1 = macro_f_string_static_t_initialize("color1", 6); - const f_string_static_t color2 = macro_f_string_static_t_initialize("color2", 6); - const f_string_static_t color3 = macro_f_string_static_t_initialize("color3", 6); - const f_string_static_t color4 = macro_f_string_static_t_initialize("color4", 6); + const f_string_static_t color1 = macro_f_string_static_t_initialize2("color1", 6); + const f_string_static_t color2 = macro_f_string_static_t_initialize2("color2", 6); + const f_string_static_t color3 = macro_f_string_static_t_initialize2("color3", 6); + const f_string_static_t color4 = macro_f_string_static_t_initialize2("color4", 6); { f_status_t status = F_none; diff --git a/level_0/f_color/tests/c/test-color-save_5.c b/level_0/f_color/tests/c/test-color-save_5.c index 81444ec..e5d57ce 100644 --- a/level_0/f_color/tests/c/test-color-save_5.c +++ b/level_0/f_color/tests/c/test-color-save_5.c @@ -10,7 +10,7 @@ extern "C" { f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color = macro_f_string_static_t_initialize("color", 5); + const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); { const f_status_t status = f_color_save_5(format, color, color, color, color, color, 0); @@ -25,11 +25,11 @@ void test__f_color_save_5_works(void **state) { f_color_context_t context = f_color_context_t_initialize; f_string_dynamic_t buffer = f_string_dynamic_t_initialize; const f_color_format_t format = f_color_format_t_initialize; - const f_string_static_t color1 = macro_f_string_static_t_initialize("color1", 6); - const f_string_static_t color2 = macro_f_string_static_t_initialize("color2", 6); - const f_string_static_t color3 = macro_f_string_static_t_initialize("color3", 6); - const f_string_static_t color4 = macro_f_string_static_t_initialize("color4", 6); - const f_string_static_t color5 = macro_f_string_static_t_initialize("color5", 6); + const f_string_static_t color1 = macro_f_string_static_t_initialize2("color1", 6); + const f_string_static_t color2 = macro_f_string_static_t_initialize2("color2", 6); + const f_string_static_t color3 = macro_f_string_static_t_initialize2("color3", 6); + const f_string_static_t color4 = macro_f_string_static_t_initialize2("color4", 6); + const f_string_static_t color5 = macro_f_string_static_t_initialize2("color5", 6); { f_status_t status = F_none; diff --git a/level_0/f_console/c/console-common.c b/level_0/f_console/c/console-common.c index f24ba32..2cc4947 100644 --- a/level_0/f_console/c/console-common.c +++ b/level_0/f_console/c/console-common.c @@ -5,39 +5,87 @@ extern "C" { #endif #ifndef _di_f_console_standard_s_ - const f_string_static_t f_console_standard_short_dark_s = macro_f_string_static_t_initialize2(F_console_standard_short_dark_s, 0, F_console_standard_short_dark_s_length); - const f_string_static_t f_console_standard_short_debug_s = macro_f_string_static_t_initialize2(F_console_standard_short_debug_s, 0, F_console_standard_short_debug_s_length); - const f_string_static_t f_console_standard_short_help_s = macro_f_string_static_t_initialize2(F_console_standard_short_help_s, 0, F_console_standard_short_help_s_length); - const f_string_static_t f_console_standard_short_light_s = macro_f_string_static_t_initialize2(F_console_standard_short_light_s, 0, F_console_standard_short_light_s_length); - const f_string_static_t f_console_standard_short_no_color_s = macro_f_string_static_t_initialize2(F_console_standard_short_no_color_s, 0, F_console_standard_short_no_color_s_length); - const f_string_static_t f_console_standard_short_normal_s = macro_f_string_static_t_initialize2(F_console_standard_short_normal_s, 0, F_console_standard_short_normal_s_length); - const f_string_static_t f_console_standard_short_quiet_s = macro_f_string_static_t_initialize2(F_console_standard_short_quiet_s, 0, F_console_standard_short_quiet_s_length); - const f_string_static_t f_console_standard_short_status_in_s = macro_f_string_static_t_initialize2(F_console_standard_short_status_in_s, 0, F_console_standard_short_status_in_s_length); - const f_string_static_t f_console_standard_short_status_out_s = macro_f_string_static_t_initialize2(F_console_standard_short_status_out_s, 0, F_console_standard_short_status_out_s_length); - const f_string_static_t f_console_standard_short_verbose_s = macro_f_string_static_t_initialize2(F_console_standard_short_verbose_s, 0, F_console_standard_short_verbose_s_length); - const f_string_static_t f_console_standard_short_version_s = macro_f_string_static_t_initialize2(F_console_standard_short_version_s, 0, F_console_standard_short_version_s_length); - - const f_string_static_t f_console_standard_long_dark_s = macro_f_string_static_t_initialize2(F_console_standard_long_dark_s, 0, F_console_standard_long_dark_s_length); - const f_string_static_t f_console_standard_long_debug_s = macro_f_string_static_t_initialize2(F_console_standard_long_debug_s, 0, F_console_standard_long_debug_s_length); - const f_string_static_t f_console_standard_long_help_s = macro_f_string_static_t_initialize2(F_console_standard_long_help_s, 0, F_console_standard_long_help_s_length); - const f_string_static_t f_console_standard_long_light_s = macro_f_string_static_t_initialize2(F_console_standard_long_light_s, 0, F_console_standard_long_light_s_length); - const f_string_static_t f_console_standard_long_no_color_s = macro_f_string_static_t_initialize2(F_console_standard_long_no_color_s, 0, F_console_standard_long_no_color_s_length); - const f_string_static_t f_console_standard_long_normal_s = macro_f_string_static_t_initialize2(F_console_standard_long_normal_s, 0, F_console_standard_long_normal_s_length); - const f_string_static_t f_console_standard_long_quiet_s = macro_f_string_static_t_initialize2(F_console_standard_long_quiet_s, 0, F_console_standard_long_quiet_s_length); - const f_string_static_t f_console_standard_long_status_in_s = macro_f_string_static_t_initialize2(F_console_standard_long_status_in_s, 0, F_console_standard_long_status_in_s_length); - const f_string_static_t f_console_standard_long_status_out_s = macro_f_string_static_t_initialize2(F_console_standard_long_status_out_s, 0, F_console_standard_long_status_out_s_length); - const f_string_static_t f_console_standard_long_verbose_s = macro_f_string_static_t_initialize2(F_console_standard_long_verbose_s, 0, F_console_standard_long_verbose_s_length); - const f_string_static_t f_console_standard_long_version_s = macro_f_string_static_t_initialize2(F_console_standard_long_version_s, 0, F_console_standard_long_version_s_length); + const f_string_static_t f_console_standard_short_dark_s = macro_f_string_static_t_initialize(F_console_standard_short_dark_s, 0, F_console_standard_short_dark_s_length); + const f_string_static_t f_console_standard_short_debug_s = macro_f_string_static_t_initialize(F_console_standard_short_debug_s, 0, F_console_standard_short_debug_s_length); + const f_string_static_t f_console_standard_short_help_s = macro_f_string_static_t_initialize(F_console_standard_short_help_s, 0, F_console_standard_short_help_s_length); + const f_string_static_t f_console_standard_short_light_s = macro_f_string_static_t_initialize(F_console_standard_short_light_s, 0, F_console_standard_short_light_s_length); + const f_string_static_t f_console_standard_short_no_color_s = macro_f_string_static_t_initialize(F_console_standard_short_no_color_s, 0, F_console_standard_short_no_color_s_length); + const f_string_static_t f_console_standard_short_normal_s = macro_f_string_static_t_initialize(F_console_standard_short_normal_s, 0, F_console_standard_short_normal_s_length); + const f_string_static_t f_console_standard_short_quiet_s = macro_f_string_static_t_initialize(F_console_standard_short_quiet_s, 0, F_console_standard_short_quiet_s_length); + const f_string_static_t f_console_standard_short_status_in_s = macro_f_string_static_t_initialize(F_console_standard_short_status_in_s, 0, F_console_standard_short_status_in_s_length); + const f_string_static_t f_console_standard_short_status_out_s = macro_f_string_static_t_initialize(F_console_standard_short_status_out_s, 0, F_console_standard_short_status_out_s_length); + const f_string_static_t f_console_standard_short_verbose_s = macro_f_string_static_t_initialize(F_console_standard_short_verbose_s, 0, F_console_standard_short_verbose_s_length); + const f_string_static_t f_console_standard_short_version_s = macro_f_string_static_t_initialize(F_console_standard_short_version_s, 0, F_console_standard_short_version_s_length); + + const f_string_static_t f_console_standard_long_dark_s = macro_f_string_static_t_initialize(F_console_standard_long_dark_s, 0, F_console_standard_long_dark_s_length); + const f_string_static_t f_console_standard_long_debug_s = macro_f_string_static_t_initialize(F_console_standard_long_debug_s, 0, F_console_standard_long_debug_s_length); + const f_string_static_t f_console_standard_long_help_s = macro_f_string_static_t_initialize(F_console_standard_long_help_s, 0, F_console_standard_long_help_s_length); + const f_string_static_t f_console_standard_long_light_s = macro_f_string_static_t_initialize(F_console_standard_long_light_s, 0, F_console_standard_long_light_s_length); + const f_string_static_t f_console_standard_long_no_color_s = macro_f_string_static_t_initialize(F_console_standard_long_no_color_s, 0, F_console_standard_long_no_color_s_length); + const f_string_static_t f_console_standard_long_normal_s = macro_f_string_static_t_initialize(F_console_standard_long_normal_s, 0, F_console_standard_long_normal_s_length); + const f_string_static_t f_console_standard_long_quiet_s = macro_f_string_static_t_initialize(F_console_standard_long_quiet_s, 0, F_console_standard_long_quiet_s_length); + const f_string_static_t f_console_standard_long_status_in_s = macro_f_string_static_t_initialize(F_console_standard_long_status_in_s, 0, F_console_standard_long_status_in_s_length); + const f_string_static_t f_console_standard_long_status_out_s = macro_f_string_static_t_initialize(F_console_standard_long_status_out_s, 0, F_console_standard_long_status_out_s_length); + const f_string_static_t f_console_standard_long_verbose_s = macro_f_string_static_t_initialize(F_console_standard_long_verbose_s, 0, F_console_standard_long_verbose_s_length); + const f_string_static_t f_console_standard_long_version_s = macro_f_string_static_t_initialize(F_console_standard_long_version_s, 0, F_console_standard_long_version_s_length); #endif // _di_f_console_standard_s_ #ifndef _di_f_console_symbol_s_ - const f_string_static_t f_console_symbol_short_enable_s = macro_f_string_static_t_initialize2(F_console_symbol_short_enable_s, 0, F_console_symbol_short_enable_s_length); - const f_string_static_t f_console_symbol_short_disable_s = macro_f_string_static_t_initialize2(F_console_symbol_short_disable_s, 0, F_console_symbol_short_disable_s_length); + const f_string_static_t f_console_symbol_short_enable_s = macro_f_string_static_t_initialize(F_console_symbol_short_enable_s, 0, F_console_symbol_short_enable_s_length); + const f_string_static_t f_console_symbol_short_disable_s = macro_f_string_static_t_initialize(F_console_symbol_short_disable_s, 0, F_console_symbol_short_disable_s_length); - const f_string_static_t f_console_symbol_long_enable_s = macro_f_string_static_t_initialize2(F_console_symbol_long_enable_s, 0, F_console_symbol_long_enable_s_length); - const f_string_static_t f_console_symbol_long_disable_s = macro_f_string_static_t_initialize2(F_console_symbol_long_disable_s, 0, F_console_symbol_long_disable_s_length); + const f_string_static_t f_console_symbol_long_enable_s = macro_f_string_static_t_initialize(F_console_symbol_long_enable_s, 0, F_console_symbol_long_enable_s_length); + const f_string_static_t f_console_symbol_long_disable_s = macro_f_string_static_t_initialize(F_console_symbol_long_disable_s, 0, F_console_symbol_long_disable_s_length); #endif // _di_f_console_symbol_s_ +#ifndef _di_f_console_parameters_delete_ + f_status_t f_console_parameters_delete(f_console_parameters_t * const parameters) { + #ifndef _di_level_0_parameters_checking_ + if (!parameters) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameters_checking_ + + f_status_t status = F_none; + + for (f_array_length_t i = 0; i < parameters->used; ++i) { + + status = f_type_array_lengths_resize(0, ¶meters->array[i].locations); + if (F_status_is_error(status)) return status; + + status = f_type_array_lengths_resize(0, ¶meters->array[i].locations_sub); + if (F_status_is_error(status)) return status; + + status = f_type_array_lengths_resize(0, ¶meters->array[i].values); + if (F_status_is_error(status)) return status; + } // for + + return f_string_dynamics_resize(0, ¶meters->arguments); + } +#endif // _di_f_console_parameters_delete_ + +#ifndef _di_f_console_parameters_destroy_ + f_status_t f_console_parameters_destroy(f_console_parameters_t * const parameters) { + #ifndef _di_level_0_parameters_checking_ + if (!parameters) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameters_checking_ + + f_status_t status = F_none; + + for (f_array_length_t i = 0; i < parameters->used; ++i) { + + status = f_type_array_lengths_adjust(0, ¶meters->array[i].locations); + if (F_status_is_error(status)) return status; + + status = f_type_array_lengths_adjust(0, ¶meters->array[i].locations_sub); + if (F_status_is_error(status)) return status; + + status = f_type_array_lengths_adjust(0, ¶meters->array[i].values); + if (F_status_is_error(status)) return status; + } // for + + return f_string_dynamics_adjust(0, ¶meters->arguments); + } +#endif // _di_f_console_parameters_destroy_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_console/c/console-common.h b/level_0/f_console/c/console-common.h index 6f94d32..cff7738 100644 --- a/level_0/f_console/c/console-common.h +++ b/level_0/f_console/c/console-common.h @@ -317,7 +317,7 @@ extern "C" { location_sub, \ locations, \ locations_sub, \ - values \ + values, \ } #endif // _di_f_console_parameter_t_ @@ -326,20 +326,22 @@ extern "C" { * * Designed for passing this to a function as a single argument. * - * parameter: Intended to be populated with an array of f_console_parameter_id_t whose size is defined by the "used" property. - * This is not intended to be dynamically allocated, so there is no "size" property. + * This is not intended to be dynamically allocated, so there is no "size" property. + * + * array: Intended to be populated with an array of f_console_parameter_t whose size is defined by the "used" property. + * arguments: An array of arguments pointing to the argv[] strings with the string lengths already calculated (This is a dynamic array of f_string_static_t). * length: The total number of parameters in the parameters array. */ #ifndef _di_f_console_parameters_t_ typedef struct { - f_console_parameter_t *parameter; + f_console_parameter_t *array; + + f_string_dynamics_t arguments; f_array_length_t used; } f_console_parameters_t; - #define f_console_parameters_t_initialize { 0, 0 } - - #define macro_f_console_parameters_t_initialize(parameters, length) { parameters, length } + #define f_console_parameters_t_initialize {0, f_string_dynamics_t_initialize, 0 } #endif // _di_f_console_parameters_t_ /** @@ -390,6 +392,48 @@ extern "C" { #define macro_f_console_arguments_t_initialize(argc, argv) { argc, argv } #endif // _di_f_console_arguments_t_ +/** + * Delete any dynamic allocated data on the parameters object. + * + * @param parameters + * The parameters object. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_string_dynamics_resize(). + * Errors (with error bit) from: f_type_array_lengths_resize(). + * + * @see f_string_dynamics_resize() + * @see f_type_array_lengths_resize() + */ +#ifndef _di_f_console_parameters_delete_ + extern f_status_t f_console_parameters_delete(f_console_parameters_t * const parameters); +#endif // _di_f_console_parameters_delete_ + +/** + * Destroy any dynamic allocated data on the parameters object. + * + * @param parameters + * The parameters object. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_string_dynamics_adjust(). + * Errors (with error bit) from: f_type_array_lengths_adjust(). + * + * @see f_string_dynamics_adjust() + * @see f_type_array_lengths_adjust() + */ +#ifndef _di_f_console_parameters_destroy_ + extern f_status_t f_console_parameters_destroy(f_console_parameters_t * const parameters); +#endif // _di_f_console_parameters_destroy_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_console/c/console.c b/level_0/f_console/c/console.c index 6c47e06..84915bc 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -79,14 +79,14 @@ extern "C" { return F_status_set_error(F_parameter); } - if (parameters.parameter[choices.id[i]].result == f_console_result_found_e) { - if (!location || parameters.parameter[choices.id[i]].location < location) { - location = parameters.parameter[choices.id[i]].location; - location_sub = parameters.parameter[choices.id[i]].location_sub; + if (parameters.array[choices.id[i]].result == f_console_result_found_e) { + if (!location || parameters.array[choices.id[i]].location < location) { + location = parameters.array[choices.id[i]].location; + location_sub = parameters.array[choices.id[i]].location_sub; priority = choices.id[i]; } - else if (parameters.parameter[choices.id[i]].location == location && parameters.parameter[choices.id[i]].location_sub < location_sub) { - location_sub = parameters.parameter[choices.id[i]].location_sub; + else if (parameters.array[choices.id[i]].location == location && parameters.array[choices.id[i]].location_sub < location_sub) { + location_sub = parameters.array[choices.id[i]].location_sub; priority = choices.id[i]; } } @@ -128,14 +128,14 @@ extern "C" { return F_status_set_error(F_parameter); } - if (parameters.parameter[choices.id[i]].result == f_console_result_found_e) { - if (!location || parameters.parameter[choices.id[i]].location > location) { - location = parameters.parameter[choices.id[i]].location; - location_sub = parameters.parameter[choices.id[i]].location_sub; + if (parameters.array[choices.id[i]].result == f_console_result_found_e) { + if (!location || parameters.array[choices.id[i]].location > location) { + location = parameters.array[choices.id[i]].location; + location_sub = parameters.array[choices.id[i]].location_sub; priority = choices.id[i]; } - else if (parameters.parameter[choices.id[i]].location == location && parameters.parameter[choices.id[i]].location_sub > location_sub) { - location_sub = parameters.parameter[choices.id[i]].location_sub; + else if (parameters.array[choices.id[i]].location == location && parameters.array[choices.id[i]].location_sub > location_sub) { + location_sub = parameters.array[choices.id[i]].location_sub; priority = choices.id[i]; } } @@ -153,12 +153,25 @@ extern "C" { #endif // _di_f_console_parameter_prioritize_right_ #ifndef _di_f_console_parameter_process_ - f_status_t f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, f_array_lengths_t *remaining) { + f_status_t f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, f_array_lengths_t *remaining) { #ifndef _di_level_0_parameter_checking_ if (!remaining) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ f_status_t status = F_none; + + parameters->arguments.used = 0; + + if (arguments.argc) { + status = f_string_dynamics_increase_by(arguments.argc, ¶meters->arguments); + if (F_status_is_error(status)) return status; + } + + // Append the program name parameter. + parameters->arguments.array[parameters->arguments.used].string = arguments.argv[0]; + parameters->arguments.array[parameters->arguments.used].used = strnlen(arguments.argv[0], F_console_parameter_size_d); + parameters->arguments.array[parameters->arguments.used++].size = 0; + f_console_id_t result = 0; bool found = F_false; @@ -167,7 +180,6 @@ extern "C" { f_array_length_t sub_location = 0; f_array_length_t increment_by = 0; - f_array_length_t argument_length = 0; f_array_length_t i = 0; f_array_length_t values = 0; @@ -182,20 +194,19 @@ extern "C" { while (location < arguments.argc) { + parameters->arguments.array[parameters->arguments.used].string = arguments.argv[location]; + parameters->arguments.array[parameters->arguments.used].used = strnlen(arguments.argv[location], F_console_parameter_size_d); + parameters->arguments.array[parameters->arguments.used++].size = 0; + // Additional parameters must always follow what requests them. if (needs_value.used > 0) { i = needs_value.array[0]; - status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters.parameter[i].values); + status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters->array[i].values); + if (F_status_is_error(status)) break; - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); - - return status; - } - - parameters.parameter[i].result = f_console_result_additional_e; - parameters.parameter[i].values.array[parameters.parameter[i].values.used++] = location; + parameters->array[i].result = f_console_result_additional_e; + parameters->array[i].values.array[parameters->array[i].values.used++] = location; --needs_value.used; @@ -211,19 +222,17 @@ extern "C" { f_console_identify(arguments.argv[location], &result); - argument_length = strnlen(arguments.argv[location], F_console_parameter_size_d); - // Process the current parameter. if (result == f_console_short_enable_e || result == f_console_short_disable_e) { increment_by = 1; sub_location = 1; } else if (result == f_console_long_enable_e || result == f_console_long_disable_e) { - increment_by = argument_length; + increment_by = parameters->arguments.array[location].used; sub_location = 2; } else { - increment_by = argument_length; + increment_by = parameters->arguments.array[location].used; sub_location = 0; } @@ -247,14 +256,14 @@ extern "C" { if (console_short != f_console_none_e) { // The sub_location is used on a per increment basis (such as 'tar -xcf', the '-' would have an increment of 1, therefore x, c, and f would all be three separate parameters). - while (sub_location < argument_length) { + while (sub_location < parameters->arguments.array[location].used) { - for (i = 0; i < parameters.used; ++i) { + for (i = 0; i < parameters->used; ++i) { - if (parameters.parameter[i].type != console_type) continue; + if (parameters->array[i].type != console_type) continue; if (result == console_short) { - if (!parameters.parameter[i].symbol_short) continue; + if (!parameters->array[i].symbol_short) continue; width = macro_f_utf_byte_width_is(arguments.argv[location][sub_location]); @@ -262,39 +271,29 @@ extern "C" { increment_by = width; } - if (arguments.argv[location][sub_location] != *parameters.parameter[i].symbol_short) continue; + if (arguments.argv[location][sub_location] != *parameters->array[i].symbol_short) continue; if (width > 0) { f_utf_character_t character_argument_utf = 0; f_utf_character_t character_console_utf = 0; - f_number_unsigned_t width_max = argument_length - sub_location; + f_number_unsigned_t width_max = parameters->arguments.array[location].used - sub_location; status = f_utf_char_to_character(arguments.argv[location] + sub_location, width_max, &character_argument_utf); + if (F_status_is_error(status)) break; - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); - - return status; - } + width_max = strlen(parameters->array[i].symbol_short); - width_max = strlen(parameters.parameter[i].symbol_short); - - status = f_utf_char_to_character((f_string_t) parameters.parameter[i].symbol_short, width_max, &character_console_utf); - - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); - - return status; - } + status = f_utf_char_to_character((f_string_t) parameters->array[i].symbol_short, width_max, &character_console_utf); + if (F_status_is_error(status)) break; if (character_argument_utf != character_console_utf) continue; } } else if (result == console_long) { - if (!parameters.parameter[i].symbol_long) continue; + if (!parameters->array[i].symbol_long) continue; - if (strncmp(&arguments.argv[location][sub_location], parameters.parameter[i].symbol_long, increment_by + 1) != 0) { + if (strncmp(&arguments.argv[location][sub_location], parameters->array[i].symbol_long, increment_by + 1) != 0) { continue; } } @@ -302,50 +301,35 @@ extern "C" { continue; } - status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters.parameter[i].locations); - - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); - - return status; - } + status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters->array[i].locations); + if (F_status_is_error(status)) break; - status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters.parameter[i].locations_sub); - - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); - - return status; - } + status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters->array[i].locations_sub); + if (F_status_is_error(status)) break; found = F_true; - parameters.parameter[i].locations.array[parameters.parameter[i].locations.used++] = location; + parameters->array[i].locations.array[parameters->array[i].locations.used++] = location; - parameters.parameter[i].result = f_console_result_found_e; - parameters.parameter[i].location = location; - parameters.parameter[i].location_sub = 0; + parameters->array[i].result = f_console_result_found_e; + parameters->array[i].location = location; + parameters->array[i].location_sub = 0; if (result == console_short) { - parameters.parameter[i].location_sub = sub_location; - parameters.parameter[i].locations_sub.array[parameters.parameter[i].locations_sub.used++] = sub_location; + parameters->array[i].location_sub = sub_location; + parameters->array[i].locations_sub.array[parameters->array[i].locations_sub.used++] = sub_location; } else { - parameters.parameter[i].locations_sub.array[parameters.parameter[i].locations_sub.used++] = 0; + parameters->array[i].locations_sub.array[parameters->array[i].locations_sub.used++] = 0; } - if (parameters.parameter[i].values_total) { - if (needs_value.used + parameters.parameter[i].values_total > needs_value.size) { - status = f_type_array_lengths_resize(needs_value.used + parameters.parameter[i].values_total, &needs_value); - - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); - - return status; - } + if (parameters->array[i].values_total) { + if (needs_value.used + parameters->array[i].values_total > needs_value.size) { + status = f_type_array_lengths_resize(needs_value.used + parameters->array[i].values_total, &needs_value); + if (F_status_is_error(status)) break; } - for (values = 0; values < parameters.parameter[i].values_total; ++values) { + for (values = 0; values < parameters->array[i].values_total; ++values) { needs_value.array[needs_value.used++] = i; } // for } @@ -353,53 +337,42 @@ extern "C" { break; } // for + if (F_status_is_error(status)) break; + sub_location += increment_by; } // while + + if (F_status_is_error(status)) break; } else { - for (i = 0; i < parameters.used; ++i) { - - if (parameters.parameter[i].type != f_console_type_other_e) continue; + for (i = 0; i < parameters->used; ++i) { - if (!parameters.parameter[i].symbol_other) continue; + if (parameters->array[i].type != f_console_type_other_e) continue; - if (strncmp(arguments.argv[location], parameters.parameter[i].symbol_other, argument_length + 1) != 0) continue; + if (!parameters->array[i].symbol_other) continue; - status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters.parameter[i].locations); + if (strncmp(arguments.argv[location], parameters->array[i].symbol_other, parameters->arguments.array[location].used + 1) != 0) continue; - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); + status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters->array[i].locations); + if (F_status_is_error(status)) break; - return status; - } - - status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters.parameter[i].locations_sub); + status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters->array[i].locations_sub); + if (F_status_is_error(status)) break; - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); + parameters->array[i].locations.array[parameters->array[i].locations.used++] = location; + parameters->array[i].locations_sub.array[parameters->array[i].locations_sub.used++] = 0; - return status; - } + parameters->array[i].result = f_console_result_found_e; + parameters->array[i].location = location; + parameters->array[i].location_sub = 0; - parameters.parameter[i].locations.array[parameters.parameter[i].locations.used++] = location; - parameters.parameter[i].locations_sub.array[parameters.parameter[i].locations_sub.used++] = 0; - - parameters.parameter[i].result = f_console_result_found_e; - parameters.parameter[i].location = location; - parameters.parameter[i].location_sub = 0; - - if (parameters.parameter[i].values_total) { - if (needs_value.used + parameters.parameter[i].values_total > needs_value.size) { - status = f_type_array_lengths_resize(needs_value.used + parameters.parameter[i].values_total, &needs_value); - - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); - - return status; - } + if (parameters->array[i].values_total) { + if (needs_value.used + parameters->array[i].values_total > needs_value.size) { + status = f_type_array_lengths_resize(needs_value.used + parameters->array[i].values_total, &needs_value); + if (F_status_is_error(status)) break; } - for (values = 0; values < parameters.parameter[i].values_total; ++values) { + for (values = 0; values < parameters->array[i].values_total; ++values) { needs_value.array[needs_value.used++] = i; } // for } @@ -408,19 +381,16 @@ extern "C" { break; } // for + + if (F_status_is_error(status)) break; } if (!found) { - // Populate list of remaining parameters.parameter that are not associated with anything. + // Populate list of remaining parameters->array that are not associated with anything. if (remaining->used == remaining->size) { status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, remaining); - - if (F_status_is_error(status)) { - f_type_array_lengths_resize(0, &needs_value); - - return status; - } + if (F_status_is_error(status)) break; } remaining->array[remaining->used++] = location; @@ -429,6 +399,20 @@ extern "C" { ++location; } // while + // Make sure the entire parameters arguments array is populated. + for (; location < arguments.argc; ++location) { + + parameters->arguments.array[parameters->arguments.used].string = arguments.argv[location]; + parameters->arguments.array[parameters->arguments.used].used = strnlen(arguments.argv[location], F_console_parameter_size_d); + parameters->arguments.array[parameters->arguments.used++].size = 0; + } // for + + if (F_status_is_error(status)) { + f_type_array_lengths_resize(0, &needs_value); + + return status; + } + if (needs_value.used > 0) { status = F_data_not; } diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index f6de2fa..9bb6b9e 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -136,7 +136,6 @@ extern "C" { * The parameters passed to the process. * @param parameters * The console parameters to look for. - * This will be updated by this function with the results. * @param remaining * A list of remaining parameters not associated with anything. * @@ -148,9 +147,13 @@ extern "C" { * F_failure (with error bit) if width is not long enough to convert when processing arguments as UTF-8. * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character, when processing arguments. + * + * Errors (with error bit) from: f_string_dynamics_increase_by(). + * + * @see f_string_dynamics_increase_by() */ #ifndef _di_f_console_parameter_process_ - extern f_status_t f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, f_array_lengths_t *remaining); + extern f_status_t f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, f_array_lengths_t *remaining); #endif // _di_f_console_parameter_process_ #ifdef __cplusplus diff --git a/level_0/f_control_group/c/control_group-common.c b/level_0/f_control_group/c/control_group-common.c index 99a0134..6fbfa76 100644 --- a/level_0/f_control_group/c/control_group-common.c +++ b/level_0/f_control_group/c/control_group-common.c @@ -5,9 +5,9 @@ extern "C" { #endif #ifndef _di_f_control_group_defines_ - const f_string_static_t f_control_group_path_system_default_s = macro_f_string_static_t_initialize2(F_control_group_path_system_default_s, 0, F_control_group_path_system_default_s_length); - const f_string_static_t f_control_group_path_system_prefix_s = macro_f_string_static_t_initialize2(F_control_group_path_system_prefix_s, 0, F_control_group_path_system_prefix_s_length); - const f_string_static_t f_control_group_path_system_suffix_s = macro_f_string_static_t_initialize2(F_control_group_path_system_suffix_s, 0, F_control_group_path_system_suffix_s_length); + const f_string_static_t f_control_group_path_system_default_s = macro_f_string_static_t_initialize(F_control_group_path_system_default_s, 0, F_control_group_path_system_default_s_length); + const f_string_static_t f_control_group_path_system_prefix_s = macro_f_string_static_t_initialize(F_control_group_path_system_prefix_s, 0, F_control_group_path_system_prefix_s_length); + const f_string_static_t f_control_group_path_system_suffix_s = macro_f_string_static_t_initialize(F_control_group_path_system_suffix_s, 0, F_control_group_path_system_suffix_s_length); #endif // _di_f_control_group_defines_ #ifdef __cplusplus diff --git a/level_0/f_directory/c/directory.c b/level_0/f_directory/c/directory.c index f517c1e..1577728 100644 --- a/level_0/f_directory/c/directory.c +++ b/level_0/f_directory/c/directory.c @@ -6,30 +6,42 @@ extern "C" { #endif #ifndef _di_f_directory_create_ - f_status_t f_directory_create(const f_string_t path, const mode_t mode) { + f_status_t f_directory_create(const f_string_static_t path, const mode_t mode) { + + if (!path.used) { + return F_data_not; + } return private_f_directory_create(path, mode); } #endif // _di_f_directory_create_ #ifndef _di_f_directory_create_at_ - f_status_t f_directory_create_at(const int at_id, const f_string_t path, const mode_t mode) { + f_status_t f_directory_create_at(const int at_id, const f_string_static_t path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ if (at_id <= 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_directory_create_at(at_id, path, mode); } #endif // _di_f_directory_create_at_ #ifndef _di_f_directory_exists_ - f_status_t f_directory_exists(const f_string_t path) { + f_status_t f_directory_exists(const f_string_static_t path) { + + if (!path.used) { + return F_data_not; + } struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); - if (stat(path, &file_stat) < 0) { + if (stat(path.string, &file_stat) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == ELOOP) return F_status_set_error(F_loop); @@ -51,13 +63,17 @@ extern "C" { #endif // _di_f_directory_exists_ #ifndef _di_f_directory_exists_at_ - f_status_t f_directory_exists_at(const int at_id, const f_string_t path, const int flag) { + f_status_t f_directory_exists_at(const int at_id, const f_string_static_t path, const int flag) { + + if (!path.used) { + return F_data_not; + } struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); - if (fstatat(at_id, path, &file_stat, flag) < 0) { + if (fstatat(at_id, path.string, &file_stat, flag) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -80,13 +96,17 @@ extern "C" { #endif // _di_f_directory_exists_at_ #ifndef _di_f_directory_is_ - f_status_t f_directory_is(const f_string_t path) { + f_status_t f_directory_is(const f_string_static_t path) { + + if (!path.used) { + return F_data_not; + } struct stat file_stat; memset(&file_stat, AT_SYMLINK_NOFOLLOW, sizeof(struct stat)); - if (stat(path, &file_stat) < 0) { + if (stat(path.string, &file_stat) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == ENAMETOOLONG) return F_status_set_error(F_name); @@ -108,13 +128,17 @@ extern "C" { #endif // _di_f_directory_is_ #ifndef _di_f_directory_is_at_ - f_status_t f_directory_is_at(const int at_id, const f_string_t path, const int flag) { + f_status_t f_directory_is_at(const int at_id, const f_string_static_t path, const int flag) { + + if (!path.used) { + return F_data_not; + } struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); - if (fstatat(at_id, path, &file_stat, flag) < 0) { + if (fstatat(at_id, path.string, &file_stat, flag) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -137,17 +161,21 @@ extern "C" { #endif // _di_f_directory_is_at_ #ifndef _di_f_directory_list_ - f_status_t f_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics_t *names) { + f_status_t f_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics_t *names) { #ifndef _di_level_0_parameter_checking_ if (!names) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + struct dirent **listing = 0; size_t i = 0; f_array_length_t size = 0; f_status_t status = F_none; - const size_t length = scandir(path, &listing, filter, sort); + const size_t length = scandir(path.string, &listing, filter, sort); if (length == -1) { if (errno == ENOMEM) return F_status_set_error(F_memory_not); @@ -170,8 +198,9 @@ extern "C" { if (F_status_is_error(status)) break; } - macro_f_string_dynamic_t_clear(names->array[names->used]) - macro_f_string_dynamic_t_resize(status, names->array[names->used], size); + names->array[names->used].used = 0; + + status = f_string_dynamic_increase_by(size, &names->array[names->used]); if (F_status_is_error(status)) break; memcpy(names->array[names->used].string, listing[i]->d_name, size); @@ -191,7 +220,7 @@ extern "C" { } if (!length) { - return F_data_not; + return F_directory_empty; } return F_none; @@ -199,18 +228,22 @@ extern "C" { #endif // _di_f_directory_list_ #ifndef _di_f_directory_open_ - f_status_t f_directory_open(const f_string_t path, const bool dereference, int *id) { + f_status_t f_directory_open(const f_string_static_t path, const bool dereference, int *id) { #ifndef _di_level_0_parameter_checking_ if (!id) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + int flag = F_directory_flag_directory_d | F_directory_flag_close_execute_d | F_directory_flag_path_d; if (dereference) { flag |= F_directory_flag_no_follow_d; } - *id = open(path, flag); + *id = open(path.string, flag); if (*id < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -236,19 +269,23 @@ extern "C" { #endif // _di_f_directory_open_ #ifndef _di_f_directory_open_at_ - f_status_t f_directory_open_at(const int at_id, const f_string_t path, const bool dereference, int *id) { + f_status_t f_directory_open_at(const int at_id, const f_string_static_t path, const bool dereference, int *id) { #ifndef _di_level_0_parameter_checking_ if (at_id <= 0) return F_status_set_error(F_parameter); if (!id) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + int flag = F_directory_flag_directory_d | F_directory_flag_close_execute_d | F_directory_flag_path_d; if (dereference) { flag |= F_directory_flag_no_follow_d; } - *id = openat(at_id, path, flag); + *id = openat(at_id, path.string, flag); if (*id < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -275,18 +312,22 @@ extern "C" { #endif // _di_f_directory_open_at_ #ifndef _di_f_directory_remove_ - f_status_t f_directory_remove(const f_string_t path, const int depth_max, const bool preserve) { + f_status_t f_directory_remove(const f_string_static_t path, const int depth_max, const bool preserve) { #ifndef _di_level_0_parameter_checking_ if (depth_max < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + int result = 0; if (depth_max) { - result = nftw(path, private_f_directory_remove_recursively, depth_max, FTW_DEPTH | FTW_PHYS); + result = nftw(path.string, private_f_directory_remove_recursively, depth_max, FTW_DEPTH | FTW_PHYS); if (result == 0 && !preserve) { - result = remove(path); + result = remove(path.string); } } else { @@ -296,7 +337,7 @@ extern "C" { return F_none; } - result = remove(path); + result = remove(path.string); } if (result < 0) { @@ -325,18 +366,22 @@ extern "C" { #endif // _di_f_directory_remove_ #ifndef _di_f_directory_remove_custom_ - f_status_t f_directory_remove_custom(const f_string_t path, const int depth_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)) { + f_status_t f_directory_remove_custom(const f_string_static_t path, const int depth_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)) { #ifndef _di_level_0_parameter_checking_ if (depth_max < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + int result = 0; if (depth_max) { - result = nftw(path, custom, depth_max, FTW_DEPTH | FTW_PHYS); + result = nftw(path.string, custom, depth_max, FTW_DEPTH | FTW_PHYS); if (result == 0 && !preserve) { - result = remove(path); + result = remove(path.string); } } else { @@ -346,7 +391,7 @@ extern "C" { return F_none; } - result = remove(path); + result = remove(path.string); } if (result < 0) { @@ -375,16 +420,17 @@ extern "C" { #endif // _di_f_directory_remove_custom_ #ifndef _di_f_directory_touch_ - f_status_t f_directory_touch(const f_string_t path, const mode_t mode) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_directory_touch(const f_string_static_t path, const mode_t mode) { + + if (!path.used) { + return F_data_not; + } struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); - if (stat(path, &file_stat) < 0) { + if (stat(path.string, &file_stat) < 0) { if (errno == ENOENT) { return private_f_directory_create(path, mode); } @@ -400,7 +446,7 @@ extern "C" { return F_status_set_error(F_file_stat); } - if (utimensat(F_directory_at_current_working_d, path, 0, 0) < 0) { + if (utimensat(F_directory_at_current_working_d, path.string, 0, 0) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -421,34 +467,31 @@ extern "C" { #endif // _di_f_directory_touch_ #ifndef _di_f_directory_touch_at_ - f_status_t f_directory_touch_at(const int at_id, const f_string_t path, const mode_t mode, const int flag) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_directory_touch_at(const int at_id, const f_string_static_t path, const mode_t mode, const int flag) { + + if (!path.used) { + return F_data_not; + } struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); - if (fstatat(at_id, path, &file_stat, flag) < 0) { - if (errno == ENOENT) { - return private_f_directory_create_at(at_id, path, mode); - } - - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (fstatat(at_id, path.string, &file_stat, flag) < 0) { + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == ENOENT) return private_f_directory_create_at(at_id, path, mode); if (errno == ENOMEM) return F_status_set_error(F_memory_not); - if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == ENOTDIR) return F_status_set_error(F_directory); - if (errno == ENOENT) return F_status_set_error(F_file_found_not); - if (errno == EACCES) return F_status_set_error(F_access_denied); - if (errno == ELOOP) return F_status_set_error(F_loop); - if (errno == EBADF) return F_status_set_error(F_directory_descriptor); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); return F_status_set_error(F_file_stat); } - if (utimensat(at_id, path, 0, flag) < 0) { + if (utimensat(at_id, path.string, 0, flag) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); diff --git a/level_0/f_directory/c/directory.h b/level_0/f_directory/c/directory.h index 93fd09c..edf692a 100644 --- a/level_0/f_directory/c/directory.h +++ b/level_0/f_directory/c/directory.h @@ -54,6 +54,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) if a supposed directory in path is not actually a directory. @@ -73,7 +74,7 @@ extern "C" { * @see mkdir() */ #ifndef _di_f_directory_create_ - extern f_status_t f_directory_create(const f_string_t path, const mode_t mode); + extern f_status_t f_directory_create(const f_string_static_t path, const mode_t mode); #endif // _di_f_directory_create_ /** @@ -88,6 +89,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) if a supposed directory in path is not actually a directory. @@ -108,7 +110,7 @@ extern "C" { * @see mkdirat() */ #ifndef _di_f_directory_create_at_ - extern f_status_t f_directory_create_at(const int at_id, const f_string_t path, const mode_t mode); + extern f_status_t f_directory_create_at(const int at_id, const f_string_static_t path, const mode_t mode); #endif // _di_f_directory_create_at_ /** @@ -121,6 +123,7 @@ extern "C" { * F_true if path was found and path is a directory (or a symlink to a directory). * F_false if path was found and path is not a directory. * F_file_found_not if the path was not found. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) on loop error. @@ -132,7 +135,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_directory_exists_ - extern f_status_t f_directory_exists(const f_string_t path); + extern f_status_t f_directory_exists(const f_string_static_t path); #endif // _di_f_directory_exists_ /** @@ -149,6 +152,7 @@ extern "C" { * F_true if path was found and path is a directory (or a symlink to a directory). * F_false if path was found and path is not a directory. * F_file_found_not if the path was not found. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. @@ -161,7 +165,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_directory_exists_at_ - extern f_status_t f_directory_exists_at(const int at_id, const f_string_t path, const int flag); + extern f_status_t f_directory_exists_at(const int at_id, const f_string_static_t path, const int flag); #endif // _di_f_directory_exists_at_ /** @@ -174,6 +178,7 @@ extern "C" { * F_true if path was found and path is a directory. * F_false if path was found and path is not a directory (this includes symlinks). * F_file_found_not if the path was not found. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) on loop error. @@ -185,7 +190,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_directory_is_ - extern f_status_t f_directory_is(const f_string_t path); + extern f_status_t f_directory_is(const f_string_static_t path); #endif // _di_f_directory_is_ /** @@ -202,6 +207,7 @@ extern "C" { * F_true if path was found and path is a directory. * F_false if path was found and path is not a directory. * F_file_found_not if the path was not found. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. @@ -214,7 +220,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_directory_is_at_ - extern f_status_t f_directory_is_at(const int at_id, const f_string_t path, const int flag); + extern f_status_t f_directory_is_at(const int at_id, const f_string_static_t path, const int flag); #endif // _di_f_directory_is_at_ /** @@ -236,7 +242,8 @@ extern "C" { * * @return * F_none on success. - * F_data_not if directory is empty. + * F_data_not if path.used is 0. + * F_directory_empty if directory is empty. * * F_array_too_large (with error bit) if the directory buffer max length would be exceeded. * F_failure (with error bit) if failed to read directory information. @@ -248,7 +255,7 @@ extern "C" { * @see versionsort() */ #ifndef _di_f_directory_list_ - extern f_status_t f_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics_t *names); + extern f_status_t f_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics_t *names); #endif // _di_f_directory_list_ /** @@ -267,6 +274,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -287,7 +295,7 @@ extern "C" { * @see open() */ #ifndef _di_f_directory_open_ - extern f_status_t f_directory_open(const f_string_t path, const bool dereference, int *id); + extern f_status_t f_directory_open(const f_string_static_t path, const bool dereference, int *id); #endif // _di_f_directory_open_ /** @@ -308,6 +316,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -329,7 +338,7 @@ extern "C" { * @see openat() */ #ifndef _di_f_directory_open_at_ - extern f_status_t f_directory_open_at(const int at_id, const f_string_t path, const bool dereference, int *id); + extern f_status_t f_directory_open_at(const int at_id, const f_string_static_t path, const bool dereference, int *id); #endif // _di_f_directory_open_at_ /** @@ -347,6 +356,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file is busy. @@ -369,7 +379,7 @@ extern "C" { * @see remove() */ #ifndef _di_f_directory_remove_ - extern f_status_t f_directory_remove(const f_string_t path, const int depth_max, const bool preserve); + extern f_status_t f_directory_remove(const f_string_static_t path, const int depth_max, const bool preserve); #endif // _di_f_directory_remove_ /** @@ -390,6 +400,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file is busy. @@ -412,7 +423,7 @@ extern "C" { * @see remove() */ #ifndef _di_f_directory_remove_custom_ - extern f_status_t f_directory_remove_custom(const f_string_t path, const int depth_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)); + extern f_status_t f_directory_remove_custom(const f_string_static_t path, const int depth_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)); #endif // _di_f_directory_remove_custom_ /** @@ -427,6 +438,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -451,7 +463,7 @@ extern "C" { * @see utimensat() */ #ifndef _di_f_directory_touch_ - extern f_status_t f_directory_touch(const f_string_t path, const mode_t mode); + extern f_status_t f_directory_touch(const f_string_static_t path, const mode_t mode); #endif // _di_f_directory_touch_ /** @@ -470,6 +482,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -494,7 +507,7 @@ extern "C" { * @see utimensat() */ #ifndef _di_f_directory_touch_at_ - extern f_status_t f_directory_touch_at(const int at_id, const f_string_t path, const mode_t mode, const int flag); + extern f_status_t f_directory_touch_at(const int at_id, const f_string_static_t path, const mode_t mode, const int flag); #endif // _di_f_directory_touch_at_ #ifdef __cplusplus diff --git a/level_0/f_directory/c/private-directory.c b/level_0/f_directory/c/private-directory.c index 96f7385..ad790c2 100644 --- a/level_0/f_directory/c/private-directory.c +++ b/level_0/f_directory/c/private-directory.c @@ -6,9 +6,9 @@ extern "C" { #endif #if !defined(_di_f_directory_create_) || !defined(_di_f_directory_touch_) - f_status_t private_f_directory_create(const f_string_t path, const mode_t mode) { + f_status_t private_f_directory_create(const f_string_static_t path, const mode_t mode) { - if (mkdir(path, mode) < 0) { + if (mkdir(path.string, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -32,9 +32,9 @@ extern "C" { #endif // !defined(_di_f_directory_create_) || !defined(_di_f_directory_touch_) #if !defined(_di_f_directory_create_at_) || !defined(_di_f_directory_touch_at_) - f_status_t private_f_directory_create_at(const int at_id, const f_string_t path, const mode_t mode) { + f_status_t private_f_directory_create_at(const int at_id, const f_string_static_t path, const mode_t mode) { - if (mkdirat(at_id, path, mode) < 0) { + if (mkdirat(at_id, path.string, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); diff --git a/level_0/f_directory/c/private-directory.h b/level_0/f_directory/c/private-directory.h index 3e1d221..d191ef4 100644 --- a/level_0/f_directory/c/private-directory.h +++ b/level_0/f_directory/c/private-directory.h @@ -46,7 +46,7 @@ extern "C" { * @see f_directory_touch() */ #if !defined(_di_f_directory_create_) || !defined(_di_f_directory_touch_) - extern f_status_t private_f_directory_create(const f_string_t path, const mode_t mode) F_attribute_visibility_internal_d; + extern f_status_t private_f_directory_create(const f_string_static_t path, const mode_t mode) F_attribute_visibility_internal_d; #endif // !defined(_di_f_directory_create_) || !defined(_di_f_directory_touch_) /** @@ -84,7 +84,7 @@ extern "C" { * @see f_directory_touch_at() */ #if !defined(_di_f_directory_create_at_) || !defined(_di_f_directory_touch_at_) - extern f_status_t private_f_directory_create_at(const int at_id, const f_string_t path, const mode_t mode) F_attribute_visibility_internal_d; + extern f_status_t private_f_directory_create_at(const int at_id, const f_string_static_t path, const mode_t mode) F_attribute_visibility_internal_d; #endif // !defined(_di_f_directory_create_at_) || !defined(_di_f_directory_touch_at_) /** diff --git a/level_0/f_environment/c/environment.c b/level_0/f_environment/c/environment.c index 964576b..a1106bd 100644 --- a/level_0/f_environment/c/environment.c +++ b/level_0/f_environment/c/environment.c @@ -7,6 +7,7 @@ extern "C" { #ifndef _di_f_environment_clear_ f_status_t f_environment_clear(void) { + if (!clearenv()) { return F_none; } @@ -16,12 +17,13 @@ extern "C" { #endif // _di_f_environment_clear_ #ifndef _di_f_environment_exists_ - f_status_t f_environment_exists(const f_string_t name) { - #ifndef _di_level_0_parameter_checking_ - if (!name) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_environment_exists(const f_string_static_t name) { + + if (!name.used) { + return F_data_not; + } - if (getenv(name)) { + if (getenv(name.string)) { return F_true; } @@ -30,117 +32,71 @@ extern "C" { #endif // _di_f_environment_exists_ #ifndef _di_f_environment_get_ - f_status_t f_environment_get(const f_string_t name, f_string_dynamic_t *value) { + f_status_t f_environment_get(const f_string_static_t name, f_string_dynamic_t *value) { #ifndef _di_level_0_parameter_checking_ - if (!name) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_environment_get(name, value); - } -#endif // _di_f_environment_get_ - -#ifndef _di_f_environment_get_dynamic_ - f_status_t f_environment_get_dynamic(const f_string_static_t name, f_string_dynamic_t *value) { - #ifndef _di_level_0_parameter_checking_ - if (name.used > name.size) return F_status_set_error(F_parameter); - if (value->used > value->size) return F_status_set_error(F_parameter); + if (!value) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (!name.used) { return F_data_not; } - if (!name.string[name.used - 1]) { - return private_f_environment_get(name.string, value); + const f_string_t result = getenv(name.string); + + if (!result) { + return F_exist_not; } - char variable_name[name.used + 1]; + const f_array_length_t size = strnlen(result, f_environment_max_length); - memcpy(&variable_name, name.string, name.used); - variable_name[name.used] = 0; + if (size) { + const f_status_t status = f_string_dynamic_increase_by(size, value); + if (F_status_is_error(status)) return status; - return private_f_environment_get(variable_name, value); - } -#endif // _di_f_environment_get_dynamic_ + memcpy(value->string + value->used, result, size); + value->used += size; + } + else { + value->used = 0; + } -#ifndef _di_f_environment_set_ - f_status_t f_environment_set(const f_string_t name, const f_string_t value, const bool replace) { - return private_f_environment_set(name, value, replace); + return F_none; } -#endif // _di_f_environment_set_ +#endif // _di_f_environment_get_ -#ifndef _di_f_environment_set_dynamic_ - f_status_t f_environment_set_dynamic(const f_string_static_t name, const f_string_static_t value, const bool replace) { - #ifndef _di_level_0_parameter_checking_ - if (name.used > name.size) return F_status_set_error(F_parameter); - if (value.used > value.size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_environment_set_ + f_status_t f_environment_set(const f_string_static_t name, const f_string_static_t value, const bool replace) { if (!name.used) { return F_data_not; } - if (!name.string[name.used - 1]) { - if (value.used > 0 && !value.string[value.used - 1]) { - return private_f_environment_set(name.string, value.string, replace); - } + if (setenv(name.string, value.string, replace) < 0) { + if (errno == EINVAL) return F_status_set_error(F_valid_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_not); - char variable_value[value.used + 1]; - - if (value.used > 0) { - memcpy(&variable_value, value.string, value.used); - } - - variable_value[value.used] = 0; - - return private_f_environment_set(name.string, variable_value, replace); + return F_status_set_error(F_failure); } - char variable_name[name.used + 1]; - - memcpy(&variable_name, name.string, name.used); - variable_name[name.used] = 0; - - if (value.used > 0 && !value.string[value.used - 1]) { - return private_f_environment_set(variable_name, value.string, replace); - } - - char variable_value[value.used + 1]; - - if (value.used > 0) { - memcpy(&variable_value, value.string, value.used); - } - - variable_value[value.used] = 0; - - return private_f_environment_set(variable_name, variable_value, replace); + return F_none; } -#endif // _di_f_environment_set_dynamic_ +#endif // _di_f_environment_set_ #ifndef _di_f_environment_unset_ - f_status_t f_environment_unset(const f_string_t name) { - return private_f_environment_unset(name); - } -#endif // _di_f_environment_unset_ + f_status_t f_environment_unset(const f_string_static_t name) { -#ifndef _di_f_environment_unset_ - f_status_t f_environment_unset_dynamic(const f_string_static_t name) { - #ifndef _di_level_0_parameter_checking_ - if (name.used > name.size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!name.used) return F_data_not; - - if (!name.string[name.used - 1]) { - return private_f_environment_unset(name.string); + if (!name.used) { + return F_data_not; } - char variable_name[name.used + 1]; + if (unsetenv(name.string) < 0) { + if (errno == EINVAL) return F_status_set_error(F_valid_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_not); - memcpy(&variable_name, name.string, name.used); - variable_name[name.used] = 0; + return F_status_set_error(F_failure); + } - return private_f_environment_unset(variable_name); + return F_none; } #endif // _di_f_environment_unset_ diff --git a/level_0/f_environment/c/environment.h b/level_0/f_environment/c/environment.h index 33e08da..6233eb3 100644 --- a/level_0/f_environment/c/environment.h +++ b/level_0/f_environment/c/environment.h @@ -55,15 +55,14 @@ extern "C" { * The value will be appended (set value->used to 0 to replace). * * @return + * F_data_not if name.used is 0. * F_true on success and environment variable exists. * F_false on success and environment variable does not exist. * - * F_parameter (with error bit) if a parameter is invalid. - * * @see getenv() */ #ifndef _di_f_environment_exists_ - extern f_status_t f_environment_exists(const f_string_t name); + extern f_status_t f_environment_exists(const f_string_static_t name); #endif // _di_f_environment_exists_ /** @@ -82,48 +81,22 @@ extern "C" { * * @return * F_none on success. + * F_data_not if name.used is 0. * F_exist_not if name does not exist. * - * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. + * + * Errors (with error bit) from: f_string_dynamic_increase_by(). * * @see getenv() + * + * @see f_string_dynamic_increase_by() */ #ifndef _di_f_environment_get_ - extern f_status_t f_environment_get(const f_string_t name, f_string_dynamic_t *value); + extern f_status_t f_environment_get(const f_string_static_t name, f_string_dynamic_t *value); #endif // _di_f_environment_get_ /** - * Get a single environment variable. - * - * The variable is copied into a new dynamically allocated string and is safe to alter. - * - * @param name - * The name of the environment variable to get. - * The name string must not contain the '=' character. - * The name need not be NULL terminated. - * @param value - * The value associated with name. - * The value will not be null terminated. - * The value will be appended (set value->used to 0 to replace). - * - * @return - * F_none on success. - * F_data_not if name.used is 0. - * F_exist_not if name does not exist. - * - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. - * - * @see getenv() - */ -#ifndef _di_f_environment_get_dynamic_ - extern f_status_t f_environment_get_dynamic(const f_string_static_t name, f_string_dynamic_t *value); -#endif // _di_f_environment_get_dynamic_ - -/** * Assign the given value to the named environment variable. * * If the name does not exist, then it is created. @@ -141,49 +114,19 @@ extern "C" { * * @return * F_none on success. + * F_data_not if name.used is 0. * - * F_valid_not (with error bit) if name is an invalid string. * F_memory_not (with error bit) on out of memory. + * F_valid_not (with error bit) if name is an invalid string. * F_failure (with error bit) on any other error. * * @see setenv() */ #ifndef _di_f_environment_set_ - extern f_status_t f_environment_set(const f_string_t name, const f_string_t value, const bool replace); + extern f_status_t f_environment_set(const f_string_static_t name, const f_string_static_t value, const bool replace); #endif // _di_f_environment_set_ /** - * Assign the given value to the named environment variable. - * - * If the name does not exist, then it is created. - * - * @param name - * The name of the environment variable to set. - * The name string must not contain the '=' character. - * The name need not be NULL terminated. - * @param value - * The value to assign to name. - * The value need not be NULL terminated. - * @param replace - * Set to TRUE to replace value if name already exists. - * Set to FALSE to not replace value if name already exists. - * - * @return - * F_none on success. - * F_data_not if name.used is 0. - * - * F_valid_not (with error bit) if name is an invalid string. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_failure (with error bit) on any other error. - * - * @see setenv() - */ -#ifndef _di_f_environment_set_dynamic_ - extern f_status_t f_environment_set_dynamic(const f_string_static_t name, const f_string_static_t value, const bool replace); -#endif // _di_f_environment_set_dynamic_ - -/** * Remove the name environment variable. * * @param name @@ -193,39 +136,18 @@ extern "C" { * * @return * F_none on success. + * F_data_not if name.used is 0. * - * F_valid_not (with error bit) if name is an invalid string. * F_memory_not (with error bit) on out of memory. + * F_valid_not (with error bit) if name is an invalid string. * F_failure (with error bit) on any other error. * * @see unsetenv() */ #ifndef _di_f_environment_unset_ - extern f_status_t f_environment_unset(const f_string_t name); + extern f_status_t f_environment_unset(const f_string_static_t name); #endif // _di_f_environment_unset_ -/** - * Remove the name environment variable. - * - * @param name - * The name of the environment variable to remove. - * The name string must not contain the '=' character. - * The name need not be NULL terminated. - * - * @return - * F_none on success. - * - * F_valid_not (with error bit) if name is an invalid string. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_failure (with error bit) on any other error. - * - * @see unsetenv() - */ -#ifndef _di_f_environment_unset_dynamic_ - extern f_status_t f_environment_unset_dynamic(const f_string_static_t name); -#endif // _di_f_environment_unset_dynamic_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_environment/c/private-environment.c b/level_0/f_environment/c/private-environment.c index 23b6d18..7709591 100644 --- a/level_0/f_environment/c/private-environment.c +++ b/level_0/f_environment/c/private-environment.c @@ -5,75 +5,6 @@ extern "C" { #endif -#if !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) - f_status_t private_f_environment_get(const f_string_t name, f_string_dynamic_t *value) { - const f_string_t result = getenv(name); - - if (!result) { - return F_exist_not; - } - - const f_array_length_t size = strnlen(result, f_environment_max_length); - - if (size) { - if (value->used + size > f_environment_max_length) { - return F_status_set_error(F_string_too_large); - } - - if (value->used + size > value->size) { - f_status_t status = F_none; - - macro_f_string_dynamic_t_resize(status, (*value), size); - if (F_status_is_error(status)) return status; - } - - memcpy(value->string + value->used, result, value->used + size); - value->used = size; - } - else { - value->used = 0; - } - - return F_none; - } -#endif // !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) - -#if !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) - f_status_t private_f_environment_set(const f_string_t name, const f_string_t value, const bool replace) { - - if (setenv(name, value, replace) < 0) { - if (errno == EINVAL) { - return F_status_set_error(F_valid_not); - } - else if (errno == ENOMEM) { - return F_status_set_error(F_memory_not); - } - - return F_status_set_error(F_failure); - } - - return F_none; - } -#endif // !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) - -#if !defined(_di_f_environment_unset_) || !defined(_di_f_environment_unset_dynamic_) - f_status_t private_f_environment_unset(const f_string_t name) { - - if (unsetenv(name) < 0) { - if (errno == EINVAL) { - return F_status_set_error(F_valid_not); - } - else if (errno == ENOMEM) { - return F_status_set_error(F_memory_not); - } - - return F_status_set_error(F_failure); - } - - return F_none; - } -#endif // !defined(_di_f_environment_unset_) || !defined(_di_f_environment_unset_dynamic_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_environment/c/private-environment.h b/level_0/f_environment/c/private-environment.h index 217d706..ccdbe1b 100644 --- a/level_0/f_environment/c/private-environment.h +++ b/level_0/f_environment/c/private-environment.h @@ -14,83 +14,6 @@ extern "C" { #endif -/** - * Get a single environment variable. - * - * The variable is copied into a new dynamically allocated string and is safe to alter. - * - * @param name - * The name of the environment variable to get. - * The name string must not contain the '=' character. - * The name must be NULL terminated. - * @param value - * The value associated with name. - * The value will not be null terminated. - * The value will be appended (set value->used to 0 to replace). - * - * @return - * F_none on success. - * F_exist_not if name does not exist. - * - * F_memory_not (with error bit) on out of memory. - * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. - * - * @see f_environment_get() - * @see f_environment_get_dynamic() - */ -#if !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) - extern f_status_t private_f_environment_get(const f_string_t name, f_string_dynamic_t *value) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) - -/** - * Assign the given value to the named environment variable. - * - * If the name does not exist, then it is created. - * - * @param name - * The name of the environment variable to set. - * The name string must not contain the '=' character. - * @param value - * The value to assign to name. - * @param replace - * Set to TRUE to replace value if name already exists. - * Set to FALSE to not replace value if name already exists. - * - * @return - * F_none on success. - * - * F_valid_not (with error bit) if name is an invalid string. - * F_memory_not (with error bit) on out of memory. - * F_failure (with error bit) on any other error. - * - * @see f_environment_set() - * @see f_environment_set_dynamic() - */ -#if !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) - extern f_status_t private_f_environment_set(const f_string_t name, const f_string_t value, const bool replace) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) - -/** - * Remove the name environment variable. - * - * @param name - * The name of the environment variable to remove. - * The name string must not contain the '=' character. - * - * @return - * F_none on success. - * - * F_valid_not (with error bit) if name is an invalid string. - * F_memory_not (with error bit) on out of memory. - * F_failure (with error bit) on any other error. - * - * @see f_environment_unset() - * @see f_environment_unset_dynamic() - */ -#if !defined(_di_f_environment_unset_) || !defined(_di_f_environment_unset_dynamic_) - extern f_status_t private_f_environment_unset(const f_string_t name) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_environment_unset_) || !defined(_di_f_environment_unset_dynamic_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_file/c/file-common.c b/level_0/f_file/c/file-common.c index 6d38df6..4a93fc5 100644 --- a/level_0/f_file/c/file-common.c +++ b/level_0/f_file/c/file-common.c @@ -6,22 +6,50 @@ extern "C" { #endif #ifndef _di_f_file_type_ - const f_string_static_t f_file_type_name_block_s = macro_f_string_static_t_initialize2(F_file_type_name_block_s, 0, F_file_type_name_block_s_length); - const f_string_static_t f_file_type_name_character_s = macro_f_string_static_t_initialize2(F_file_type_name_character_s, 0, F_file_type_name_character_s_length); - const f_string_static_t f_file_type_name_directory_s = macro_f_string_static_t_initialize2(F_file_type_name_directory_s, 0, F_file_type_name_directory_s_length); - const f_string_static_t f_file_type_name_fifo_s = macro_f_string_static_t_initialize2(F_file_type_name_fifo_s, 0, F_file_type_name_fifo_s_length); - const f_string_static_t f_file_type_name_link_s = macro_f_string_static_t_initialize2(F_file_type_name_link_s, 0, F_file_type_name_link_s_length); - const f_string_static_t f_file_type_name_regular_s = macro_f_string_static_t_initialize2(F_file_type_name_regular_s, 0, F_file_type_name_regular_s_length); - const f_string_static_t f_file_type_name_socket_s = macro_f_string_static_t_initialize2(F_file_type_name_socket_s, 0, F_file_type_name_socket_s_length); + const f_string_static_t f_file_type_name_block_s = macro_f_string_static_t_initialize(F_file_type_name_block_s, 0, F_file_type_name_block_s_length); + const f_string_static_t f_file_type_name_character_s = macro_f_string_static_t_initialize(F_file_type_name_character_s, 0, F_file_type_name_character_s_length); + const f_string_static_t f_file_type_name_directory_s = macro_f_string_static_t_initialize(F_file_type_name_directory_s, 0, F_file_type_name_directory_s_length); + const f_string_static_t f_file_type_name_fifo_s = macro_f_string_static_t_initialize(F_file_type_name_fifo_s, 0, F_file_type_name_fifo_s_length); + const f_string_static_t f_file_type_name_link_s = macro_f_string_static_t_initialize(F_file_type_name_link_s, 0, F_file_type_name_link_s_length); + const f_string_static_t f_file_type_name_regular_s = macro_f_string_static_t_initialize(F_file_type_name_regular_s, 0, F_file_type_name_regular_s_length); + const f_string_static_t f_file_type_name_socket_s = macro_f_string_static_t_initialize(F_file_type_name_socket_s, 0, F_file_type_name_socket_s_length); - const f_string_static_t f_file_open_mode_append_s = macro_f_string_static_t_initialize2(F_file_open_mode_append_s, 0, F_file_open_mode_append_s_length); - const f_string_static_t f_file_open_mode_read_s = macro_f_string_static_t_initialize2(F_file_open_mode_read_s, 0, F_file_open_mode_read_s_length); - const f_string_static_t f_file_open_mode_read_append_s = macro_f_string_static_t_initialize2(F_file_open_mode_read_append_s, 0, F_file_open_mode_read_append_s_length); - const f_string_static_t f_file_open_mode_read_truncate_s = macro_f_string_static_t_initialize2(F_file_open_mode_read_truncate_s, 0, F_file_open_mode_read_truncate_s_length); - const f_string_static_t f_file_open_mode_read_write_s = macro_f_string_static_t_initialize2(F_file_open_mode_read_write_s, 0, F_file_open_mode_read_write_s_length); - const f_string_static_t f_file_open_mode_truncate_s = macro_f_string_static_t_initialize2(F_file_open_mode_truncate_s, 0, F_file_open_mode_truncate_s_length); + const f_string_static_t f_file_open_mode_append_s = macro_f_string_static_t_initialize(F_file_open_mode_append_s, 0, F_file_open_mode_append_s_length); + const f_string_static_t f_file_open_mode_read_s = macro_f_string_static_t_initialize(F_file_open_mode_read_s, 0, F_file_open_mode_read_s_length); + const f_string_static_t f_file_open_mode_read_append_s = macro_f_string_static_t_initialize(F_file_open_mode_read_append_s, 0, F_file_open_mode_read_append_s_length); + const f_string_static_t f_file_open_mode_read_truncate_s = macro_f_string_static_t_initialize(F_file_open_mode_read_truncate_s, 0, F_file_open_mode_read_truncate_s_length); + const f_string_static_t f_file_open_mode_read_write_s = macro_f_string_static_t_initialize(F_file_open_mode_read_write_s, 0, F_file_open_mode_read_write_s_length); + const f_string_static_t f_file_open_mode_truncate_s = macro_f_string_static_t_initialize(F_file_open_mode_truncate_s, 0, F_file_open_mode_truncate_s_length); #endif // _di_f_file_type_ +#ifndef _di_f_file_operation_strings_ + const f_string_static_t f_file_operation_append_s = macro_f_string_static_t_initialize(F_file_operation_append_s, 0, F_file_operation_append_s_length); + const f_string_static_t f_file_operation_clone_s = macro_f_string_static_t_initialize(F_file_operation_clone_s, 0, F_file_operation_clone_s_length); + const f_string_static_t f_file_operation_close_s = macro_f_string_static_t_initialize(F_file_operation_close_s, 0, F_file_operation_close_s_length); + const f_string_static_t f_file_operation_concatenate_s = macro_f_string_static_t_initialize(F_file_operation_concatenate_s, 0, F_file_operation_concatenate_s_length); + const f_string_static_t f_file_operation_connect_s = macro_f_string_static_t_initialize(F_file_operation_connect_s, 0, F_file_operation_connect_s_length); + const f_string_static_t f_file_operation_copy_s = macro_f_string_static_t_initialize(F_file_operation_copy_s, 0, F_file_operation_copy_s_length); + const f_string_static_t f_file_operation_create_s = macro_f_string_static_t_initialize(F_file_operation_create_s, 0, F_file_operation_create_s_length); + const f_string_static_t f_file_operation_delete_s = macro_f_string_static_t_initialize(F_file_operation_delete_s, 0, F_file_operation_delete_s_length); + const f_string_static_t f_file_operation_disconnect_s = macro_f_string_static_t_initialize(F_file_operation_disconnect_s, 0, F_file_operation_disconnect_s_length); + const f_string_static_t f_file_operation_find_s = macro_f_string_static_t_initialize(F_file_operation_find_s, 0, F_file_operation_find_s_length); + const f_string_static_t f_file_operation_from_s = macro_f_string_static_t_initialize(F_file_operation_from_s, 0, F_file_operation_from_s_length); + const f_string_static_t f_file_operation_flush_s = macro_f_string_static_t_initialize(F_file_operation_flush_s, 0, F_file_operation_flush_s_length); + const f_string_static_t f_file_operation_link_s = macro_f_string_static_t_initialize(F_file_operation_link_s, 0, F_file_operation_link_s_length); + const f_string_static_t f_file_operation_list_s = macro_f_string_static_t_initialize(F_file_operation_list_s, 0, F_file_operation_list_s_length); + const f_string_static_t f_file_operation_open_s = macro_f_string_static_t_initialize(F_file_operation_open_s, 0, F_file_operation_open_s_length); + const f_string_static_t f_file_operation_process_s = macro_f_string_static_t_initialize(F_file_operation_process_s, 0, F_file_operation_process_s_length); + const f_string_static_t f_file_operation_read_s = macro_f_string_static_t_initialize(F_file_operation_read_s, 0, F_file_operation_read_s_length); + const f_string_static_t f_file_operation_receive_s = macro_f_string_static_t_initialize(F_file_operation_receive_s, 0, F_file_operation_receive_s_length); + const f_string_static_t f_file_operation_send_s = macro_f_string_static_t_initialize(F_file_operation_send_s, 0, F_file_operation_send_s_length); + const f_string_static_t f_file_operation_to_s = macro_f_string_static_t_initialize(F_file_operation_to_s, 0, F_file_operation_to_s_length); + const f_string_static_t f_file_operation_truncate_s = macro_f_string_static_t_initialize(F_file_operation_truncate_s, 0, F_file_operation_truncate_s_length); + const f_string_static_t f_file_operation_unlink_s = macro_f_string_static_t_initialize(F_file_operation_unlink_s, 0, F_file_operation_unlink_s_length); + const f_string_static_t f_file_operation_verify_s = macro_f_string_static_t_initialize(F_file_operation_verify_s, 0, F_file_operation_verify_s_length); + const f_string_static_t f_file_operation_wipe_s = macro_f_string_static_t_initialize(F_file_operation_wipe_s, 0, F_file_operation_wipe_s_length); + const f_string_static_t f_file_operation_write_s = macro_f_string_static_t_initialize(F_file_operation_write_s, 0, F_file_operation_write_s_length); +#endif // _di_f_file_operation_strings_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_file/c/file-common.h b/level_0/f_file/c/file-common.h index e5bae4b..d11b6e7 100644 --- a/level_0/f_file/c/file-common.h +++ b/level_0/f_file/c/file-common.h @@ -380,6 +380,116 @@ extern "C" { #define F_file_mode_user_protected_d (F_file_mode_owner_r_d | F_file_mode_group_r_d) #endif // _di_f_file_mode_ +/** + * Provide common file operation strings. + * + * F_file_operation_*: + * - append: Append to a file. + * - clone: Clone a file. + * - close: Close a file. + * - concatenate: Concatenate a file. + * - connect: Connect to a file (such as a socket file). + * - copy: Copy a file. + * - create: Create a file. + * - delete: Delete a file. + * - disconnect: Disconnect from a file (such as a socket file). + * - find: Find a file. + * - from: Do something from a file. + * - flush: Flush a file. + * - link: Link a file. + * - list: List a file. + * - open: Open a file. + * - process: Process a file. + * - read: Read a file. + * - receive: Receive a file. + * - send: Send a file. + * - to: Do someting to a file. + * - truncate: Truncate a file. + * - unlink: Unlink a file. + * - verify: Verify a file. + * - wipe: Wipe a file. + * - write: Write a file. + */ +#ifndef _di_f_file_operation_strings_ + #define F_file_operation_append_s "append" + #define F_file_operation_clone_s "clone" + #define F_file_operation_close_s "close" + #define F_file_operation_concatenate_s "concatenate" + #define F_file_operation_connect_s "connect" + #define F_file_operation_copy_s "copy" + #define F_file_operation_create_s "create" + #define F_file_operation_delete_s "delete" + #define F_file_operation_disconnect_s "disconnect" + #define F_file_operation_find_s "find" + #define F_file_operation_from_s "from" + #define F_file_operation_flush_s "flush" + #define F_file_operation_link_s "link" + #define F_file_operation_list_s "list" + #define F_file_operation_open_s "open" + #define F_file_operation_process_s "process" + #define F_file_operation_read_s "read" + #define F_file_operation_receive_s "receive" + #define F_file_operation_send_s "send" + #define F_file_operation_to_s "to" + #define F_file_operation_truncate_s "truncate" + #define F_file_operation_unlink_s "unlink" + #define F_file_operation_verify_s "verify" + #define F_file_operation_wipe_s "wipe" + #define F_file_operation_write_s "write" + + #define F_file_operation_append_s_length 6 + #define F_file_operation_clone_s_length 5 + #define F_file_operation_close_s_length 5 + #define F_file_operation_concatenate_s_length 11 + #define F_file_operation_connect_s_length 7 + #define F_file_operation_copy_s_length 4 + #define F_file_operation_create_s_length 6 + #define F_file_operation_delete_s_length 6 + #define F_file_operation_disconnect_s_length 10 + #define F_file_operation_find_s_length 4 + #define F_file_operation_from_s_length 4 + #define F_file_operation_flush_s_length 5 + #define F_file_operation_link_s_length 4 + #define F_file_operation_list_s_length 4 + #define F_file_operation_open_s_length 4 + #define F_file_operation_process_s_length 7 + #define F_file_operation_read_s_length 4 + #define F_file_operation_receive_s_length 7 + #define F_file_operation_send_s_length 4 + #define F_file_operation_to_s_length 2 + #define F_file_operation_truncate_s_length 8 + #define F_file_operation_unlink_s_length 6 + #define F_file_operation_verify_s_length 6 + #define F_file_operation_wipe_s_length 4 + #define F_file_operation_write_s_length 5 + + extern const f_string_static_t f_file_operation_append_s; + extern const f_string_static_t f_file_operation_clone_s; + extern const f_string_static_t f_file_operation_close_s; + extern const f_string_static_t f_file_operation_concatenate_s; + extern const f_string_static_t f_file_operation_connect_s; + extern const f_string_static_t f_file_operation_copy_s; + extern const f_string_static_t f_file_operation_create_s; + extern const f_string_static_t f_file_operation_delete_s; + extern const f_string_static_t f_file_operation_disconnect_s; + extern const f_string_static_t f_file_operation_find_s; + extern const f_string_static_t f_file_operation_from_s; + extern const f_string_static_t f_file_operation_flush_s; + extern const f_string_static_t f_file_operation_link_s; + extern const f_string_static_t f_file_operation_list_s; + extern const f_string_static_t f_file_operation_open_s; + extern const f_string_static_t f_file_operation_process_s; + extern const f_string_static_t f_file_operation_read_s; + extern const f_string_static_t f_file_operation_receive_s; + extern const f_string_static_t f_file_operation_send_s; + extern const f_string_static_t f_file_operation_to_s; + extern const f_string_static_t f_file_operation_truncate_s; + extern const f_string_static_t f_file_operation_unlink_s; + extern const f_string_static_t f_file_operation_verify_s; + extern const f_string_static_t f_file_operation_wipe_s; + extern const f_string_static_t f_file_operation_write_s; +#endif // _di_f_file_operation_strings_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index df98b84..4d23522 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -6,12 +6,13 @@ extern "C" { #endif #ifndef _di_f_file_access_ - f_status_t f_file_access(const f_string_t path) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_access(const f_string_static_t path) { + + if (!path.used) { + return F_data_not; + } - if (access(path, F_OK)) { + if (access(path.string, F_OK)) { if (errno == ENOENT) return F_false; if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -29,11 +30,11 @@ extern "C" { #endif // _di_f_file_access_ #ifndef _di_f_file_clone_ - f_status_t f_file_clone(const f_string_t source, const f_string_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive) { - #ifndef _di_level_0_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_clone(const f_string_static_t source, const f_string_static_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive) { + + if (!source.used || !destination.used) { + return F_data_not; + } f_status_t status = F_none; struct stat source_stat; @@ -62,6 +63,7 @@ extern "C" { if (macro_f_file_type_is_link(source_stat.st_mode)) { status = private_f_file_link(destination, source); + if (F_status_set_fine(status) == F_file_found) { if (exclusive) return status; } @@ -105,11 +107,11 @@ extern "C" { #endif // _di_f_file_close_flush_ #ifndef _di_f_file_copy_ - f_status_t f_file_copy(const f_string_t source, const f_string_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive) { - #ifndef _di_level_0_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_copy(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive) { + + if (!source.used || !destination.used) { + return F_data_not; + } f_status_t status = F_none; struct stat source_stat; @@ -157,7 +159,7 @@ extern "C" { return status; } - status = private_f_file_link(target.string, destination); + status = private_f_file_link(target, destination); f_string_dynamic_resize(0, &target); @@ -220,30 +222,33 @@ extern "C" { #endif // _di_f_file_copy_ #ifndef _di_f_file_create_ - f_status_t f_file_create(const f_string_t path, const mode_t mode, const bool exclusive) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_create(const f_string_static_t path, const mode_t mode, const bool exclusive) { + + if (!path.used) { + return F_data_not; + } return private_f_file_create(path, mode, exclusive); } #endif // _di_f_file_create_ #ifndef _di_f_file_create_at_ - f_status_t f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_create_at(const int at_id, const f_string_static_t path, const mode_t mode, const bool exclusive) { + + if (!path.used) { + return F_data_not; + } return private_f_file_create_at(at_id, path, mode, exclusive); } #endif // _di_f_file_create_at_ #ifndef _di_f_file_create_device_ - f_status_t f_file_create_device(const f_string_t path, const mode_t mode, const unsigned int major, const unsigned int minor) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_create_device(const f_string_static_t path, const mode_t mode, const unsigned int major, const unsigned int minor) { + + if (!path.used) { + return F_data_not; + } if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) { return F_status_set_error(F_supported_not); @@ -256,10 +261,11 @@ extern "C" { #endif // _di_f_file_create_device_ #ifndef _di_f_file_create_device_at_ - f_status_t f_file_create_device_at(const int at_id, const f_string_t path, const mode_t mode, const unsigned int major, const unsigned int minor) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_create_device_at(const int at_id, const f_string_static_t path, const mode_t mode, const unsigned int major, const unsigned int minor) { + + if (!path.used) { + return F_data_not; + } if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) { return F_status_set_error(F_supported_not); @@ -272,30 +278,33 @@ extern "C" { #endif // _di_f_file_create_device_at_ #ifndef _di_f_file_create_fifo_ - f_status_t f_file_create_fifo(const f_string_t path, const mode_t mode) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_create_fifo(const f_string_static_t path, const mode_t mode) { + + if (!path.used) { + return F_data_not; + } return private_f_file_create_fifo(path, mode); } #endif // _di_f_file_create_fifo_ #ifndef _di_f_file_create_fifo_at_ - f_status_t f_file_create_fifo_at(const int at_id, const f_string_t path, const mode_t mode) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_create_fifo_at(const int at_id, const f_string_static_t path, const mode_t mode) { + + if (!path.used) { + return F_data_not; + } return private_f_file_create_fifo_at(at_id, path, mode); } #endif // _di_f_file_create_fifo_at_ #ifndef _di_f_file_create_node_ - f_status_t f_file_create_node(const f_string_t path, const mode_t mode, const dev_t device) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_create_node(const f_string_static_t path, const mode_t mode, const dev_t device) { + + if (!path.used) { + return F_data_not; + } if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) { return F_status_set_error(F_supported_not); @@ -306,10 +315,11 @@ extern "C" { #endif // _di_f_file_create_node_ #ifndef _di_f_file_create_node_at_ - f_status_t f_file_create_node_at(const int at_id, const f_string_t path, const mode_t mode, const dev_t device) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_create_node_at(const int at_id, const f_string_static_t path, const mode_t mode, const dev_t device) { + + if (!path.used) { + return F_data_not; + } if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) { return F_status_set_error(F_supported_not); @@ -321,9 +331,6 @@ extern "C" { #ifndef _di_f_file_descriptor_ f_status_t f_file_descriptor(f_file_t *file) { - #ifndef _di_level_0_parameter_checking_ - if (!file) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ file->id = fileno(file->stream); @@ -336,10 +343,11 @@ extern "C" { #endif // _di_f_file_descriptor_ #ifndef _di_f_file_exists_ - f_status_t f_file_exists(const f_string_t path) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_exists(const f_string_static_t path) { + + if (!path.used) { + return F_data_not; + } struct stat stat_file; @@ -360,10 +368,11 @@ extern "C" { #endif // _di_f_file_exists_ #ifndef _di_f_file_exists_at_ - f_status_t f_file_exists_at(const int at_id, const f_string_t path, const int flag) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_exists_at(const int at_id, const f_string_static_t path, const int flag) { + + if (!path.used) { + return F_data_not; + } struct stat stat_file; @@ -385,17 +394,21 @@ extern "C" { #ifndef _di_f_file_flush_ f_status_t f_file_flush(const int id) { + return private_f_file_flush(id); } #endif // _di_f_file_flush_ #ifndef _di_f_file_group_read_ - f_status_t f_file_group_read(const f_string_t path, gid_t *group) { + f_status_t f_file_group_read(const f_string_static_t path, gid_t *group) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!group) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + struct stat stat_file; memset(&stat_file, 0, sizeof(struct stat)); @@ -412,10 +425,11 @@ extern "C" { #endif // _di_f_file_group_read_ #ifndef _di_f_file_is_ - f_status_t f_file_is(const f_string_t path, const int type, const bool dereference) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_is(const f_string_static_t path, const int type, const bool dereference) { + + if (!path.used) { + return F_data_not; + } struct stat stat_file; @@ -435,16 +449,17 @@ extern "C" { #endif // _di_f_file_is_ #ifndef _di_f_file_is_at_ - f_status_t f_file_is_at(const int at_id, const f_string_t path, const int type, const int flag) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_is_at(const int at_id, const f_string_static_t path, const int type, const int flag) { + + if (!path.used) { + return F_data_not; + } struct stat stat_file; memset(&stat_file, 0, sizeof(struct stat)); - if (fstatat(at_id, path, &stat_file, flag) < 0) { + if (fstatat(at_id, path.string, &stat_file, flag) < 0) { if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == ENOMEM) return F_status_set_error(F_memory_not); @@ -467,35 +482,35 @@ extern "C" { #endif // _di_f_file_is_at_ #ifndef _di_f_file_link_ - f_status_t f_file_link(const f_string_t target, const f_string_t point) { - #ifndef _di_level_0_parameter_checking_ - if (!target) return F_status_set_error(F_parameter); - if (!point) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_link(const f_string_static_t target, const f_string_static_t point) { + + if (!target.used || !point.used) { + return F_data_not; + } return private_f_file_link(target, point); } #endif // _di_f_file_link_ #ifndef _di_f_file_link_at_ - f_status_t f_file_link_at(const int at_id, const f_string_t target, const f_string_t point) { - #ifndef _di_level_0_parameter_checking_ - if (!target) return F_status_set_error(F_parameter); - if (!point) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_link_at(const int at_id, const f_string_static_t target, const f_string_static_t point) { + + if (!target.used || !point.used) { + return F_data_not; + } return private_f_file_link_at(at_id, target, point); } #endif // _di_f_file_link_at_ #ifndef _di_f_file_link_hard_ - f_status_t f_file_link_hard(const f_string_t target, const f_string_t point) { - #ifndef _di_level_0_parameter_checking_ - if (!target) return F_status_set_error(F_parameter); - if (!point) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_link_hard(const f_string_static_t target, const f_string_static_t point) { + + if (!target.used || !point.used) { + return F_data_not; + } - if (link(target, point) < 0) { + if (link(target.string, point.string) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -521,13 +536,9 @@ extern "C" { #endif // _di_f_file_link_hard_ #ifndef _di_f_file_link_hard_at_ - f_status_t f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string_t target, const f_string_t point, const int flag) { - #ifndef _di_level_0_parameter_checking_ - if (!target) return F_status_set_error(F_parameter); - if (!point) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string_static_t target, const f_string_static_t point, const int flag) { - if (linkat(at_id_target, target, at_id_point, point, flag) < 0) { + if (linkat(at_id_target, target.string, at_id_point, point.string, flag) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -554,24 +565,31 @@ extern "C" { #endif // _di_f_file_link_hard_at_ #ifndef _di_f_file_link_read_ - f_status_t f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) { + f_status_t f_file_link_read(const f_string_static_t path, const struct stat link_stat, f_string_dynamic_t *target) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!link_stat.st_size) return F_status_set_error(F_parameter); if (!target) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_file_link_read(path, link_stat, target); } #endif // _di_f_file_link_read_ #ifndef _di_f_file_link_read_at_ - f_status_t f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) { + f_status_t f_file_link_read_at(const int at_id, const f_string_static_t path, const struct stat link_stat, f_string_dynamic_t *target) { #ifndef _di_level_0_parameter_checking_ if (!link_stat.st_size) return F_status_set_error(F_parameter); if (!target) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_file_link_read_at(at_id, path, link_stat, target); } #endif // _di_f_file_link_read_at_ @@ -880,33 +898,35 @@ extern "C" { #endif // _di_f_file_mode_determine_ #ifndef _di_f_file_mode_from_string_ - f_status_t f_file_mode_from_string(const f_string_t string, const mode_t umask, f_file_mode_t *mode, uint8_t *replace) { + f_status_t f_file_mode_from_string(const f_string_static_t code, const mode_t umask, f_file_mode_t *mode, uint8_t *replace) { #ifndef _di_level_0_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); - if (!string[0]) return F_status_set_error(F_parameter); if (!mode) return F_status_set_error(F_parameter); if (!replace) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!code.used) { + return F_data_not; + } + uint8_t syntax = 0; uint8_t replace_result = 0; f_file_mode_t mode_result = 0; - if (string[0] == f_string_ascii_plus_s.string[0] || string[0] == f_string_ascii_minus_s.string[0] || string[0] == f_string_ascii_equal_s.string[0]) { - if (string[1] == f_string_ascii_r_s.string[0] || f_string_ascii_w_s.string[0] || f_string_ascii_x_s.string[0] || f_string_ascii_X_s.string[0] || f_string_ascii_s_s.string[0] ||f_string_ascii_t_s.string[0]) { + if (code.string[0] == f_string_ascii_plus_s.string[0] || code.string[0] == f_string_ascii_minus_s.string[0] || code.string[0] == f_string_ascii_equal_s.string[0]) { + if (code.string[1] == f_string_ascii_r_s.string[0] || f_string_ascii_w_s.string[0] || f_string_ascii_x_s.string[0] || f_string_ascii_X_s.string[0] || f_string_ascii_s_s.string[0] ||f_string_ascii_t_s.string[0]) { syntax = 1; } - else if (string[1] == f_string_ascii_0_s.string[0] || string[1] == f_string_ascii_1_s.string[0] || string[1] == f_string_ascii_2_s.string[0] || string[1] == f_string_ascii_3_s.string[0] || string[1] == f_string_ascii_4_s.string[0] || string[1] == f_string_ascii_5_s.string[0] || string[1] == f_string_ascii_6_s.string[0] || string[1] == f_string_ascii_7_s.string[0]) { + else if (code.string[1] == f_string_ascii_0_s.string[0] || code.string[1] == f_string_ascii_1_s.string[0] || code.string[1] == f_string_ascii_2_s.string[0] || code.string[1] == f_string_ascii_3_s.string[0] || code.string[1] == f_string_ascii_4_s.string[0] || code.string[1] == f_string_ascii_5_s.string[0] || code.string[1] == f_string_ascii_6_s.string[0] || code.string[1] == f_string_ascii_7_s.string[0]) { syntax = 2; } else { return F_status_set_error(F_syntax); } } - else if (string[0] == f_string_ascii_u_s.string[0] || string[0] == f_string_ascii_g_s.string[0] || string[0] == f_string_ascii_o_s.string[0] || string[0] == f_string_ascii_a_s.string[0]) { + else if (code.string[0] == f_string_ascii_u_s.string[0] || code.string[0] == f_string_ascii_g_s.string[0] || code.string[0] == f_string_ascii_o_s.string[0] || code.string[0] == f_string_ascii_a_s.string[0]) { syntax = 1; } - else if (string[0] == f_string_ascii_0_s.string[0] || string[0] == f_string_ascii_1_s.string[0] || string[0] == f_string_ascii_2_s.string[0] || string[0] == f_string_ascii_3_s.string[0] || string[0] == f_string_ascii_4_s.string[0] || string[0] == f_string_ascii_5_s.string[0] || string[0] == f_string_ascii_6_s.string[0] || string[0] == f_string_ascii_7_s.string[0]) { + else if (code.string[0] == f_string_ascii_0_s.string[0] || code.string[0] == f_string_ascii_1_s.string[0] || code.string[0] == f_string_ascii_2_s.string[0] || code.string[0] == f_string_ascii_3_s.string[0] || code.string[0] == f_string_ascii_4_s.string[0] || code.string[0] == f_string_ascii_5_s.string[0] || code.string[0] == f_string_ascii_6_s.string[0] || code.string[0] == f_string_ascii_7_s.string[0]) { syntax = 2; } else { @@ -970,29 +990,29 @@ extern "C" { mode_umask |= F_file_mode_t_block_world_d & F_file_mode_t_mask_bit_execute_d; } - for (f_array_length_t i = 0; syntax && string[i]; ++i) { + for (f_array_length_t i = 0; syntax && code.string[i]; ++i) { - if (string[i] == f_string_ascii_u_s.string[0]) { + if (code.string[i] == f_string_ascii_u_s.string[0]) { on |= 1; mode_mask |= F_file_mode_t_block_owner_d; } - else if (string[i] == f_string_ascii_g_s.string[0]) { + else if (code.string[i] == f_string_ascii_g_s.string[0]) { on |= 2; mode_mask |= F_file_mode_t_block_group_d; } - else if (string[i] == f_string_ascii_o_s.string[0]) { + else if (code.string[i] == f_string_ascii_o_s.string[0]) { on |= 4; mode_mask |= F_file_mode_t_block_world_d; } - else if (string[i] == f_string_ascii_a_s.string[0]) { + else if (code.string[i] == f_string_ascii_a_s.string[0]) { on = 7; mode_mask = F_file_mode_t_block_standard_d; } - else if (string[i] == f_string_ascii_plus_s.string[0] || string[i] == f_string_ascii_minus_s.string[0] || string[i] == f_string_ascii_equal_s.string[0]) { - if (string[i] == f_string_ascii_plus_s.string[0]) { + else if (code.string[i] == f_string_ascii_plus_s.string[0] || code.string[i] == f_string_ascii_minus_s.string[0] || code.string[i] == f_string_ascii_equal_s.string[0]) { + if (code.string[i] == f_string_ascii_plus_s.string[0]) { how = on ? 1 : 4; } - else if (string[i] == f_string_ascii_minus_s.string[0]) { + else if (code.string[i] == f_string_ascii_minus_s.string[0]) { how = on ? 3 : 6; } else { @@ -1024,21 +1044,21 @@ extern "C" { what = 0; - for (++i; string[i]; ++i) { + for (++i; code.string[i]; ++i) { - if (string[i] == f_string_ascii_r_s.string[0]) { + if (code.string[i] == f_string_ascii_r_s.string[0]) { what = F_file_mode_t_mask_bit_read_d; } - else if (string[i] == f_string_ascii_w_s.string[0]) { + else if (code.string[i] == f_string_ascii_w_s.string[0]) { what = F_file_mode_t_mask_bit_write_d; } - else if (string[i] == f_string_ascii_x_s.string[0]) { + else if (code.string[i] == f_string_ascii_x_s.string[0]) { what = F_file_mode_t_mask_bit_execute_d; } - else if (string[i] == f_string_ascii_X_s.string[0]) { + else if (code.string[i] == f_string_ascii_X_s.string[0]) { what = F_file_mode_t_mask_bit_execute_only_d; } - else if (string[i] == f_string_ascii_s_s.string[0]) { + else if (code.string[i] == f_string_ascii_s_s.string[0]) { mode_mask |= F_file_mode_t_block_special_d; if (on & 1) { @@ -1051,7 +1071,7 @@ extern "C" { what = 0; } } - else if (string[i] == f_string_ascii_t_s.string[0]) { + else if (code.string[i] == f_string_ascii_t_s.string[0]) { mode_mask |= F_file_mode_t_block_special_d; if (on & 4) { @@ -1061,7 +1081,7 @@ extern "C" { what = 0; } } - else if (string[i] == f_string_ascii_comma_s.string[0]) { + else if (code.string[i] == f_string_ascii_comma_s.string[0]) { if (how > 3) { mode_result -= mode_result & mode_umask; } @@ -1072,13 +1092,13 @@ extern "C" { break; } - else if (string[i] == f_string_ascii_plus_s.string[0] || string[i] == f_string_ascii_minus_s.string[0] || string[i] == f_string_ascii_equal_s.string[0]) { + else if (code.string[i] == f_string_ascii_plus_s.string[0] || code.string[i] == f_string_ascii_minus_s.string[0] || code.string[i] == f_string_ascii_equal_s.string[0]) { what = 0; - if (string[i] == f_string_ascii_plus_s.string[0]) { + if (code.string[i] == f_string_ascii_plus_s.string[0]) { how = on ? 1 : 4; } - else if (string[i] == f_string_ascii_minus_s.string[0]) { + else if (code.string[i] == f_string_ascii_minus_s.string[0]) { how = on ? 3 : 6; } else { @@ -1131,7 +1151,7 @@ extern "C" { mode_result -= mode_result & mode_umask; } - if (!string[i]) break; + if (!code.string[i]) break; } else { syntax = 0; @@ -1149,15 +1169,15 @@ extern "C" { f_array_length_t i = 0; f_array_length_t j = 0; - if (string[0] == f_string_ascii_plus_s.string[0]) { + if (code.string[0] == f_string_ascii_plus_s.string[0]) { how = 1; i = 1; } - else if (string[0] == f_string_ascii_minus_s.string[0]) { + else if (code.string[0] == f_string_ascii_minus_s.string[0]) { how = 3; i = 1; } - else if (string[0] == f_string_ascii_equal_s.string[0]) { + else if (code.string[0] == f_string_ascii_equal_s.string[0]) { how = 2; i = 1; @@ -1170,30 +1190,30 @@ extern "C" { } // Seek past leading '0's. - while (string[i] == f_string_ascii_0_s.string[0]) { + while (code.string[i] == f_string_ascii_0_s.string[0]) { ++i; } // while - if (string[i]) { + if (code.string[i]) { f_array_length_t j = 0; - for (; string[i + j] && j < 4; ++j) { + for (; code.string[i + j] && j < 4; ++j) { if (j) { mode_result <<= 8; } - if (string[i] == f_string_ascii_0_s.string[0]) { + if (code.string[i] == f_string_ascii_0_s.string[0]) { // Already is a zero. } - else if (string[i] == f_string_ascii_1_s.string[0] || string[i] == f_string_ascii_2_s.string[0] || string[i] == f_string_ascii_3_s.string[0] || string[i] == f_string_ascii_4_s.string[0] || string[i] == f_string_ascii_5_s.string[0] || string[i] == f_string_ascii_6_s.string[0] || string[i] == f_string_ascii_7_s.string[0]) { + else if (code.string[i] == f_string_ascii_1_s.string[0] || code.string[i] == f_string_ascii_2_s.string[0] || code.string[i] == f_string_ascii_3_s.string[0] || code.string[i] == f_string_ascii_4_s.string[0] || code.string[i] == f_string_ascii_5_s.string[0] || code.string[i] == f_string_ascii_6_s.string[0] || code.string[i] == f_string_ascii_7_s.string[0]) { // This assumes ASCII/UTF-8. if (how == 3) { - mode_result |= (string[i + j] - 0x30) << 4; + mode_result |= (code.string[i + j] - 0x30) << 4; } else { - mode_result |= string[i + j] - 0x30; + mode_result |= code.string[i + j] - 0x30; } } else { @@ -1229,12 +1249,15 @@ extern "C" { #endif // _di_f_file_mode_from_string_ #ifndef _di_f_file_mode_read_ - f_status_t f_file_mode_read(const f_string_t path, mode_t *mode) { + f_status_t f_file_mode_read(const f_string_static_t path, mode_t *mode) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!mode) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + struct stat stat_file; memset(&stat_file, 0, sizeof(struct stat)); @@ -1251,9 +1274,8 @@ extern "C" { #endif // _di_f_file_mode_read_ #ifndef _di_f_file_mode_read_at_ - f_status_t f_file_mode_read_at(const int at_id, const f_string_t path, mode_t *mode) { + f_status_t f_file_mode_read_at(const int at_id, const f_string_static_t path, mode_t *mode) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!mode) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1273,20 +1295,25 @@ extern "C" { #endif // _di_f_file_mode_read_at_ #ifndef _di_f_file_mode_set_ - f_status_t f_file_mode_set(const f_string_t path, const mode_t mode) { + f_status_t f_file_mode_set(const f_string_static_t path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); + if (!path.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_file_mode_set(path, mode); } #endif // _di_f_file_mode_set_ #ifndef _di_f_file_mode_set_at_ - f_status_t f_file_mode_set_at(const int at_id, const f_string_t path, const mode_t mode) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_mode_set_at(const int at_id, const f_string_static_t path, const mode_t mode) { + + if (!path.used) { + return F_data_not; + } return private_f_file_mode_set_at(at_id, path, mode); } @@ -1355,33 +1382,28 @@ extern "C" { #endif // _di_f_file_mode_to_mode_ #ifndef _di_f_file_name_base_ - f_status_t f_file_name_base(const f_string_t path, const f_array_length_t length, f_string_dynamic_t *name_base) { + f_status_t f_file_name_base(const f_string_static_t path, f_string_dynamic_t *name_base) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!name_base) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + // POSIX basename() modifies the path, so protect it (and add a terminating NULL). - char path_argument[length + 1]; + char path_argument[path.used + 1]; f_string_t path_to_name; - memcpy(path_argument, path, length); - path_argument[length] = 0; + memcpy(path_argument, path.string, path.used); + path_argument[path.used] = 0; path_to_name = basename(path_argument); - f_array_length_t size = strnlen(path_to_name, length); - - if (name_base->used + size > name_base->size) { - if (name_base->used + size > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - f_status_t status = F_none; + f_array_length_t size = strnlen(path_to_name, path.used); - macro_f_string_dynamic_t_resize(status, (*name_base), name_base->used + size); - if (F_status_is_error(status)) return status; - } + const f_status_t status = f_string_dynamic_increase_by(size, name_base); + if (F_status_is_error(status)) return status; memcpy(name_base->string + name_base->used, path_to_name, size); name_base->used += size; @@ -1391,31 +1413,28 @@ extern "C" { #endif // _di_f_file_name_base_ #ifndef _di_f_file_name_directory_ - f_status_t f_file_name_directory(const f_string_t path, const f_array_length_t length, f_string_dynamic_t *name_directory) { + f_status_t f_file_name_directory(const f_string_static_t path, f_string_dynamic_t *name_directory) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!name_directory) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + // POSIX dirname() modifies the path, so protect it (and add a terminating NULL). - char path_argument[length + 1]; + char path_argument[path.used + 1]; f_string_t path_to_name; - memcpy(path_argument, path, length); - path_argument[length] = 0; + memcpy(path_argument, path.string, path.used); + path_argument[path.used] = 0; path_to_name = dirname(path_argument); - f_array_length_t size = strnlen(path_to_name, length); - - if (name_directory->used + size > name_directory->size) { - if (name_directory->used + size > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - f_status_t status = F_none; + f_array_length_t size = strnlen(path_to_name, path.used); - macro_f_string_dynamic_t_resize(status, (*name_directory), name_directory->used + size); + { + const f_status_t status = f_string_dynamic_increase_by(size, name_directory); if (F_status_is_error(status)) return status; } @@ -1427,33 +1446,43 @@ extern "C" { #endif // _di_f_file_name_directory_ #ifndef _di_f_file_open_ - f_status_t f_file_open(const f_string_t path, const mode_t mode, f_file_t *file) { + f_status_t f_file_open(const f_string_static_t path, const mode_t mode, f_file_t *file) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!file) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_file_open(path, mode, file); } #endif // _di_f_file_open_ #ifndef _di_f_file_open_at_ - f_status_t f_file_open_at(const int at_id, const f_string_t path, const mode_t mode, f_file_t *file) { + f_status_t f_file_open_at(const int at_id, const f_string_static_t path, const mode_t mode, f_file_t *file) { #ifndef _di_level_0_parameter_checking_ if (!file) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_file_open_at(at_id, path, mode, file); } #endif // _di_f_file_open_at_ #ifndef _di_f_file_owner_read_ - f_status_t f_file_owner_read(const f_string_t path, uid_t *owner) { + f_status_t f_file_owner_read(const f_string_static_t path, uid_t *owner) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!owner) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + struct stat stat_file; memset(&stat_file, 0, sizeof(struct stat)); @@ -1483,20 +1512,12 @@ extern "C" { f_status_t status = F_none; ssize_t size_read = 0; - for (f_string_t buffer_read = 0; ; ) { - - if (buffer->used + file.size_read > buffer->size) { - if (buffer->size + file.size_read > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - macro_f_string_dynamic_t_resize(status, (*buffer), buffer->size + file.size_read); - if (F_status_is_error(status)) return status; - } + for (;;) { - buffer_read = buffer->string + buffer->used; + status = f_string_dynamic_increase_by(file.size_read, buffer); + if (F_status_is_error(status)) return status; - size_read = read(file.id, buffer_read, file.size_read); + size_read = read(file.id, buffer->string + buffer->used, file.size_read); if (size_read < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); @@ -1530,23 +1551,14 @@ extern "C" { return F_status_set_error(F_file_closed); } - f_status_t status = F_none; ssize_t size_read = 0; - f_string_t buffer_read = 0; - - if (buffer->used + file.size_read > buffer->size) { - if (buffer->size + file.size_read > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - macro_f_string_dynamic_t_resize(status, (*buffer), buffer->size + file.size_read); + { + const f_status_t status = f_string_dynamic_increase_by(file.size_read, buffer); if (F_status_is_error(status)) return status; } - buffer_read = buffer->string + buffer->used; - - size_read = read(file.id, buffer_read, file.size_read); + size_read = read(file.id, buffer->string + buffer->used, file.size_read); if (size_read > 0) { buffer->used += size_read; @@ -1589,24 +1601,16 @@ extern "C" { f_status_t status = F_none; ssize_t size_read = 0; - for (f_string_t buffer_read = 0; ; ) { + for (;;) { if (buffer_count + buffer_size > total) { buffer_size = total - buffer_count; } - if (buffer->used + buffer_size > buffer->size) { - if (buffer->size + buffer_size > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - macro_f_string_dynamic_t_resize(status, (*buffer), buffer->size + buffer_size); - if (F_status_is_error(status)) return status; - } - - buffer_read = buffer->string + buffer->used; + status = f_string_dynamic_increase_by(buffer_size, buffer); + if (F_status_is_error(status)) return status; - size_read = read(file.id, buffer_read, buffer_size); + size_read = read(file.id, buffer->string + buffer->used, buffer_size); if (size_read < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); @@ -1628,22 +1632,21 @@ extern "C" { buffer_count += size_read; - if (buffer_count == total) { - return F_none_stop; - } + if (buffer_count >= total) break; } // for - return F_none; + return F_none_stop; } #endif // _di_f_file_read_until_ #ifndef _di_f_file_remove_ - f_status_t f_file_remove(const f_string_t path) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_remove(const f_string_static_t path) { + + if (!path.used) { + return F_data_not; + } - if (unlink(path) < 0) { + if (unlink(path.string) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBUSY) return F_status_set_error(F_busy); if (errno == EIO) return F_status_set_error(F_input_output); @@ -1665,12 +1668,13 @@ extern "C" { #endif // _di_f_file_remove_ #ifndef _di_f_file_remove_at_ - f_status_t f_file_remove_at(const int at_id, const f_string_t path, const int flag) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_remove_at(const int at_id, const f_string_static_t path, const int flag) { + + if (!path.used) { + return F_data_not; + } - if (unlinkat(at_id, path, flag) < 0) { + if (unlinkat(at_id, path.string, flag) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBUSY) return F_status_set_error(F_busy); if (errno == EIO) return F_status_set_error(F_input_output); @@ -1693,13 +1697,13 @@ extern "C" { #endif // _di_f_file_remove_at_ #ifndef _di_f_file_rename_ - f_status_t f_file_rename(const f_string_t source, const f_string_t destination) { - #ifndef _di_level_0_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_rename(const f_string_static_t source, const f_string_static_t destination) { - if (rename(source, destination) < 0) { + if (!source.used || !destination.used) { + return F_data_not; + } + + if (rename(source.string, destination.string) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBUSY) return F_status_set_error(F_busy); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); @@ -1727,13 +1731,13 @@ extern "C" { #endif // _di_f_file_rename_ #ifndef _di_f_file_rename_at_ - f_status_t f_file_rename_at(const int at_id, const int to_id, const f_string_t source, const f_string_t destination) { - #ifndef _di_level_0_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_rename_at(const int at_id, const int to_id, const f_string_static_t source, const f_string_static_t destination) { - if (renameat(at_id, source, to_id, destination) < 0) { + if (!source.used || !destination.used) { + return F_data_not; + } + + if (renameat(at_id, source.string, to_id, destination.string) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBUSY) return F_status_set_error(F_busy); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); @@ -1762,20 +1766,22 @@ extern "C" { #endif // _di_f_file_rename_at_ #ifndef _di_f_file_role_change_ - f_status_t f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference) { + f_status_t f_file_role_change(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (uid == -1 && gid == -1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_file_role_change(path, uid, gid, dereference); } #endif // _di_f_file_role_change_ #ifndef _di_f_file_role_change_at_ - f_status_t f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag) { + f_status_t f_file_role_change_at(const int at_id, const f_string_static_t path, const uid_t uid, const gid_t gid, const int flag) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (uid == -1 && gid == -1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1807,12 +1813,15 @@ extern "C" { #endif // _di_f_file_seek_ #ifndef _di_f_file_size_ - f_status_t f_file_size(const f_string_t path, const bool dereference, f_array_length_t *size) { + f_status_t f_file_size(const f_string_static_t path, const bool dereference, f_array_length_t *size) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + struct stat stat_file; memset(&stat_file, 0, sizeof(struct stat)); @@ -1829,13 +1838,16 @@ extern "C" { #endif // _di_f_file_size_ #ifndef _di_f_file_size_at_ - f_status_t f_file_size_at(const int at_id, const f_string_t path, const bool dereference, f_array_length_t *size) { + f_status_t f_file_size_at(const int at_id, const f_string_static_t path, const bool dereference, f_array_length_t *size) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (at_id <= 0) return F_status_set_error(F_parameter); if (!size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + struct stat stat_file; memset(&stat_file, 0, sizeof(struct stat)); @@ -1874,24 +1886,30 @@ extern "C" { #endif // _di_f_file_size_by_id_ #ifndef _di_f_file_stat_ - f_status_t f_file_stat(const f_string_t path, const bool dereference, struct stat *stat_file) { + f_status_t f_file_stat(const f_string_static_t path, const bool dereference, struct stat *stat_file) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!stat_file) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_file_stat(path, dereference, stat_file); } #endif // _di_f_file_stat_ #ifndef _di_f_file_stat_at_ - f_status_t f_file_stat_at(const int at_id, const f_string_t path, const int flag, struct stat *stat_file) { + f_status_t f_file_stat_at(const int at_id, const f_string_static_t path, const int flag, struct stat *stat_file) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (at_id <= 0) return F_status_set_error(F_parameter); if (!stat_file) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_f_file_stat_at(at_id, path, flag, stat_file); } #endif // _di_f_file_stat_at_ @@ -1939,7 +1957,7 @@ extern "C" { file->stream = 0; - // file stream will result in the file descriptor being invalid because it is already closed. + // File stream will result in the file descriptor being invalid because it is already closed. if (complete) { file->id = -1; } @@ -1956,14 +1974,14 @@ extern "C" { #endif // _di_f_file_stream_close_ #ifndef _di_f_file_stream_descriptor_ - f_status_t f_file_stream_descriptor(const f_string_t mode, f_file_t *file) { + f_status_t f_file_stream_descriptor(const f_string_static_t mode, f_file_t *file) { #ifndef _di_level_0_parameter_checking_ if (!file) return F_status_set_error(F_parameter); if (file->id == -1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (mode) { - file->stream = fdopen(file->id, mode); + if (mode.string) { + file->stream = fdopen(file->id, mode.string); } else { file->stream = fdopen(file->id, private_f_file_stream_open_mode_determine(file->flag)); @@ -1991,17 +2009,16 @@ extern "C" { #ifndef _di_f_file_stream_open_ - f_status_t f_file_stream_open(const f_string_t path, const f_string_t mode, f_file_t *file) { + f_status_t f_file_stream_open(const f_string_static_t path, const f_string_static_t mode, f_file_t *file) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!file) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (mode) { - file->stream = fopen(path, mode); + if (mode.used) { + file->stream = fopen(path.string, mode.string); } else { - file->stream = fopen(path, private_f_file_stream_open_mode_determine(file->flag)); + file->stream = fopen(path.string, private_f_file_stream_open_mode_determine(file->flag)); } if (!file->stream) { @@ -2054,16 +2071,8 @@ extern "C" { for (;;) { - if (buffer->used + file.size_read > buffer->size) { - if (buffer->size + file.size_read > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - macro_f_string_dynamic_t_resize(status, (*buffer), buffer->size + file.size_read); - if (F_status_is_error(status)) return status; - - memset(buffer->string + buffer->used, 0, sizeof(file.size_read)); - } + status = f_string_dynamic_increase_by(file.size_read, buffer); + if (F_status_is_error(status)) return status; size_read = fread(buffer->string + buffer->used, 1, file.size_read, file.stream); @@ -2092,20 +2101,14 @@ extern "C" { f_status_t f_file_stream_read_block(const f_file_t file, f_string_dynamic_t *buffer) { #ifndef _di_level_0_parameter_checking_ if (!file.size_read) return F_status_set_error(F_parameter); - if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (!file.stream) return F_status_set_error(F_file_closed); - f_status_t status = F_none; ssize_t size_read = 0; - if (buffer->used + file.size_read > buffer->size) { - if (buffer->size + file.size_read > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - macro_f_string_dynamic_t_resize(status, (*buffer), buffer->size + file.size_read); + { + const f_status_t status = f_string_dynamic_increase_by(file.size_read, buffer); if (F_status_is_error(status)) return status; } @@ -2154,14 +2157,8 @@ extern "C" { buffer_size = total - buffer_count; } - if (buffer->used + buffer_size > buffer->size) { - if (buffer->size + buffer_size > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - macro_f_string_dynamic_t_resize(status, (*buffer), buffer->size + buffer_size); - if (F_status_is_error(status)) return status; - } + status = f_string_dynamic_increase_by(buffer_size, buffer); + if (F_status_is_error(status)) return status; size_read = fread(buffer->string + buffer->used, 1, file.size_read, file.stream); @@ -2193,19 +2190,22 @@ extern "C" { #endif // _di_f_file_stream_read_until_ #ifndef _di_f_file_stream_reopen_ - f_status_t f_file_stream_reopen(const f_string_t path, const f_string_t mode, f_file_t *file) { + f_status_t f_file_stream_reopen(const f_string_static_t path, const f_string_static_t mode, f_file_t *file) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!file) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + FILE *result = 0; - if (mode) { - result = freopen(path, mode, file->stream); + if (mode.used) { + result = freopen(path.string, mode.string, file->stream); } else { - result = freopen(path, private_f_file_stream_open_mode_determine(file->flag), file->stream); + result = freopen(path.string, private_f_file_stream_open_mode_determine(file->flag), file->stream); } if (!result) { @@ -2246,14 +2246,17 @@ extern "C" { } if (!buffer.used) { - if (written) *written = 0; + if (written) { + *written = 0; + } + return F_data_not; } f_status_t status = F_none; if (written) { - private_f_file_stream_write_until(file, buffer.string, buffer.used, written); + private_f_file_stream_write_until(file, buffer, buffer.used, written); if (status == F_none && *written == buffer.used) { return F_none_eos; @@ -2262,7 +2265,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_stream_write_until(file, buffer.string, buffer.used, &written_local); + private_f_file_stream_write_until(file, buffer, buffer.used, &written_local); if (status == F_none && written_local == buffer.used) { return F_none_eos; @@ -2289,7 +2292,9 @@ extern "C" { } if (!buffer.used) { - if (written) *written = 0; + if (written) { + *written = 0; + } return F_data_not; } @@ -2303,7 +2308,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_stream_write_until(file, buffer.string, write_max, written); + private_f_file_stream_write_until(file, buffer, write_max, written); if (status == F_none) { if (*written == buffer.used) { @@ -2318,7 +2323,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_stream_write_until(file, buffer.string, write_max, &written_local); + private_f_file_stream_write_until(file, buffer, write_max, &written_local); if (status == F_none) { if (written_local == buffer.used) { @@ -2339,7 +2344,6 @@ extern "C" { f_status_t f_file_stream_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t total, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); - if (buffer.used > buffer.size) return F_status_set_error(F_parameter); if (!total) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -2348,7 +2352,9 @@ extern "C" { } if (!buffer.used || !total) { - if (written) *written = 0; + if (written) { + *written = 0; + } return F_data_not; } @@ -2362,7 +2368,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_stream_write_until(file, buffer.string, write_max, written); + private_f_file_stream_write_until(file, buffer, write_max, written); if (status == F_none) { if (*written == buffer.used) { @@ -2377,7 +2383,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_stream_write_until(file, buffer.string, buffer.used, &written_local); + private_f_file_stream_write_until(file, buffer, buffer.used, &written_local); if (status == F_none) { if (written_local == buffer.used) { @@ -2398,7 +2404,6 @@ extern "C" { f_status_t f_file_stream_write_range(const f_file_t file, const f_string_static_t buffer, const f_string_range_t range, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); - if (buffer.used > buffer.size) return F_status_set_error(F_parameter); if (range.stop < range.start) return F_status_set_error(F_parameter); if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -2408,7 +2413,9 @@ extern "C" { } if (!buffer.used) { - if (written) *written = 0; + if (written) { + *written = 0; + } return F_data_not; } @@ -2423,7 +2430,9 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_stream_write_until(file, buffer.string + range.start, write_max, written); + const f_string_static_t buffer_adjusted = macro_f_string_static_t_initialize(buffer.string + range.start, 0, buffer.used - range.start); + + private_f_file_stream_write_until(file, buffer_adjusted, write_max, written); if (status == F_none) { if (range.start + *written == buffer.used) { @@ -2436,9 +2445,10 @@ extern "C" { } } else { + const f_string_static_t buffer_adjusted = macro_f_string_static_t_initialize(buffer.string + range.start, 0, buffer.used - range.start); f_array_length_t written_local = 0; - private_f_file_stream_write_until(file, buffer.string + range.start, write_max, &written_local); + private_f_file_stream_write_until(file, buffer_adjusted, write_max, &written_local); if (status == F_none) { if (range.start + written_local == buffer.used) { @@ -2456,10 +2466,11 @@ extern "C" { #endif // _di_f_file_stream_write_range_ #ifndef _di_f_file_touch_ - f_status_t f_file_touch(const f_string_t path, const mode_t mode, const bool dereference) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_touch(const f_string_static_t path, const mode_t mode, const bool dereference) { + + if (!path.used) { + return F_data_not; + } f_status_t status = F_none; struct stat stat_file; @@ -2471,11 +2482,12 @@ extern "C" { if (F_status_set_fine(status) == F_file_found_not) { return private_f_file_create(path, mode, dereference); } - else if (F_status_is_error(status)) { + + if (F_status_is_error(status)) { return status; } - if (utimensat(F_file_at_current_working_d, path, 0, dereference ? 0 : F_file_at_symlink_follow_no_d) < 0) { + if (utimensat(F_file_at_current_working_d, path.string, 0, dereference ? 0 : F_file_at_symlink_follow_no_d) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -2496,10 +2508,11 @@ extern "C" { #endif // _di_f_file_touch_ #ifndef _di_f_file_touch_at_ - f_status_t f_file_touch_at(const int at_id, const f_string_t path, const mode_t mode, const int flag) { - #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + f_status_t f_file_touch_at(const int at_id, const f_string_static_t path, const mode_t mode, const int flag) { + + if (!path.used) { + return F_data_not; + } f_status_t status = F_none; struct stat stat_file; @@ -2511,11 +2524,10 @@ extern "C" { if (F_status_set_fine(status) == F_file_found_not) { return private_f_file_create_at(at_id, path, mode, F_false); } - else if (F_status_is_error(status)) { - return status; - } - if (utimensat(at_id, path, 0, flag) < 0) { + if (F_status_is_error(status)) return status; + + if (utimensat(at_id, path.string, 0, flag) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -2536,17 +2548,20 @@ extern "C" { #endif // _di_f_file_touch_at_ #ifndef _di_f_file_type_ - f_status_t f_file_type(const f_string_t path, int *type) { + f_status_t f_file_type(const f_string_static_t path, int *type) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!type) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + struct stat stat_file; memset(&stat_file, 0, sizeof(struct stat)); - if (stat(path, &stat_file) < 0) { + if (stat(path.string, &stat_file) < 0) { if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == ENOMEM) return F_status_set_error(F_memory_not); @@ -2566,17 +2581,20 @@ extern "C" { #endif // _di_f_file_type_ #ifndef _di_f_file_type_at_ - f_status_t f_file_type_at(const int at_id, const f_string_t path, const int flag, int *type) { + f_status_t f_file_type_at(const int at_id, const f_string_static_t path, const int flag, int *type) { #ifndef _di_level_0_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); if (!type) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (!path.used) { + return F_data_not; + } + struct stat stat_file; memset(&stat_file, 0, sizeof(struct stat)); - if (fstatat(at_id, path, &stat_file, flag) < 0) { + if (fstatat(at_id, path.string, &stat_file, flag) < 0) { if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == ENOMEM) return F_status_set_error(F_memory_not); @@ -2622,7 +2640,6 @@ extern "C" { f_status_t f_file_write(const f_file_t file, const f_string_static_t buffer, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); - if (buffer.used > buffer.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (file.id == -1) { @@ -2638,7 +2655,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_write_until(file, buffer.string, buffer.used, written); + private_f_file_write_until(file, buffer, buffer.used, written); if (status == F_none && *written == buffer.used) { return F_none_eos; @@ -2647,7 +2664,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_write_until(file, buffer.string, buffer.used, &written_local); + private_f_file_write_until(file, buffer, buffer.used, &written_local); if (status == F_none && written_local == buffer.used) { return F_none_eos; @@ -2666,7 +2683,6 @@ extern "C" { f_status_t f_file_write_block(const f_file_t file, const f_string_static_t buffer, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); - if (buffer.used > buffer.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (file.id == -1) { @@ -2688,7 +2704,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_write_until(file, buffer.string, write_max, written); + private_f_file_write_until(file, buffer, write_max, written); if (status == F_none) { if (*written == buffer.used) { @@ -2703,7 +2719,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_write_until(file, buffer.string, write_max, &written_local); + private_f_file_write_until(file, buffer, write_max, &written_local); if (status == F_none) { if (written_local == buffer.used) { @@ -2724,7 +2740,6 @@ extern "C" { f_status_t f_file_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t total, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); - if (buffer.used > buffer.size) return F_status_set_error(F_parameter); if (!total) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -2747,7 +2762,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_write_until(file, buffer.string, write_max, written); + private_f_file_write_until(file, buffer, write_max, written); if (status == F_none) { if (*written == buffer.used) { @@ -2762,7 +2777,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_write_until(file, buffer.string, buffer.used, &written_local); + private_f_file_write_until(file, buffer, buffer.used, &written_local); if (status == F_none) { if (written_local == buffer.used) { @@ -2783,7 +2798,6 @@ extern "C" { f_status_t f_file_write_range(const f_file_t file, const f_string_static_t buffer, const f_string_range_t range, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); - if (buffer.used > buffer.size) return F_status_set_error(F_parameter); if (range.stop < range.start) return F_status_set_error(F_parameter); if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -2793,7 +2807,9 @@ extern "C" { } if (!buffer.used) { - if (written) *written = 0; + if (written) { + *written = 0; + } return F_data_not; } @@ -2808,7 +2824,9 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_write_until(file, buffer.string + range.start, write_max, written); + const f_string_static_t buffer_adjusted = macro_f_string_static_t_initialize(buffer.string + range.start, 0, buffer.used - range.start); + + private_f_file_write_until(file, buffer_adjusted, write_max, written); if (status == F_none) { if (range.start + *written == buffer.used) { @@ -2821,9 +2839,10 @@ extern "C" { } } else { + const f_string_static_t buffer_adjusted = macro_f_string_static_t_initialize(buffer.string + range.start, 0, buffer.used - range.start); f_array_length_t written_local = 0; - private_f_file_write_until(file, buffer.string + range.start, write_max, &written_local); + private_f_file_write_until(file, buffer_adjusted, write_max, &written_local); if (status == F_none) { if (range.start + written_local == buffer.used) { diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index ea7731c..1bd4540 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -53,6 +53,8 @@ extern "C" { * @return * F_true if file exists. * F_false if file does not exist. + * F_data_not if path.used is 0. + * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) on invalid directory. * F_false (with error bit) on unknown/unhandled errors. @@ -65,7 +67,7 @@ extern "C" { * @see access() */ #ifndef _di_f_file_access_ - extern f_status_t f_file_access(const f_string_t path); + extern f_status_t f_file_access(const f_string_static_t path); #endif // _di_f_file_access_ /** @@ -95,6 +97,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if source.used or destination.used is 0. * * F_access_denied (with error bit) on access denied. * F_access_group (with error bit) if the current user does not have access to assign the specified group. @@ -120,7 +123,7 @@ extern "C" { * F_failure (with error bit) for any other error. */ #ifndef _di_f_file_clone_ - extern f_status_t f_file_clone(const f_string_t source, const f_string_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive); + extern f_status_t f_file_clone(const f_string_static_t source, const f_string_static_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive); #endif // _di_f_file_clone_ /** @@ -201,6 +204,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if source.used or destination.used is 0. * * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file system is too busy to perform write. @@ -223,7 +227,7 @@ extern "C" { * F_failure (with error bit) for any other error. */ #ifndef _di_f_file_copy_ - extern f_status_t f_file_copy(const f_string_t source, const f_string_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive); + extern f_status_t f_file_copy(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive); #endif // _di_f_file_copy_ /** @@ -241,6 +245,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file system is too busy to perform write. @@ -262,7 +267,7 @@ extern "C" { * @see open() */ #ifndef _di_f_file_create_ - extern f_status_t f_file_create(const f_string_t path, const mode_t mode, const bool exclusive); + extern f_status_t f_file_create(const f_string_static_t path, const mode_t mode, const bool exclusive); #endif // _di_f_file_create_ /** @@ -282,6 +287,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file system is too busy to perform write. @@ -303,7 +309,7 @@ extern "C" { * @see openat() */ #ifndef _di_f_file_create_at_ - extern f_status_t f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive); + extern f_status_t f_file_create_at(const int at_id, const f_string_static_t path, const mode_t mode, const bool exclusive); #endif // _di_f_file_create_at_ /** @@ -324,6 +330,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) if a supposed directory in path is not actually a directory. @@ -342,7 +349,7 @@ extern "C" { * @see mknod() */ #ifndef _di_f_file_create_device_ - extern f_status_t f_file_create_device(const f_string_t path, const mode_t mode, const unsigned int major, const unsigned int minor); + extern f_status_t f_file_create_device(const f_string_static_t path, const mode_t mode, const unsigned int major, const unsigned int minor); #endif // _di_f_file_create_device_ /** @@ -365,6 +372,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) if a supposed directory in path is not actually a directory. @@ -384,7 +392,7 @@ extern "C" { * @see mknodat() */ #ifndef _di_f_file_create_device_at_ - extern f_status_t f_file_create_device_at(const int at_id, const f_string_t path, const mode_t mode, const unsigned int major, const unsigned int minor); + extern f_status_t f_file_create_device_at(const int at_id, const f_string_static_t path, const mode_t mode, const unsigned int major, const unsigned int minor); #endif // _di_f_file_create_device_at_ /** @@ -397,6 +405,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) if a supposed directory in path is not actually a directory. @@ -414,7 +423,7 @@ extern "C" { * @see mkfifo() */ #ifndef _di_f_file_create_fifo_ - extern f_status_t f_file_create_fifo(const f_string_t path, const mode_t mode); + extern f_status_t f_file_create_fifo(const f_string_static_t path, const mode_t mode); #endif // _di_f_file_create_fifo_ /** @@ -429,6 +438,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) if a supposed directory in path is not actually a directory. @@ -447,7 +457,7 @@ extern "C" { * @see mkfifoat() */ #ifndef _di_f_file_create_fifo_at_ - extern f_status_t f_file_create_fifo_at(const int at_id, const f_string_t path, const mode_t mode); + extern f_status_t f_file_create_fifo_at(const int at_id, const f_string_static_t path, const mode_t mode); #endif // _di_f_file_create_fifo_at_ /** @@ -463,6 +473,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) if a supposed directory in path is not actually a directory. @@ -480,7 +491,7 @@ extern "C" { * @see mknod() */ #ifndef _di_f_file_create_node_ - extern f_status_t f_file_create_node(const f_string_t path, const mode_t mode, const dev_t device); + extern f_status_t f_file_create_node(const f_string_static_t path, const mode_t mode, const dev_t device); #endif // _di_f_file_create_node_ /** @@ -498,6 +509,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) if a supposed directory in path is not actually a directory. @@ -516,7 +528,7 @@ extern "C" { * @see mknodat() */ #ifndef _di_f_file_create_node_at_ - extern f_status_t f_file_create_node_at(const int at_id, const f_string_t path, const mode_t mode, const dev_t device); + extern f_status_t f_file_create_node_at(const int at_id, const f_string_static_t path, const mode_t mode, const dev_t device); #endif // _di_f_file_create_node_at_ /** @@ -549,6 +561,7 @@ extern "C" { * @return * F_true if path was found. * F_false if path was not found. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. @@ -561,7 +574,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_file_exists_ - extern f_status_t f_file_exists(const f_string_t path); + extern f_status_t f_file_exists(const f_string_static_t path); #endif // _di_f_file_exists_ /** @@ -580,6 +593,7 @@ extern "C" { * @return * F_true if file exists. * F_false if file does not exist. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_directory (with error bit) on invalid directory. @@ -593,7 +607,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_exists_at_ - extern f_status_t f_file_exists_at(const int at_id, const f_string_t path, const int flag); + extern f_status_t f_file_exists_at(const int at_id, const f_string_static_t path, const int flag); #endif // _di_f_file_exists_at_ /** @@ -629,6 +643,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. @@ -642,7 +657,7 @@ extern "C" { * @see fstat() */ #ifndef _di_f_file_group_read_ - extern f_status_t f_file_group_read(const f_string_t path, uid_t *group); + extern f_status_t f_file_group_read(const f_string_static_t path, uid_t *group); #endif // _di_f_file_group_read_ /** @@ -663,6 +678,7 @@ extern "C" { * F_true if path was found and path is type. * F_false if path was found and path is not type. * F_file_found_not if the path was not found. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. @@ -675,7 +691,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_file_is_ - extern f_status_t f_file_is(const f_string_t path, const int type, const bool dereference); + extern f_status_t f_file_is(const f_string_static_t path, const int type, const bool dereference); #endif // _di_f_file_is_ /** @@ -694,6 +710,7 @@ extern "C" { * F_true if path was found and path is type. * F_false if path was found and path is not type. * F_file_found_not if the path was not found. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. @@ -706,7 +723,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_is_at_ - extern f_status_t f_file_is_at(const int at_id, const f_string_t path, const int type, const int flag); + extern f_status_t f_file_is_at(const int at_id, const f_string_static_t path, const int type, const int flag); #endif // _di_f_file_is_at_ /** @@ -722,6 +739,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if target.used or point.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -743,7 +761,7 @@ extern "C" { * @see symlink() */ #ifndef _di_f_file_link_ - extern f_status_t f_file_link(const f_string_t target, const f_string_t point); + extern f_status_t f_file_link(const f_string_static_t target, const f_string_static_t point); #endif // _di_f_file_link_ /** @@ -761,6 +779,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if target.used or point.used is 0. * * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file system is too busy to perform write. @@ -783,7 +802,7 @@ extern "C" { * @see symlinkat() */ #ifndef _di_f_file_link_at_ - extern f_status_t f_file_link_at(const int at_id, const f_string_t target, const f_string_t point); + extern f_status_t f_file_link_at(const int at_id, const f_string_static_t target, const f_string_static_t point); #endif // _di_f_file_link_at_ /** @@ -798,6 +817,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if target.used or point.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -819,7 +839,7 @@ extern "C" { * @see link() */ #ifndef _di_f_file_link_hard_ - extern f_status_t f_file_link_hard(const f_string_t target, const f_string_t point); + extern f_status_t f_file_link_hard(const f_string_static_t target, const f_string_static_t point); #endif // _di_f_file_link_hard_ /** @@ -840,6 +860,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if target.used or point.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -862,7 +883,7 @@ extern "C" { * @see linkat() */ #ifndef _di_f_file_link_hard_at_ - extern f_status_t f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string_t target, const f_string_t point, const int flag); + extern f_status_t f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string_static_t target, const f_string_static_t point, const int flag); #endif // _di_f_file_link_hard_at_ /** @@ -881,6 +902,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -897,7 +919,7 @@ extern "C" { * @see readlink() */ #ifndef _di_f_file_link_read_ - extern f_status_t f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target); + extern f_status_t f_file_link_read(const f_string_static_t path, const struct stat link_stat, f_string_dynamic_t *target); #endif // _di_f_file_link_read_ /** @@ -918,6 +940,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -935,7 +958,7 @@ extern "C" { * @see readlinkat() */ #ifndef _di_f_file_link_read_at_ - extern f_status_t f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target); + extern f_status_t f_file_link_read_at(const int at_id, const f_string_static_t path, const struct stat link_stat, f_string_dynamic_t *target); #endif // _di_f_file_link_read_at_ /** @@ -1033,7 +1056,7 @@ extern "C" { * * @fixme apparently "u+g" is valid such that the mode from the group (g) is applied to the user (u) mode. * - * @param string + * @param code * A NULL terminated string designating the desired mode, following the above string syntax. * @param umask * The umask to be applied to the file mode, when applicable. @@ -1055,7 +1078,7 @@ extern "C" { * @see private_f_file_mode_determine() */ #ifndef _di_f_file_mode_from_string_ - extern f_status_t f_file_mode_from_string(const f_string_t string, const mode_t umask, f_file_mode_t *mode, uint8_t *replace); + extern f_status_t f_file_mode_from_string(const f_string_static_t code, const mode_t umask, f_file_mode_t *mode, uint8_t *replace); #endif // _di_f_file_mode_from_string_ /** @@ -1068,6 +1091,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. @@ -1081,7 +1105,7 @@ extern "C" { * @see fstat() */ #ifndef _di_f_file_mode_read_ - extern f_status_t f_file_mode_read(const f_string_t path, mode_t *mode); + extern f_status_t f_file_mode_read(const f_string_static_t path, mode_t *mode); #endif // _di_f_file_mode_read_ /** @@ -1096,6 +1120,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. @@ -1109,7 +1134,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_mode_read_at_ - extern f_status_t f_file_mode_read_at(const int at_id, const f_string_t path, mode_t *mode); + extern f_status_t f_file_mode_read_at(const int at_id, const f_string_static_t path, mode_t *mode); #endif // _di_f_file_mode_read_at_ /** @@ -1125,6 +1150,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_access_mode (with error bit) if the current user does not have access to assign the file mode. @@ -1141,7 +1167,7 @@ extern "C" { * @see chmod() */ #ifndef _di_f_file_mode_set_ - extern f_status_t f_file_mode_set(const f_string_t path, const mode_t mode); + extern f_status_t f_file_mode_set(const f_string_static_t path, const mode_t mode); #endif // _di_f_file_mode_set_ /** @@ -1159,6 +1185,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_access_mode (with error bit) if the current user does not have access to assign the file mode. @@ -1175,7 +1202,7 @@ extern "C" { * @see fchmodat() */ #ifndef _di_f_file_mode_set_at_ - extern f_status_t f_file_mode_set_at(const int at_id, const f_string_t path, const mode_t mode); + extern f_status_t f_file_mode_set_at(const int at_id, const f_string_static_t path, const mode_t mode); #endif // _di_f_file_mode_set_at_ /** @@ -1205,23 +1232,26 @@ extern "C" { * @param path * The path file name. * Need not be NULL terminated. - * @param length - * The length of the path string. * @param name_base * The resulting base name as per basename(). * The base name is appended onto this. * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if string is too large to store in the buffer. * + * Errors (with error bit) from: f_string_dynamic_increase_by(). + * * @see basename() + * + * @see f_string_dynamic_increase_by() */ #ifndef _di_f_file_name_base_ - extern f_status_t f_file_name_base(const f_string_t path, const f_array_length_t length, f_string_dynamic_t *name_base); + extern f_status_t f_file_name_base(const f_string_static_t path, f_string_dynamic_t *name_base); #endif // _di_f_file_name_base_ /** @@ -1230,23 +1260,26 @@ extern "C" { * @param path * The path file name. * Need not be NULL terminated. - * @param length - * The length of the path string. * @param name_directory * The resulting base name as per dirname(). * The directory name is appended onto this. * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if string is too large to store in the buffer. * + * Errors (with error bit) from: f_string_dynamic_increase_by(). + * * @see dirname() + * + * @see f_string_dynamic_increase_by() */ #ifndef _di_f_file_name_directory_ - extern f_status_t f_file_name_directory(const f_string_t path, const f_array_length_t length, f_string_dynamic_t *name_directory); + extern f_status_t f_file_name_directory(const f_string_static_t path, f_string_dynamic_t *name_directory); #endif // _di_f_file_name_directory_ /** @@ -1266,6 +1299,7 @@ extern "C" { * * @return * F_none is returned on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. @@ -1288,7 +1322,7 @@ extern "C" { * @see open() */ #ifndef _di_f_file_open_ - extern f_status_t f_file_open(const f_string_t path, const mode_t mode, f_file_t *file); + extern f_status_t f_file_open(const f_string_static_t path, const mode_t mode, f_file_t *file); #endif // _di_f_file_open_ /** @@ -1310,6 +1344,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found_not (with error bit) if the file was not found. @@ -1319,7 +1354,7 @@ extern "C" { * @see openat() */ #ifndef _di_f_file_open_at_ - extern f_status_t f_file_open_at(const int at_id, const f_string_t path, const mode_t mode, f_file_t *file); + extern f_status_t f_file_open_at(const int at_id, const f_string_static_t path, const mode_t mode, f_file_t *file); #endif // _di_f_file_open_at_ /** @@ -1332,6 +1367,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. @@ -1345,7 +1381,7 @@ extern "C" { * @see fstat() */ #ifndef _di_f_file_owner_read_ - extern f_status_t f_file_owner_read(const f_string_t path, uid_t *owner); + extern f_status_t f_file_owner_read(const f_string_static_t path, uid_t *owner); #endif // _di_f_file_owner_read_ /** @@ -1372,7 +1408,11 @@ extern "C" { * F_interrupt (with error bit) if interrupt was received. * F_parameter (with error bit) if a parameter is invalid. * + * Errors (with error bit) from: f_string_dynamic_increase_by(). + * * @see read() + * + * @see f_string_dynamic_increase_by() */ #ifndef _di_f_file_read_ extern f_status_t f_file_read(const f_file_t file, f_string_dynamic_t *buffer); @@ -1472,7 +1512,7 @@ extern "C" { * @see unlink() */ #ifndef _di_f_file_remove_ - extern f_status_t f_file_remove(const f_string_t path); + extern f_status_t f_file_remove(const f_string_static_t path); #endif // _di_f_file_remove_ /** @@ -1505,7 +1545,7 @@ extern "C" { * @see unlinkat() */ #ifndef _di_f_file_remove_at_ - extern f_status_t f_file_remove_at(const int at_id, const f_string_t path, const int flag); + extern f_status_t f_file_remove_at(const int at_id, const f_string_static_t path, const int flag); #endif // _di_f_file_remove_at_ /** @@ -1550,7 +1590,7 @@ extern "C" { * @see rename() */ #ifndef _di_f_file_rename_ - extern f_status_t f_file_rename(const f_string_t source, const f_string_t destination); + extern f_status_t f_file_rename(const f_string_static_t source, const f_string_static_t destination); #endif // _di_f_file_rename_ /** @@ -1600,7 +1640,7 @@ extern "C" { * @see renameat() */ #ifndef _di_f_file_rename_at_ - extern f_status_t f_file_rename_at(const int at_id, const int to_id, const f_string_t source, const f_string_t destination); + extern f_status_t f_file_rename_at(const int at_id, const int to_id, const f_string_static_t source, const f_string_static_t destination); #endif // _di_f_file_rename_at_ /** @@ -1641,7 +1681,7 @@ extern "C" { * @see lchown() */ #ifndef _di_f_file_role_change_ - extern f_status_t f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference); + extern f_status_t f_file_role_change(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference); #endif // _di_f_file_role_change_ /** @@ -1683,7 +1723,7 @@ extern "C" { * @see fchownat() */ #ifndef _di_f_file_role_change_at_ - extern f_status_t f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag); + extern f_status_t f_file_role_change_at(const int at_id, const f_string_static_t path, const uid_t uid, const gid_t gid, const int flag); #endif // _di_f_file_role_change_at_ /** @@ -1741,7 +1781,7 @@ extern "C" { * @see f_file_stat() */ #ifndef _di_f_file_size_ - extern f_status_t f_file_size(const f_string_t path, const bool dereference, f_array_length_t *size); + extern f_status_t f_file_size(const f_string_static_t path, const bool dereference, f_array_length_t *size); #endif // _di_f_file_size_ /** @@ -1772,7 +1812,7 @@ extern "C" { * @see f_file_stat_at() */ #ifndef _di_f_file_size_at_ - extern f_status_t f_file_size_at(const int at_id, const f_string_t path, const bool dereference, f_array_length_t *size); + extern f_status_t f_file_size_at(const int at_id, const f_string_static_t path, const bool dereference, f_array_length_t *size); #endif // _di_f_file_size_at_ /** @@ -1827,7 +1867,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_file_stat_ - extern f_status_t f_file_stat(const f_string_t path, const bool dereference, struct stat *stat_file); + extern f_status_t f_file_stat(const f_string_static_t path, const bool dereference, struct stat *stat_file); #endif // _di_f_file_stat_ /** @@ -1857,7 +1897,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_stat_at_ - extern f_status_t f_file_stat_at(const int at_id, const f_string_t path, const int flag, struct stat *stat_file); + extern f_status_t f_file_stat_at(const int at_id, const f_string_static_t path, const int flag, struct stat *stat_file); #endif // _di_f_file_stat_at_ /** @@ -1931,8 +1971,7 @@ extern "C" { * * @param mode * The file modes do use when opening. - * The file modes do use when opening. - * Set to 0 to determine mode from file.flags (falling back to read only as a failsafe). + * Set mode.used to 0 to determine mode from file.flags (falling back to read only as a failsafe). * If neither truncate nor append are not specified in write only mode, then the failsafe is to append. * This should match the modes used to open the file descriptor as it relates to the stream modes. * @param file @@ -1956,7 +1995,7 @@ extern "C" { * @see fdopen() */ #ifndef _di_f_file_stream_descriptor_ - extern f_status_t f_file_stream_descriptor(const f_string_t mode, f_file_t *file); + extern f_status_t f_file_stream_descriptor(const f_string_static_t mode, f_file_t *file); #endif // _di_f_file_stream_descriptor_ /** @@ -1968,7 +2007,7 @@ extern "C" { * The file path * @param mode * The file modes do use when opening, as an fopen() file mode string. - * Set to 0 to determine mode from file.flags (falling back to read only as a failsafe). + * Set mode.used to 0 to determine mode from file.flags (falling back to read only as a failsafe). * If neither truncate nor append are not specified in write only mode, then the failsafe is to append. * * File Modes (fopen() file modes vs open file modes): @@ -2009,7 +2048,7 @@ extern "C" { * @see fopen() */ #ifndef _di_f_file_stream_open_ - extern f_status_t f_file_stream_open(const f_string_t path, const f_string_t mode, f_file_t *file); + extern f_status_t f_file_stream_open(const f_string_static_t path, const f_string_static_t mode, f_file_t *file); #endif // _di_f_file_stream_open_ /** @@ -2107,7 +2146,11 @@ extern "C" { * F_interrupt (with error bit) if interrupt was received. * F_parameter (with error bit) if a parameter is invalid. * + * Errors (with error bit) from: f_string_dynamic_increase_by(). + * * @see fread() + * + * @see f_string_dynamic_increase_by() */ #ifndef _di_f_file_stream_read_until_ extern f_status_t f_file_stream_read_until(const f_file_t file, const f_array_length_t total, f_string_dynamic_t *buffer); @@ -2157,7 +2200,7 @@ extern "C" { * @see freopen() */ #ifndef _di_f_file_stream_reopen_ - extern f_status_t f_file_stream_reopen(const f_string_t path, const f_string_t mode, f_file_t *file); + extern f_status_t f_file_stream_reopen(const f_string_static_t path, const f_string_static_t mode, f_file_t *file); #endif // _di_f_file_stream_reopen_ /** @@ -2335,7 +2378,7 @@ extern "C" { * @see utimensat() */ #ifndef _di_f_file_touch_ - extern f_status_t f_file_touch(const f_string_t path, const mode_t mode, const bool dereference); + extern f_status_t f_file_touch(const f_string_static_t path, const mode_t mode, const bool dereference); #endif // _di_f_file_touch_ /** @@ -2378,7 +2421,7 @@ extern "C" { * @see utimensat() */ #ifndef _di_f_file_touch_at_ - extern f_status_t f_file_touch_at(const int at_id, const f_string_t path, const mode_t mode, const int flag); + extern f_status_t f_file_touch_at(const int at_id, const f_string_static_t path, const mode_t mode, const int flag); #endif // _di_f_file_touch_at_ /** @@ -2407,7 +2450,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_file_type_ - extern f_status_t f_file_type(const f_string_t path, int *type); + extern f_status_t f_file_type(const f_string_static_t path, int *type); #endif // _di_f_file_type_ /** @@ -2437,7 +2480,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_type_at_ - extern f_status_t f_file_type_at(const int at_id, const f_string_t path, const int flag, int *type); + extern f_status_t f_file_type_at(const int at_id, const f_string_static_t path, const int flag, int *type); #endif // _di_f_file_type_at_ /** diff --git a/level_0/f_file/c/private-file.c b/level_0/f_file/c/private-file.c index 4f2302d..d875763 100644 --- a/level_0/f_file/c/private-file.c +++ b/level_0/f_file/c/private-file.c @@ -39,7 +39,7 @@ extern "C" { #endif // !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_stream_close_) #if !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) - f_status_t private_f_file_copy_content(const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) { + f_status_t private_f_file_copy_content(const f_string_static_t source, const f_string_static_t destination, const f_number_unsigned_t size_block) { f_file_t file_source = f_file_t_initialize; f_file_t file_destination = f_file_t_initialize; @@ -88,7 +88,7 @@ extern "C" { #endif // !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) #if !defined(_di_f_file_copy_at_) || !defined(_di_f_file_clone_at_) - f_status_t private_f_file_copy_content_at(const int at_id, const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) { + f_status_t private_f_file_copy_content_at(const int at_id, const f_string_static_t source, const f_string_static_t destination, const f_number_unsigned_t size_block) { f_file_t file_source = f_file_t_initialize; f_file_t file_destination = f_file_t_initialize; @@ -137,7 +137,7 @@ extern "C" { #endif // !defined(_di_f_file_copy_at_) || !defined(_di_f_file_clone_at_) #if !defined(_di_f_file_create_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_create(const f_string_t path, const mode_t mode, const bool exclusive) { + f_status_t private_f_file_create(const f_string_static_t path, const mode_t mode, const bool exclusive) { f_file_t file = f_file_t_initialize; @@ -158,7 +158,7 @@ extern "C" { #endif // !defined(_di_f_file_create_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_create_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive) { + f_status_t private_f_file_create_at(const int at_id, const f_string_static_t path, const mode_t mode, const bool exclusive) { f_file_t file = f_file_t_initialize; @@ -179,9 +179,9 @@ extern "C" { #endif // !defined(_di_f_file_create_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_copy_) - f_status_t private_f_file_create_directory(const f_string_t path, const mode_t mode) { + f_status_t private_f_file_create_directory(const f_string_static_t path, const mode_t mode) { - if (mkdir(path, mode) < 0) { + if (mkdir(path.string, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -205,9 +205,9 @@ extern "C" { #endif // !defined(_di_f_file_copy_) #if !defined(_di_f_file_copy_at_) - f_status_t private_f_file_create_directory_at(const int at_id, const f_string_t path, const mode_t mode) { + f_status_t private_f_file_create_directory_at(const int at_id, const f_string_static_t path, const mode_t mode) { - if (mkdirat(at_id, path, mode) < 0) { + if (mkdirat(at_id, path.string, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -232,9 +232,9 @@ extern "C" { #endif // !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_create_fifo_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_create_fifo(const f_string_t path, const mode_t mode) { + f_status_t private_f_file_create_fifo(const f_string_static_t path, const mode_t mode) { - if (mkfifo(path, mode) < 0) { + if (mkfifo(path.string, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -253,9 +253,9 @@ extern "C" { #endif // !defined(_di_f_file_create_fifo_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_create_fifo_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_create_fifo_at(const int at_id, const f_string_t path, const mode_t mode) { + f_status_t private_f_file_create_fifo_at(const int at_id, const f_string_static_t path, const mode_t mode) { - if (mkfifoat(at_id, path, mode) < 0) { + if (mkfifoat(at_id, path.string, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -275,9 +275,9 @@ extern "C" { #endif // !defined(_di_f_file_create_fifo_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_create_device_) || !defined(_di_f_file_create_node_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_create_node(const f_string_t path, const mode_t mode, const dev_t device) { + f_status_t private_f_file_create_node(const f_string_static_t path, const mode_t mode, const dev_t device) { - if (mknod(path, mode, device) < 0) { + if (mknod(path.string, mode, device) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -301,9 +301,9 @@ extern "C" { #endif // !defined(_di_f_file_create_device_) || !defined(_di_f_file_create_node_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_create_device_at_) || !defined(_di_f_file_create_node_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_create_node_at(const int at_id, const f_string_t path, const mode_t mode, const dev_t device) { + f_status_t private_f_file_create_node_at(const int at_id, const f_string_static_t path, const mode_t mode, const dev_t device) { - if (mknodat(at_id, path, mode, device) < 0) { + if (mknodat(at_id, path.string, mode, device) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -345,9 +345,9 @@ extern "C" { #endif // !defined(_di_f_file_flush_) || !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_link(const f_string_t target, const f_string_t point) { + f_status_t private_f_file_link(const f_string_static_t target, const f_string_static_t point) { - if (symlink(target, point) < 0) { + if (symlink(target.string, point.string) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -373,9 +373,9 @@ extern "C" { #endif // !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_link_at(const int at_id, const f_string_t target, const f_string_t point) { + f_status_t private_f_file_link_at(const int at_id, const f_string_static_t target, const f_string_static_t point) { - if (symlinkat(target, at_id, point) < 0) { + if (symlinkat(target.string, at_id, point.string) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); @@ -402,7 +402,7 @@ extern "C" { #endif // !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) { + f_status_t private_f_file_link_read(const f_string_static_t path, const struct stat link_stat, f_string_dynamic_t *target) { // create a NULL terminated string based on file stat. if (link_stat.st_size + 1 > target->size) { @@ -420,7 +420,7 @@ extern "C" { target->used = link_stat.st_size; - if (readlink(path, target->string, target->used) < 0) { + if (readlink(path.string, target->string, target->used) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == EINVAL) return F_status_set_error(F_parameter); @@ -439,9 +439,9 @@ extern "C" { #endif // !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) { + f_status_t private_f_file_link_read_at(const int at_id, const f_string_static_t path, const struct stat link_stat, f_string_dynamic_t *target) { - // create a NULL terminated string based on file stat. + // Create a NULL terminated string based on file stat. if (link_stat.st_size + 1 > target->size) { if (link_stat.st_size + 1 > F_array_length_t_size_d) { return F_status_set_error(F_string_too_large); @@ -457,7 +457,7 @@ extern "C" { target->used = link_stat.st_size; - if (readlinkat(at_id, path, target->string, target->used) < 0) { + if (readlinkat(at_id, path.string, target->string, target->used) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == EINVAL) return F_status_set_error(F_parameter); @@ -477,9 +477,9 @@ extern "C" { #endif // !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_mode_set_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_mode_set(const f_string_t path, const mode_t mode) { + f_status_t private_f_file_mode_set(const f_string_static_t path, const mode_t mode) { - if (chmod(path, mode) < 0) { + if (chmod(path.string, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -499,9 +499,9 @@ extern "C" { #endif // !defined(_di_f_file_mode_set_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_mode_set_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_mode_set_at(const int at_id, const f_string_t path, const mode_t mode) { + f_status_t private_f_file_mode_set_at(const int at_id, const f_string_static_t path, const mode_t mode) { - if (fchmodat(at_id, path, mode, 0) < 0) { + if (fchmodat(at_id, path.string, mode, 0) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -522,13 +522,13 @@ extern "C" { #endif // !defined(_di_f_file_mode_set_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_open(const f_string_t path, const mode_t mode, f_file_t *file) { + f_status_t private_f_file_open(const f_string_static_t path, const mode_t mode, f_file_t *file) { if (!mode) { - file->id = open(path, file->flag); + file->id = open(path.string, file->flag); } else { - file->id = open(path, file->flag, mode); + file->id = open(path.string, file->flag, mode); } if (file->id == -1) { @@ -560,13 +560,13 @@ extern "C" { #endif // !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_open_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_open_at(const int at_id, const f_string_t path, const mode_t mode, f_file_t *file) { + f_status_t private_f_file_open_at(const int at_id, const f_string_static_t path, const mode_t mode, f_file_t *file) { if (!mode) { - file->id = openat(at_id, path, file->flag); + file->id = openat(at_id, path.string, file->flag); } else { - file->id = openat(at_id, path, file->flag, mode); + file->id = openat(at_id, path.string, file->flag, mode); } if (file->id == -1) { @@ -599,13 +599,13 @@ extern "C" { #endif // !defined(_di_f_file_open_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference) { + f_status_t private_f_file_role_change(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference) { int result = 0; if (dereference) { if (uid != -1) { - result = chown(path, uid, -1); + result = chown(path.string, uid, -1); if (result < 0 && errno == EPERM) { return F_status_set_error(F_access_owner); @@ -613,7 +613,7 @@ extern "C" { } if (result == 0 && gid != -1) { - result = chown(path, -1, gid); + result = chown(path.string, -1, gid); if (result < 0 && errno == EPERM) { return F_status_set_error(F_access_group); @@ -622,7 +622,7 @@ extern "C" { } else { if (uid != -1) { - result = lchown(path, uid, -1); + result = lchown(path.string, uid, -1); if (result < 0 && errno == EPERM) { return F_status_set_error(F_access_owner); @@ -630,7 +630,7 @@ extern "C" { } if (gid != -1) { - result = lchown(path, -1, gid); + result = lchown(path.string, -1, gid); if (result < 0 && errno == EPERM) { return F_status_set_error(F_access_group); @@ -657,12 +657,12 @@ extern "C" { #endif // !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_role_change_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag) { + f_status_t private_f_file_role_change_at(const int at_id, const f_string_static_t path, const uid_t uid, const gid_t gid, const int flag) { int result = 0; if (uid != -1) { - result = fchownat(at_id, path, uid, -1, flag); + result = fchownat(at_id, path.string, uid, -1, flag); if (result < 0 && errno == EPERM) { return F_status_set_error(F_access_owner); @@ -670,7 +670,7 @@ extern "C" { } if (gid != -1) { - result = fchownat(at_id, path, -1, gid, flag); + result = fchownat(at_id, path.string, -1, gid, flag); if (result < 0 && errno == EPERM) { return F_status_set_error(F_access_group); @@ -697,9 +697,9 @@ extern "C" { #endif // !defined(_di_f_file_role_change_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) - f_status_t private_f_file_stat(const f_string_t path, const bool dereference, struct stat *file_stat) { + f_status_t private_f_file_stat(const f_string_static_t path, const bool dereference, struct stat *file_stat) { - if ((dereference ? stat(path, file_stat) : lstat(path, file_stat)) < 0) { + if ((dereference ? stat(path.string, file_stat) : lstat(path.string, file_stat)) < 0) { if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == ENOMEM) return F_status_set_error(F_memory_not); @@ -717,9 +717,9 @@ extern "C" { #endif // !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_stat_at_) || !defined(_di_f_file_copy_at_) - f_status_t private_f_file_stat_at(const int at_id, const f_string_t path, const int flag, struct stat *file_stat) { + f_status_t private_f_file_stat_at(const int at_id, const f_string_static_t path, const int flag, struct stat *file_stat) { - if (fstatat(at_id, path, file_stat, flag) < 0) { + if (fstatat(at_id, path.string, file_stat, flag) < 0) { if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == ENOMEM) return F_status_set_error(F_memory_not); @@ -767,7 +767,8 @@ extern "C" { if (flag & F_file_flag_truncate_d) { return f_file_open_mode_read_truncate_s.string; } - else if (flag & F_file_flag_append_d) { + + if (flag & F_file_flag_append_d) { return f_file_open_mode_read_append_s.string; } @@ -789,7 +790,7 @@ extern "C" { #endif // !defined(_di_f_file_stream_descriptor_) || !defined(_di_f_file_stream_open_) || !defined(_di_f_file_stream_reopen_) #if !defined(f_file_stream_write) || !defined(_di_f_file_stream_write_block_) || !defined(f_file_stream_write_until) || !defined(f_file_stream_write_range) - f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_t string, const f_array_length_t total, f_array_length_t *written) { + f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t total, f_array_length_t *written) { *written = 0; @@ -813,7 +814,7 @@ extern "C" { while (*written < write_max) { - size_write = fwrite(string + *written, write_amount, write_size, file.stream); + size_write = fwrite(buffer.string + *written, write_amount, write_size, file.stream); if (size_write < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); @@ -839,7 +840,7 @@ extern "C" { #endif // !defined(f_file_stream_write) || !defined(_di_f_file_stream_write_block_) || !defined(f_file_stream_write_until) || !defined(f_file_stream_write_range) #if !defined(f_file_write) || !defined(_di_f_file_write_block_) || !defined(f_file_write_until) || !defined(f_file_write_range) - f_status_t private_f_file_write_until(const f_file_t file, const f_string_t string, const f_array_length_t total, f_array_length_t *written) { + f_status_t private_f_file_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t total, f_array_length_t *written) { *written = 0; @@ -852,7 +853,7 @@ extern "C" { write_size = write_max; } - while (*written < write_max && (size_write = write(file.id, string + *written, write_size)) > 0) { + while (*written < write_max && (size_write = write(file.id, buffer.string + *written, write_size)) > 0) { *written += size_write; diff --git a/level_0/f_file/c/private-file.h b/level_0/f_file/c/private-file.h index 45cfa13..fb2ae16 100644 --- a/level_0/f_file/c/private-file.h +++ b/level_0/f_file/c/private-file.h @@ -93,7 +93,7 @@ extern "C" { * @see f_file_clone() */ #if !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) - extern f_status_t private_f_file_copy_content(const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_copy_content(const f_string_static_t source, const f_string_static_t destination, const f_number_unsigned_t size_block) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) /** @@ -137,7 +137,7 @@ extern "C" { * @see f_file_create() */ #if !defined(_di_f_file_create_) || !defined(_di_f_file_copy_) - extern f_status_t private_f_file_create(const f_string_t path, const mode_t mode, const bool exclusive) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_create(const f_string_static_t path, const mode_t mode, const bool exclusive) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_create_) || !defined(_di_f_file_copy_) /** @@ -182,7 +182,7 @@ extern "C" { * @see f_file_create_at() */ #if !defined(_di_f_file_create_at_) - extern f_status_t private_f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_create_at(const int at_id, const f_string_static_t path, const mode_t mode, const bool exclusive) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_create_at_) /** @@ -217,7 +217,7 @@ extern "C" { * @see f_file_copy() */ #if !defined(_di_f_file_copy_) - extern f_status_t private_f_file_create_directory(const f_string_t path, const mode_t mode) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_create_directory(const f_string_static_t path, const mode_t mode) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_copy_) /** @@ -255,7 +255,7 @@ extern "C" { * @see f_file_copy_at() */ #if !defined(_di_f_file_copy_at_) - extern f_status_t private_f_file_create_directory_at(const int at_id, const f_string_t path, const mode_t mode) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_create_directory_at(const int at_id, const f_string_static_t path, const mode_t mode) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_copy_at_) /** @@ -288,7 +288,7 @@ extern "C" { * @see f_file_copy() */ #if !defined(_di_f_file_create_fifo_) || !defined(_di_f_file_copy_) - extern f_status_t private_f_file_create_fifo(const f_string_t path, const mode_t mode) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_create_fifo(const f_string_static_t path, const mode_t mode) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_create_fifo_) || !defined(_di_f_file_copy_) /** @@ -324,7 +324,7 @@ extern "C" { * @see f_file_copy_at() */ #if !defined(_di_f_file_create_fifo_at_) || !defined(_di_f_file_copy_at_) - extern f_status_t private_f_file_create_fifo_at(const int at_id, const f_string_t path, const mode_t mode) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_create_fifo_at(const int at_id, const f_string_static_t path, const mode_t mode) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_create_fifo_at_) || !defined(_di_f_file_copy_at_) /** @@ -364,7 +364,7 @@ extern "C" { * @see f_file_create_node() */ #if !defined(_di_f_file_create_device_) || !defined(_di_f_file_create_node_) || !defined(_di_f_file_copy_) - extern f_status_t private_f_file_create_node(const f_string_t path, const mode_t mode, const dev_t device) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_create_node(const f_string_static_t path, const mode_t mode, const dev_t device) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_create_device_) || !defined(_di_f_file_create_node_) || !defined(_di_f_file_copy_) /** @@ -407,7 +407,7 @@ extern "C" { * @see f_file_create_node_at() */ #if !defined(_di_f_file_create_device_at_) || !defined(_di_f_file_create_node_at_) || !defined(_di_f_file_copy_at_) - extern f_status_t private_f_file_create_node_at(const int at_id, const f_string_t path, const mode_t mode, const dev_t device) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_create_node_at(const int at_id, const f_string_static_t path, const mode_t mode, const dev_t device) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_create_device_at_) || !defined(_di_f_file_create_node_at_) || !defined(_di_f_file_copy_at_) /** @@ -471,7 +471,7 @@ extern "C" { * @see f_file_link() */ #if !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) - extern f_status_t private_f_file_link(const f_string_t target, const f_string_t point) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_link(const f_string_static_t target, const f_string_static_t point) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) /** @@ -510,7 +510,7 @@ extern "C" { * @see f_file_link_at() */ #if !defined(_di_f_file_link_at_) - extern f_status_t private_f_file_link_at(const int at_id, const f_string_t target, const f_string_t point) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_link_at(const int at_id, const f_string_static_t target, const f_string_static_t point) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_link_at_) /** @@ -545,7 +545,7 @@ extern "C" { * @see f_file_link_read() */ #if !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) - extern f_status_t private_f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_link_read(const f_string_static_t path, const struct stat link_stat, f_string_dynamic_t *target) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) /** @@ -583,7 +583,7 @@ extern "C" { * @see f_file_link_read_at() */ #if !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_) - extern f_status_t private_f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_link_read_at(const int at_id, const f_string_static_t path, const struct stat link_stat, f_string_dynamic_t *target) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_) /** @@ -615,7 +615,7 @@ extern "C" { * @see f_file_mode_set() */ #if !defined(_di_f_file_mode_set_) || !defined(_di_f_file_copy_) - extern f_status_t private_f_file_mode_set(const f_string_t path, const mode_t mode) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_mode_set(const f_string_static_t path, const mode_t mode) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_mode_set_) || !defined(_di_f_file_copy_) /** @@ -648,7 +648,7 @@ extern "C" { * @see f_file_mode_set_at() */ #if !defined(_di_f_file_mode_set_at_) - extern f_status_t private_f_file_mode_set_at(const int at_id, const f_string_t path, const mode_t mode) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_mode_set_at(const int at_id, const f_string_static_t path, const mode_t mode) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_mode_set_at_) /** @@ -677,7 +677,7 @@ extern "C" { * @see f_file_open() */ #if !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) - extern f_status_t private_f_file_open(const f_string_t path, const mode_t mode, f_file_t *file) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_open(const f_string_static_t path, const mode_t mode, f_file_t *file) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) /** @@ -707,7 +707,7 @@ extern "C" { * @see f_file_open_at() */ #if !defined(_di_f_file_open_at_) - extern f_status_t private_f_file_open_at(const int at_id, const f_string_t path, const mode_t mode, f_file_t *file) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_open_at(const int at_id, const f_string_static_t path, const mode_t mode, f_file_t *file) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_open_at_) /** @@ -746,7 +746,7 @@ extern "C" { * @see f_file_role_change() */ #if !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_) - extern f_status_t private_f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_role_change(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_) /** @@ -786,7 +786,7 @@ extern "C" { * @see f_file_role_change_at() */ #if !defined(_di_f_file_role_change_at_) - extern f_status_t private_f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_role_change_at(const int at_id, const f_string_static_t path, const uid_t uid, const gid_t gid, const int flag) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_role_change_at_) /** @@ -821,7 +821,7 @@ extern "C" { * @see f_file_touch() */ #if !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_exists_) || !defined(_di_f_file_is_) || !defined(_di_f_file_touch_) - extern f_status_t private_f_file_stat(const f_string_t file_name, const bool dereference, struct stat *file_stat) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_stat(const f_string_static_t file_name, const bool dereference, struct stat *file_stat) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_exists_) || !defined(_di_f_file_is_) || !defined(_di_f_file_touch_) /** @@ -855,7 +855,7 @@ extern "C" { * @see f_file_touch_at() */ #if !defined(_di_f_file_stat_at_) || !defined(_di_f_file_exists_at_) || !defined(_di_f_file_touch_at_) - extern f_status_t private_f_file_stat_at(const int at_id, const f_string_t file_name, const int flag, struct stat *file_stat) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_stat_at(const int at_id, const f_string_static_t file_name, const int flag, struct stat *file_stat) F_attribute_visibility_internal_d; #endif // !defined(_di_f_file_stat_at_) || !defined(_di_f_file_exists_at_) || !defined(_di_f_file_touch_at_) /** @@ -914,7 +914,7 @@ extern "C" { * @param file * The file to write to. * The file must already be open. - * @param string + * @param buffer * The string to write to the file. * @param total * The total bytes to write. @@ -941,7 +941,7 @@ extern "C" { * @see f_file_stream_write_until() */ #if !defined(f_file_stream_write) || !defined(_di_f_file_stream_write_block_) || !defined(f_file_stream_write_until) || !defined(f_file_stream_write_range) - extern f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_t string, const f_array_length_t total, f_array_length_t *written) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t total, f_array_length_t *written) F_attribute_visibility_internal_d; #endif // !defined(f_file_stream_write) || !defined(_di_f_file_stream_write_block_) || !defined(f_file_stream_write_until) || !defined(f_file_stream_write_range) /** @@ -952,7 +952,7 @@ extern "C" { * @param file * The file to write to. * The file must already be open. - * @param string + * @param buffer * The string to write to the file. * @param total * The total bytes to write. @@ -979,7 +979,7 @@ extern "C" { * @see f_file_write_until() */ #if !defined(f_file_write) || !defined(_di_f_file_write_block_) || !defined(f_file_write_until) || !defined(f_file_write_range) - extern f_status_t private_f_file_write_until(const f_file_t file, const f_string_t string, const f_array_length_t total, f_array_length_t *written) F_attribute_visibility_internal_d; + extern f_status_t private_f_file_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t total, f_array_length_t *written) F_attribute_visibility_internal_d; #endif // !defined(f_file_write) || !defined(_di_f_file_write_block_) || !defined(f_file_write_until) || !defined(f_file_write_range) #ifdef __cplusplus diff --git a/level_0/f_fss/c/fss-common.c b/level_0/f_fss/c/fss-common.c index 64e7ab9..e8dffa0 100644 --- a/level_0/f_fss/c/fss-common.c +++ b/level_0/f_fss/c/fss-common.c @@ -6,8 +6,8 @@ extern "C" { #endif #ifndef _di_f_fss_strings_ - const f_string_static_t f_fss_string_header_s = macro_f_string_static_t_initialize2(F_fss_string_header_s, 0, F_fss_string_header_s_length); - const f_string_static_t f_fss_string_payload_s = macro_f_string_static_t_initialize2(F_fss_string_payload_s, 0, F_fss_string_payload_s_length); + const f_string_static_t f_fss_string_header_s = macro_f_string_static_t_initialize(F_fss_string_header_s, 0, F_fss_string_header_s_length); + const f_string_static_t f_fss_string_payload_s = macro_f_string_static_t_initialize(F_fss_string_payload_s, 0, F_fss_string_payload_s_length); #endif // _di_f_fss_strings_ #ifdef __cplusplus diff --git a/level_0/f_iki/c/iki-common.c b/level_0/f_iki/c/iki-common.c index 89c4156..90d9279 100644 --- a/level_0/f_iki/c/iki-common.c +++ b/level_0/f_iki/c/iki-common.c @@ -6,30 +6,30 @@ extern "C" { #endif #ifndef _di_f_iki_syntax_ - const f_string_static_t f_iki_syntax_separator_s = macro_f_string_static_t_initialize2(F_iki_syntax_separator_s, 0, F_iki_syntax_separator_s_length); - const f_string_static_t f_iki_syntax_placeholder_s = macro_f_string_static_t_initialize2(F_iki_syntax_placeholder_s, 0, F_iki_syntax_placeholder_s_length); - const f_string_static_t f_iki_syntax_quote_double_s = macro_f_string_static_t_initialize2(F_iki_syntax_quote_double_s, 0, F_iki_syntax_quote_double_s_length); - const f_string_static_t f_iki_syntax_quote_single_s = macro_f_string_static_t_initialize2(F_iki_syntax_quote_single_s, 0, F_iki_syntax_quote_single_s_length); - const f_string_static_t f_iki_syntax_slash_s = macro_f_string_static_t_initialize2(F_iki_syntax_slash_s, 0, F_iki_syntax_slash_s_length); + const f_string_static_t f_iki_syntax_separator_s = macro_f_string_static_t_initialize(F_iki_syntax_separator_s, 0, F_iki_syntax_separator_s_length); + const f_string_static_t f_iki_syntax_placeholder_s = macro_f_string_static_t_initialize(F_iki_syntax_placeholder_s, 0, F_iki_syntax_placeholder_s_length); + const f_string_static_t f_iki_syntax_quote_double_s = macro_f_string_static_t_initialize(F_iki_syntax_quote_double_s, 0, F_iki_syntax_quote_double_s_length); + const f_string_static_t f_iki_syntax_quote_single_s = macro_f_string_static_t_initialize(F_iki_syntax_quote_single_s, 0, F_iki_syntax_quote_single_s_length); + const f_string_static_t f_iki_syntax_slash_s = macro_f_string_static_t_initialize(F_iki_syntax_slash_s, 0, F_iki_syntax_slash_s_length); #endif //_di_f_iki_syntax_ #ifndef _di_iki_vocabulary_0001_s_ - const f_string_static_t f_iki_vocabulary_0001_address_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_address_s, 0, F_iki_vocabulary_0001_address_s_length); - const f_string_static_t f_iki_vocabulary_0001_code_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_code_s, 0, F_iki_vocabulary_0001_code_s_length); - const f_string_static_t f_iki_vocabulary_0001_email_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_email_s, 0, F_iki_vocabulary_0001_email_s_length); - const f_string_static_t f_iki_vocabulary_0001_name_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_name_s, 0, F_iki_vocabulary_0001_name_s_length); - const f_string_static_t f_iki_vocabulary_0001_phone_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_phone_s, 0, F_iki_vocabulary_0001_phone_s_length); - const f_string_static_t f_iki_vocabulary_0001_quote_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_quote_s, 0, F_iki_vocabulary_0001_quote_s_length); - const f_string_static_t f_iki_vocabulary_0001_uri_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_uri_s, 0, F_iki_vocabulary_0001_uri_s_length); - const f_string_static_t f_iki_vocabulary_0001_url_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_url_s, 0, F_iki_vocabulary_0001_url_s_length); - const f_string_static_t f_iki_vocabulary_0001_urn_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_urn_s, 0, F_iki_vocabulary_0001_urn_s_length); - const f_string_static_t f_iki_vocabulary_0001_variable_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0001_variable_s, 0, F_iki_vocabulary_0001_variable_s_length); + const f_string_static_t f_iki_vocabulary_0001_address_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_address_s, 0, F_iki_vocabulary_0001_address_s_length); + const f_string_static_t f_iki_vocabulary_0001_code_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_code_s, 0, F_iki_vocabulary_0001_code_s_length); + const f_string_static_t f_iki_vocabulary_0001_email_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_email_s, 0, F_iki_vocabulary_0001_email_s_length); + const f_string_static_t f_iki_vocabulary_0001_name_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_name_s, 0, F_iki_vocabulary_0001_name_s_length); + const f_string_static_t f_iki_vocabulary_0001_phone_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_phone_s, 0, F_iki_vocabulary_0001_phone_s_length); + const f_string_static_t f_iki_vocabulary_0001_quote_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_quote_s, 0, F_iki_vocabulary_0001_quote_s_length); + const f_string_static_t f_iki_vocabulary_0001_uri_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_uri_s, 0, F_iki_vocabulary_0001_uri_s_length); + const f_string_static_t f_iki_vocabulary_0001_url_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_url_s, 0, F_iki_vocabulary_0001_url_s_length); + const f_string_static_t f_iki_vocabulary_0001_urn_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_urn_s, 0, F_iki_vocabulary_0001_urn_s_length); + const f_string_static_t f_iki_vocabulary_0001_variable_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0001_variable_s, 0, F_iki_vocabulary_0001_variable_s_length); #endif // _di_iki_vocabulary_0001_s_ #ifndef _di_iki_vocabulary_0002_s_ - const f_string_static_t f_iki_vocabulary_0002_context_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_context_s, 0, F_iki_vocabulary_0002_context_s_length); - const f_string_static_t f_iki_vocabulary_0002_define_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_define_s, 0, F_iki_vocabulary_0002_define_s_length); - const f_string_static_t f_iki_vocabulary_0002_parameter_s = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_parameter_s, 0, F_iki_vocabulary_0002_parameter_s_length); + const f_string_static_t f_iki_vocabulary_0002_context_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_context_s, 0, F_iki_vocabulary_0002_context_s_length); + const f_string_static_t f_iki_vocabulary_0002_define_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_define_s, 0, F_iki_vocabulary_0002_define_s_length); + const f_string_static_t f_iki_vocabulary_0002_parameter_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_parameter_s, 0, F_iki_vocabulary_0002_parameter_s_length); #endif // _di_iki_vocabulary_0002_s_ #ifdef __cplusplus diff --git a/level_0/f_path/c/path-common.c b/level_0/f_path/c/path-common.c index f79b750..117d3fd 100644 --- a/level_0/f_path/c/path-common.c +++ b/level_0/f_path/c/path-common.c @@ -6,82 +6,82 @@ extern "C" { #endif #ifndef _di_f_path_defines_ - const f_string_static_t f_path_separator_s = macro_f_string_static_t_initialize2(F_string_ascii_slash_forward_s, 0, F_string_ascii_slash_forward_s_length); - const f_string_static_t f_path_separator_current_s = macro_f_string_static_t_initialize2(F_string_ascii_period_s, 0, F_string_ascii_period_s_length); - const f_string_static_t f_path_separator_variable_s = macro_f_string_static_t_initialize2(F_string_ascii_colon_s, 0, F_string_ascii_colon_s_length); + const f_string_static_t f_path_separator_s = macro_f_string_static_t_initialize(F_string_ascii_slash_forward_s, 0, F_string_ascii_slash_forward_s_length); + const f_string_static_t f_path_separator_current_s = macro_f_string_static_t_initialize(F_string_ascii_period_s, 0, F_string_ascii_period_s_length); + const f_string_static_t f_path_separator_variable_s = macro_f_string_static_t_initialize(F_string_ascii_colon_s, 0, F_string_ascii_colon_s_length); - const f_string_static_t f_path_extension_separator_s = macro_f_string_static_t_initialize2(F_string_ascii_period_s, 0, F_string_ascii_period_s_length); + const f_string_static_t f_path_extension_separator_s = macro_f_string_static_t_initialize(F_string_ascii_period_s, 0, F_string_ascii_period_s_length); - const f_string_static_t f_path_environment_s = macro_f_string_static_t_initialize2(F_path_environment_s, 0, F_path_environment_s_length); - const f_string_static_t f_path_home_wildcard_s = macro_f_string_static_t_initialize2(F_string_ascii_tilde_s, 0, F_string_ascii_tilde_s_length); - const f_string_static_t f_path_present_working_s = macro_f_string_static_t_initialize2(F_path_present_working_s, 0, F_path_present_working_s_length); - const f_string_static_t f_path_present_working_old_s = macro_f_string_static_t_initialize2(F_path_present_working_old_s, 0, F_path_present_working_old_s_length); + const f_string_static_t f_path_environment_s = macro_f_string_static_t_initialize(F_path_environment_s, 0, F_path_environment_s_length); + const f_string_static_t f_path_home_wildcard_s = macro_f_string_static_t_initialize(F_string_ascii_tilde_s, 0, F_string_ascii_tilde_s_length); + const f_string_static_t f_path_present_working_s = macro_f_string_static_t_initialize(F_path_present_working_s, 0, F_path_present_working_s_length); + const f_string_static_t f_path_present_working_old_s = macro_f_string_static_t_initialize(F_path_present_working_old_s, 0, F_path_present_working_old_s_length); #endif // _di_f_path_defines_ #ifdef _di_path_tree_s_ // KFS Root Level - const f_string_static_t f_path_tree_devices_s = macro_f_string_static_t_initialize2(F_path_tree_devices_s, 0, F_path_tree_devices_s_length); - const f_string_static_t f_path_tree_external_s = macro_f_string_static_t_initialize2(F_path_tree_external_s, 0, F_path_tree_external_s_length); - const f_string_static_t f_path_tree_libraries_s = macro_f_string_static_t_initialize2(F_path_tree_libraries_s, 0, F_path_tree_libraries_s_length); - const f_string_static_t f_path_tree_programs_s = macro_f_string_static_t_initialize2(F_path_tree_programs_s, 0,F_path_tree_programs_s _length); - const f_string_static_t f_path_tree_temporary_s = macro_f_string_static_t_initialize2(F_path_tree_temporary_s, 0, F_path_tree_temporary_s_length); - const f_string_static_t f_path_tree_home_s = macro_f_string_static_t_initialize2(F_path_tree_home_s, 0, F_path_tree_home_s_length); - const f_string_static_t f_path_tree_run_s = macro_f_string_static_t_initialize2(F_path_tree_run_s, 0, F_path_tree_run_s_length); - const f_string_static_t f_path_tree_binary_s = macro_f_string_static_t_initialize2(F_path_tree_binary_s, 0, F_path_tree_binary_s_length); + const f_string_static_t f_path_tree_devices_s = macro_f_string_static_t_initialize(F_path_tree_devices_s, 0, F_path_tree_devices_s_length); + const f_string_static_t f_path_tree_external_s = macro_f_string_static_t_initialize(F_path_tree_external_s, 0, F_path_tree_external_s_length); + const f_string_static_t f_path_tree_libraries_s = macro_f_string_static_t_initialize(F_path_tree_libraries_s, 0, F_path_tree_libraries_s_length); + const f_string_static_t f_path_tree_programs_s = macro_f_string_static_t_initialize(F_path_tree_programs_s, 0,F_path_tree_programs_s _length); + const f_string_static_t f_path_tree_temporary_s = macro_f_string_static_t_initialize(F_path_tree_temporary_s, 0, F_path_tree_temporary_s_length); + const f_string_static_t f_path_tree_home_s = macro_f_string_static_t_initialize(F_path_tree_home_s, 0, F_path_tree_home_s_length); + const f_string_static_t f_path_tree_run_s = macro_f_string_static_t_initialize(F_path_tree_run_s, 0, F_path_tree_run_s_length); + const f_string_static_t f_path_tree_binary_s = macro_f_string_static_t_initialize(F_path_tree_binary_s, 0, F_path_tree_binary_s_length); // FHS Root Level - const f_string_static_t f_path_tree_boot_s = macro_f_string_static_t_initialize2(F_path_tree_boot_s, 0, F_path_tree_boot_s_length); - const f_string_static_t f_path_tree_hardware_s = macro_f_string_static_t_initialize2(F_path_tree_hardware_s, 0, F_path_tree_hardware_s_length); - const f_string_static_t f_path_tree_processes_s = macro_f_string_static_t_initialize2(F_path_tree_processes_s, 0, F_path_tree_processes_s_length); - const f_string_static_t f_path_tree_system_s = macro_f_string_static_t_initialize2(F_path_tree_system_s, 0, F_path_tree_system_s_length); + const f_string_static_t f_path_tree_boot_s = macro_f_string_static_t_initialize(F_path_tree_boot_s, 0, F_path_tree_boot_s_length); + const f_string_static_t f_path_tree_hardware_s = macro_f_string_static_t_initialize(F_path_tree_hardware_s, 0, F_path_tree_hardware_s_length); + const f_string_static_t f_path_tree_processes_s = macro_f_string_static_t_initialize(F_path_tree_processes_s, 0, F_path_tree_processes_s_length); + const f_string_static_t f_path_tree_system_s = macro_f_string_static_t_initialize(F_path_tree_system_s, 0, F_path_tree_system_s_length); // Program Level - const f_string_static_t f_path_tree_programs_public_s = macro_f_string_static_t_initialize2(F_path_tree_programs_public_s, 0, F_path_tree_programs_public_s_length); - const f_string_static_t f_path_tree_programs_system_s = macro_f_string_static_t_initialize2(F_path_tree_programs_system_s, 0, F_path_tree_programs_system_s_length); - const f_string_static_t f_path_tree_programs_remote_s = macro_f_string_static_t_initialize2(F_path_tree_programs_remote_s, 0, F_path_tree_programs_remote_s_length); - const f_string_static_t f_path_tree_programs_services_s = macro_f_string_static_t_initialize2(F_path_tree_programs_services_s, 0, F_path_tree_programs_services_s_length); - const f_string_static_t f_path_tree_programs_toolchain_s = macro_f_string_static_t_initialize2(F_path_tree_programs_toolchain_s, 0, F_path_tree_programs_toolchain_s_length); - const f_string_static_t f_path_tree_programs_users_s = macro_f_string_static_t_initialize2(F_path_tree_programs_users_s, 0, F_path_tree_programs_users_s_length); - const f_string_static_t f_path_tree_programs_susers_s = macro_f_string_static_t_initialize2(F_path_tree_programs_susers_s, 0, F_path_tree_programs_susers_s_length); - const f_string_static_t f_path_tree_programs_boot_s = macro_f_string_static_t_initialize2(F_path_tree_programs_boot_s, 0, F_path_tree_programs_boot_s_length); - const f_string_static_t f_path_tree_programs_sboot_s = macro_f_string_static_t_initialize2(F_path_tree_programs_sboot_s, 0, F_path_tree_programs_sboot_s_length); + const f_string_static_t f_path_tree_programs_public_s = macro_f_string_static_t_initialize(F_path_tree_programs_public_s, 0, F_path_tree_programs_public_s_length); + const f_string_static_t f_path_tree_programs_system_s = macro_f_string_static_t_initialize(F_path_tree_programs_system_s, 0, F_path_tree_programs_system_s_length); + const f_string_static_t f_path_tree_programs_remote_s = macro_f_string_static_t_initialize(F_path_tree_programs_remote_s, 0, F_path_tree_programs_remote_s_length); + const f_string_static_t f_path_tree_programs_services_s = macro_f_string_static_t_initialize(F_path_tree_programs_services_s, 0, F_path_tree_programs_services_s_length); + const f_string_static_t f_path_tree_programs_toolchain_s = macro_f_string_static_t_initialize(F_path_tree_programs_toolchain_s, 0, F_path_tree_programs_toolchain_s_length); + const f_string_static_t f_path_tree_programs_users_s = macro_f_string_static_t_initialize(F_path_tree_programs_users_s, 0, F_path_tree_programs_users_s_length); + const f_string_static_t f_path_tree_programs_susers_s = macro_f_string_static_t_initialize(F_path_tree_programs_susers_s, 0, F_path_tree_programs_susers_s_length); + const f_string_static_t f_path_tree_programs_boot_s = macro_f_string_static_t_initialize(F_path_tree_programs_boot_s, 0, F_path_tree_programs_boot_s_length); + const f_string_static_t f_path_tree_programs_sboot_s = macro_f_string_static_t_initialize(F_path_tree_programs_sboot_s, 0, F_path_tree_programs_sboot_s_length); // Library Level - const f_string_static_t f_path_tree_libraries_public_s = macro_f_string_static_t_initialize2(F_path_tree_libraries_public_s, 0, F_path_tree_libraries_public_s_length); - const f_string_static_t f_path_tree_libraries_system_s = macro_f_string_static_t_initialize2(F_path_tree_libraries_system_s, 0, F_path_tree_libraries_system_s_length); - const f_string_static_t f_path_tree_libraries_remote_s = macro_f_string_static_t_initialize2(F_path_tree_libraries_remote_s, 0, F_path_tree_libraries_remote_s_length); - const f_string_static_t f_path_tree_libraries_services_s = macro_f_string_static_t_initialize2(F_path_tree_libraries_services_s, 0, F_path_tree_libraries_services_s_length); - const f_string_static_t f_path_tree_libraries_toolchain_s = macro_f_string_static_t_initialize2(F_path_tree_libraries_toolchain_s, 0, F_path_tree_libraries_toolchain_s_length); - const f_string_static_t f_path_tree_libraries_users_s = macro_f_string_static_t_initialize2(F_path_tree_libraries_users_s, 0, F_path_tree_libraries_users_s_length); - const f_string_static_t f_path_tree_libraries_boot_s = macro_f_string_static_t_initialize2(F_path_tree_libraries_boot_s, 0, F_path_tree_libraries_boot_s_length); + const f_string_static_t f_path_tree_libraries_public_s = macro_f_string_static_t_initialize(F_path_tree_libraries_public_s, 0, F_path_tree_libraries_public_s_length); + const f_string_static_t f_path_tree_libraries_system_s = macro_f_string_static_t_initialize(F_path_tree_libraries_system_s, 0, F_path_tree_libraries_system_s_length); + const f_string_static_t f_path_tree_libraries_remote_s = macro_f_string_static_t_initialize(F_path_tree_libraries_remote_s, 0, F_path_tree_libraries_remote_s_length); + const f_string_static_t f_path_tree_libraries_services_s = macro_f_string_static_t_initialize(F_path_tree_libraries_services_s, 0, F_path_tree_libraries_services_s_length); + const f_string_static_t f_path_tree_libraries_toolchain_s = macro_f_string_static_t_initialize(F_path_tree_libraries_toolchain_s, 0, F_path_tree_libraries_toolchain_s_length); + const f_string_static_t f_path_tree_libraries_users_s = macro_f_string_static_t_initialize(F_path_tree_libraries_users_s, 0, F_path_tree_libraries_users_s_length); + const f_string_static_t f_path_tree_libraries_boot_s = macro_f_string_static_t_initialize(F_path_tree_libraries_boot_s, 0, F_path_tree_libraries_boot_s_length); // Home Level - const f_string_static_t f_path_tree_home_services_s = macro_f_string_static_t_initialize2(F_path_tree_home_services_s, 0, F_path_tree_home_services_s_length); - const f_string_static_t f_path_tree_home_share_s = macro_f_string_static_t_initialize2(F_path_tree_home_share_s, 0, F_path_tree_home_share_s_length); - const f_string_static_t f_path_tree_home_users_s = macro_f_string_static_t_initialize2(F_path_tree_home_users_s, 0, F_path_tree_home_users_s_length); - const f_string_static_t f_path_tree_home_websites_s = macro_f_string_static_t_initialize2(F_path_tree_home_websites_s, 0, F_path_tree_home_websites_s_length); + const f_string_static_t f_path_tree_home_services_s = macro_f_string_static_t_initialize(F_path_tree_home_services_s, 0, F_path_tree_home_services_s_length); + const f_string_static_t f_path_tree_home_share_s = macro_f_string_static_t_initialize(F_path_tree_home_share_s, 0, F_path_tree_home_share_s_length); + const f_string_static_t f_path_tree_home_users_s = macro_f_string_static_t_initialize(F_path_tree_home_users_s, 0, F_path_tree_home_users_s_length); + const f_string_static_t f_path_tree_home_websites_s = macro_f_string_static_t_initialize(F_path_tree_home_websites_s, 0, F_path_tree_home_websites_s_length); // System Level - const f_string_static_t f_path_tree_system_logs_s = macro_f_string_static_t_initialize2(F_path_tree_system_logs_s, 0, F_path_tree_system_logs_s_length); - const f_string_static_t f_path_tree_system_settings_s = macro_f_string_static_t_initialize2(F_path_tree_system_settings_s, 0, F_path_tree_system_settings_s_length); - const f_string_static_t f_path_tree_system_data_s = macro_f_string_static_t_initialize2(F_path_tree_system_data_s, 0, F_path_tree_system_data_s_length); - const f_string_static_t f_path_tree_system_variables_s = macro_f_string_static_t_initialize2(F_path_tree_system_variables_s, 0, F_path_tree_system_variables_s_length); + const f_string_static_t f_path_tree_system_logs_s = macro_f_string_static_t_initialize(F_path_tree_system_logs_s, 0, F_path_tree_system_logs_s_length); + const f_string_static_t f_path_tree_system_settings_s = macro_f_string_static_t_initialize(F_path_tree_system_settings_s, 0, F_path_tree_system_settings_s_length); + const f_string_static_t f_path_tree_system_data_s = macro_f_string_static_t_initialize(F_path_tree_system_data_s, 0, F_path_tree_system_data_s_length); + const f_string_static_t f_path_tree_system_variables_s = macro_f_string_static_t_initialize(F_path_tree_system_variables_s, 0, F_path_tree_system_variables_s_length); // Temporary Level - const f_string_static_t f_path_tree_temporary_public_s = macro_f_string_static_t_initialize2(F_path_tree_temporary_public_s, 0, F_path_tree_temporary_public_s_length); - const f_string_static_t f_path_tree_temporary_services_s = macro_f_string_static_t_initialize2(F_path_tree_temporary_services_s, 0, F_path_tree_temporary_services_s_length); - const f_string_static_t f_path_tree_temporary_users_s = macro_f_string_static_t_initialize2(F_path_tree_temporary_users_s, 0, F_path_tree_temporary_users_s_length); - const f_string_static_t f_path_tree_temporary_variables_s = macro_f_string_static_t_initialize2(F_path_tree_temporary_variables_s, 0, F_path_tree_temporary_variables_s_length); + const f_string_static_t f_path_tree_temporary_public_s = macro_f_string_static_t_initialize(F_path_tree_temporary_public_s, 0, F_path_tree_temporary_public_s_length); + const f_string_static_t f_path_tree_temporary_services_s = macro_f_string_static_t_initialize(F_path_tree_temporary_services_s, 0, F_path_tree_temporary_services_s_length); + const f_string_static_t f_path_tree_temporary_users_s = macro_f_string_static_t_initialize(F_path_tree_temporary_users_s, 0, F_path_tree_temporary_users_s_length); + const f_string_static_t f_path_tree_temporary_variables_s = macro_f_string_static_t_initialize(F_path_tree_temporary_variables_s, 0, F_path_tree_temporary_variables_s_length); // Private User Directories - const f_string_static_t f_path_user_downloads_s = macro_f_string_static_t_initialize2(F_path_user_downloads_s, 0, F_path_user_downloads_s_length); - const f_string_static_t f_path_user_desktop_s = macro_f_string_static_t_initialize2(F_path_user_desktop_s, 0, F_path_user_desktop_s_length); - const f_string_static_t f_path_user_private_s = macro_f_string_static_t_initialize2(F_path_user_private_s, 0, F_path_user_private_s_length); - const f_string_static_t f_path_user_settings_s = macro_f_string_static_t_initialize2(F_path_user_settings_s, 0, F_path_user_settings_s_length); - const f_string_static_t f_path_user_data_s = macro_f_string_static_t_initialize2(F_path_user_data_s, 0, F_path_user_data_s_length); - const f_string_static_t f_path_user_temporary_s = macro_f_string_static_t_initialize2(F_path_user_temporary_s, 0, F_path_user_temporary_s_length); - const f_string_static_t f_path_user_shared_s = macro_f_string_static_t_initialize2(F_path_user_shared_s, 0, F_path_user_shared_s_length); + const f_string_static_t f_path_user_downloads_s = macro_f_string_static_t_initialize(F_path_user_downloads_s, 0, F_path_user_downloads_s_length); + const f_string_static_t f_path_user_desktop_s = macro_f_string_static_t_initialize(F_path_user_desktop_s, 0, F_path_user_desktop_s_length); + const f_string_static_t f_path_user_private_s = macro_f_string_static_t_initialize(F_path_user_private_s, 0, F_path_user_private_s_length); + const f_string_static_t f_path_user_settings_s = macro_f_string_static_t_initialize(F_path_user_settings_s, 0, F_path_user_settings_s_length); + const f_string_static_t f_path_user_data_s = macro_f_string_static_t_initialize(F_path_user_data_s, 0, F_path_user_data_s_length); + const f_string_static_t f_path_user_temporary_s = macro_f_string_static_t_initialize(F_path_user_temporary_s, 0, F_path_user_temporary_s_length); + const f_string_static_t f_path_user_shared_s = macro_f_string_static_t_initialize(F_path_user_shared_s, 0, F_path_user_shared_s_length); #endif // _di_path_tree_s_ #ifdef __cplusplus diff --git a/level_0/f_print/c/print-common.c b/level_0/f_print/c/print-common.c index 0d82faf..75946eb 100644 --- a/level_0/f_print/c/print-common.c +++ b/level_0/f_print/c/print-common.c @@ -6,42 +6,42 @@ extern "C" { #endif #ifndef _di_f_print_sequences_ - const f_string_static_t f_print_sequence_acknowledge_s = macro_f_string_static_t_initialize2(F_print_sequence_acknowledge_s, 0, F_print_sequence_acknowledge_s_length); - const f_string_static_t f_print_sequence_acknowledge_negative_s = macro_f_string_static_t_initialize2(F_print_sequence_acknowledge_negative_s, 0, F_print_sequence_acknowledge_negative_s_length); - const f_string_static_t f_print_sequence_backspace_s = macro_f_string_static_t_initialize2(F_print_sequence_backspace_s, 0, F_print_sequence_backspace_s_length); - const f_string_static_t f_print_sequence_bell_s = macro_f_string_static_t_initialize2(F_print_sequence_bell_s, 0, F_print_sequence_bell_s_length); - const f_string_static_t f_print_sequence_cancel_s = macro_f_string_static_t_initialize2(F_print_sequence_cancel_s, 0, F_print_sequence_cancel_s_length); - const f_string_static_t f_print_sequence_carriage_return_s = macro_f_string_static_t_initialize2(F_print_sequence_carriage_return_s, 0, F_print_sequence_carriage_return_s_length); - const f_string_static_t f_print_sequence_data_link_escape_s = macro_f_string_static_t_initialize2(F_print_sequence_data_link_escape_s, 0, F_print_sequence_data_link_escape_s_length); - const f_string_static_t f_print_sequence_delete_s = macro_f_string_static_t_initialize2(F_print_sequence_delete_s, 0, F_print_sequence_delete_s_length); - const f_string_static_t f_print_sequence_device_control_1_s = macro_f_string_static_t_initialize2(F_print_sequence_device_control_1_s, 0, F_print_sequence_device_control_1_s_length); - const f_string_static_t f_print_sequence_device_control_2_s = macro_f_string_static_t_initialize2(F_print_sequence_device_control_2_s, 0, F_print_sequence_device_control_2_s_length); - const f_string_static_t f_print_sequence_device_control_3_s = macro_f_string_static_t_initialize2(F_print_sequence_device_control_3_s, 0, F_print_sequence_device_control_3_s_length); - const f_string_static_t f_print_sequence_device_control_4_s = macro_f_string_static_t_initialize2(F_print_sequence_device_control_4_s, 0, F_print_sequence_device_control_4_s_length); - const f_string_static_t f_print_sequence_end_of_medium_s = macro_f_string_static_t_initialize2(F_print_sequence_end_of_medium_s, 0, F_print_sequence_end_of_medium_s_length); - const f_string_static_t f_print_sequence_end_of_text_s = macro_f_string_static_t_initialize2(F_print_sequence_end_of_text_s, 0, F_print_sequence_end_of_text_s_length); - const f_string_static_t f_print_sequence_end_of_transmission_s = macro_f_string_static_t_initialize2(F_print_sequence_end_of_transmission_s, 0, F_print_sequence_end_of_transmission_s_length); - const f_string_static_t f_print_sequence_end_of_transmission_block_s = macro_f_string_static_t_initialize2(F_print_sequence_end_of_transmission_block_s, 0, F_print_sequence_end_of_transmission_block_s_length); - const f_string_static_t f_print_sequence_enquiry_s = macro_f_string_static_t_initialize2(F_print_sequence_enquiry_s, 0, F_print_sequence_enquiry_s_length); - const f_string_static_t f_print_sequence_escape_s = macro_f_string_static_t_initialize2(F_print_sequence_escape_s, 0, F_print_sequence_escape_s_length); - const f_string_static_t f_print_sequence_form_feed_s = macro_f_string_static_t_initialize2(F_print_sequence_form_feed_s, 0, F_print_sequence_form_feed_s_length); - const f_string_static_t f_print_sequence_line_feed_s = macro_f_string_static_t_initialize2(F_print_sequence_line_feed_s, 0, F_print_sequence_line_feed_s_length); - const f_string_static_t f_print_sequence_line_new_s = macro_f_string_static_t_initialize2(F_print_sequence_line_new_s, 0, F_print_sequence_line_new_s_length); - const f_string_static_t f_print_sequence_null_s = macro_f_string_static_t_initialize2(F_print_sequence_null_s, 0, F_print_sequence_null_s_length); - const f_string_static_t f_print_sequence_separator_file_s = macro_f_string_static_t_initialize2(F_print_sequence_separator_file_s, 0, F_print_sequence_separator_file_s_length); - const f_string_static_t f_print_sequence_separator_group_s = macro_f_string_static_t_initialize2(F_print_sequence_separator_group_s, 0, F_print_sequence_separator_group_s_length); - const f_string_static_t f_print_sequence_separator_record_s = macro_f_string_static_t_initialize2(F_print_sequence_separator_record_s, 0, F_print_sequence_separator_record_s_length); - const f_string_static_t f_print_sequence_separator_unit_s = macro_f_string_static_t_initialize2(F_print_sequence_separator_unit_s, 0, F_print_sequence_separator_unit_s_length); - const f_string_static_t f_print_sequence_shift_in_s = macro_f_string_static_t_initialize2(F_print_sequence_shift_in_s, 0, F_print_sequence_shift_in_s_length); - const f_string_static_t f_print_sequence_shift_out_s = macro_f_string_static_t_initialize2(F_print_sequence_shift_out_s, 0, F_print_sequence_shift_out_s_length); - const f_string_static_t f_print_sequence_space_s = macro_f_string_static_t_initialize2(F_print_sequence_space_s, 0, F_print_sequence_space_s_length); - const f_string_static_t f_print_sequence_start_of_header_s = macro_f_string_static_t_initialize2(F_print_sequence_start_of_header_s, 0, F_print_sequence_start_of_header_s_length); - const f_string_static_t f_print_sequence_start_of_text_s = macro_f_string_static_t_initialize2(F_print_sequence_start_of_text_s, 0, F_print_sequence_start_of_text_s_length); - const f_string_static_t f_print_sequence_substitute_s = macro_f_string_static_t_initialize2(F_print_sequence_substitute_s, 0, F_print_sequence_substitute_s_length); - const f_string_static_t f_print_sequence_synchronous_idle_s = macro_f_string_static_t_initialize2(F_print_sequence_synchronous_idle_s, 0, F_print_sequence_synchronous_idle_s_length); - const f_string_static_t f_print_sequence_tab_s = macro_f_string_static_t_initialize2(F_print_sequence_tab_s, 0, F_print_sequence_tab_s_length); - const f_string_static_t f_print_sequence_tab_vertical_s = macro_f_string_static_t_initialize2(F_print_sequence_tab_vertical_s, 0, F_print_sequence_tab_vertical_s_length); - const f_string_static_t f_print_sequence_unknown_s = macro_f_string_static_t_initialize2(F_print_sequence_unknown_s, 0, F_print_sequence_unknown_s_length); + const f_string_static_t f_print_sequence_acknowledge_s = macro_f_string_static_t_initialize(F_print_sequence_acknowledge_s, 0, F_print_sequence_acknowledge_s_length); + const f_string_static_t f_print_sequence_acknowledge_negative_s = macro_f_string_static_t_initialize(F_print_sequence_acknowledge_negative_s, 0, F_print_sequence_acknowledge_negative_s_length); + const f_string_static_t f_print_sequence_backspace_s = macro_f_string_static_t_initialize(F_print_sequence_backspace_s, 0, F_print_sequence_backspace_s_length); + const f_string_static_t f_print_sequence_bell_s = macro_f_string_static_t_initialize(F_print_sequence_bell_s, 0, F_print_sequence_bell_s_length); + const f_string_static_t f_print_sequence_cancel_s = macro_f_string_static_t_initialize(F_print_sequence_cancel_s, 0, F_print_sequence_cancel_s_length); + const f_string_static_t f_print_sequence_carriage_return_s = macro_f_string_static_t_initialize(F_print_sequence_carriage_return_s, 0, F_print_sequence_carriage_return_s_length); + const f_string_static_t f_print_sequence_data_link_escape_s = macro_f_string_static_t_initialize(F_print_sequence_data_link_escape_s, 0, F_print_sequence_data_link_escape_s_length); + const f_string_static_t f_print_sequence_delete_s = macro_f_string_static_t_initialize(F_print_sequence_delete_s, 0, F_print_sequence_delete_s_length); + const f_string_static_t f_print_sequence_device_control_1_s = macro_f_string_static_t_initialize(F_print_sequence_device_control_1_s, 0, F_print_sequence_device_control_1_s_length); + const f_string_static_t f_print_sequence_device_control_2_s = macro_f_string_static_t_initialize(F_print_sequence_device_control_2_s, 0, F_print_sequence_device_control_2_s_length); + const f_string_static_t f_print_sequence_device_control_3_s = macro_f_string_static_t_initialize(F_print_sequence_device_control_3_s, 0, F_print_sequence_device_control_3_s_length); + const f_string_static_t f_print_sequence_device_control_4_s = macro_f_string_static_t_initialize(F_print_sequence_device_control_4_s, 0, F_print_sequence_device_control_4_s_length); + const f_string_static_t f_print_sequence_end_of_medium_s = macro_f_string_static_t_initialize(F_print_sequence_end_of_medium_s, 0, F_print_sequence_end_of_medium_s_length); + const f_string_static_t f_print_sequence_end_of_text_s = macro_f_string_static_t_initialize(F_print_sequence_end_of_text_s, 0, F_print_sequence_end_of_text_s_length); + const f_string_static_t f_print_sequence_end_of_transmission_s = macro_f_string_static_t_initialize(F_print_sequence_end_of_transmission_s, 0, F_print_sequence_end_of_transmission_s_length); + const f_string_static_t f_print_sequence_end_of_transmission_block_s = macro_f_string_static_t_initialize(F_print_sequence_end_of_transmission_block_s, 0, F_print_sequence_end_of_transmission_block_s_length); + const f_string_static_t f_print_sequence_enquiry_s = macro_f_string_static_t_initialize(F_print_sequence_enquiry_s, 0, F_print_sequence_enquiry_s_length); + const f_string_static_t f_print_sequence_escape_s = macro_f_string_static_t_initialize(F_print_sequence_escape_s, 0, F_print_sequence_escape_s_length); + const f_string_static_t f_print_sequence_form_feed_s = macro_f_string_static_t_initialize(F_print_sequence_form_feed_s, 0, F_print_sequence_form_feed_s_length); + const f_string_static_t f_print_sequence_line_feed_s = macro_f_string_static_t_initialize(F_print_sequence_line_feed_s, 0, F_print_sequence_line_feed_s_length); + const f_string_static_t f_print_sequence_line_new_s = macro_f_string_static_t_initialize(F_print_sequence_line_new_s, 0, F_print_sequence_line_new_s_length); + const f_string_static_t f_print_sequence_null_s = macro_f_string_static_t_initialize(F_print_sequence_null_s, 0, F_print_sequence_null_s_length); + const f_string_static_t f_print_sequence_separator_file_s = macro_f_string_static_t_initialize(F_print_sequence_separator_file_s, 0, F_print_sequence_separator_file_s_length); + const f_string_static_t f_print_sequence_separator_group_s = macro_f_string_static_t_initialize(F_print_sequence_separator_group_s, 0, F_print_sequence_separator_group_s_length); + const f_string_static_t f_print_sequence_separator_record_s = macro_f_string_static_t_initialize(F_print_sequence_separator_record_s, 0, F_print_sequence_separator_record_s_length); + const f_string_static_t f_print_sequence_separator_unit_s = macro_f_string_static_t_initialize(F_print_sequence_separator_unit_s, 0, F_print_sequence_separator_unit_s_length); + const f_string_static_t f_print_sequence_shift_in_s = macro_f_string_static_t_initialize(F_print_sequence_shift_in_s, 0, F_print_sequence_shift_in_s_length); + const f_string_static_t f_print_sequence_shift_out_s = macro_f_string_static_t_initialize(F_print_sequence_shift_out_s, 0, F_print_sequence_shift_out_s_length); + const f_string_static_t f_print_sequence_space_s = macro_f_string_static_t_initialize(F_print_sequence_space_s, 0, F_print_sequence_space_s_length); + const f_string_static_t f_print_sequence_start_of_header_s = macro_f_string_static_t_initialize(F_print_sequence_start_of_header_s, 0, F_print_sequence_start_of_header_s_length); + const f_string_static_t f_print_sequence_start_of_text_s = macro_f_string_static_t_initialize(F_print_sequence_start_of_text_s, 0, F_print_sequence_start_of_text_s_length); + const f_string_static_t f_print_sequence_substitute_s = macro_f_string_static_t_initialize(F_print_sequence_substitute_s, 0, F_print_sequence_substitute_s_length); + const f_string_static_t f_print_sequence_synchronous_idle_s = macro_f_string_static_t_initialize(F_print_sequence_synchronous_idle_s, 0, F_print_sequence_synchronous_idle_s_length); + const f_string_static_t f_print_sequence_tab_s = macro_f_string_static_t_initialize(F_print_sequence_tab_s, 0, F_print_sequence_tab_s_length); + const f_string_static_t f_print_sequence_tab_vertical_s = macro_f_string_static_t_initialize(F_print_sequence_tab_vertical_s, 0, F_print_sequence_tab_vertical_s_length); + const f_string_static_t f_print_sequence_unknown_s = macro_f_string_static_t_initialize(F_print_sequence_unknown_s, 0, F_print_sequence_unknown_s_length); #endif // _di_f_print_sequences_ #ifndef _di_f_print_sequences_set_control_ diff --git a/level_0/f_serialize/c/serialize-common.c b/level_0/f_serialize/c/serialize-common.c index df3fcf6..363d047 100644 --- a/level_0/f_serialize/c/serialize-common.c +++ b/level_0/f_serialize/c/serialize-common.c @@ -6,9 +6,9 @@ extern "C" { #endif #ifndef _di_f_serialize_splitter_s_ - const f_string_static_t f_serialize_simple_splitter_s = macro_f_string_static_t_initialize2(F_serialize_simple_splitter_s, 0, F_serialize_simple_splitter_s_length); - const f_string_static_t f_serialize_delimited_splitter_s = macro_f_string_static_t_initialize2(F_serialize_delimited_splitter_s, 0, F_serialize_delimited_splitter_s_length); - const f_string_static_t f_serialize_delimited_delimiter_s = macro_f_string_static_t_initialize2(F_serialize_delimited_delimiter_s, 0, F_serialize_delimited_delimiter_s_length); + const f_string_static_t f_serialize_simple_splitter_s = macro_f_string_static_t_initialize(F_serialize_simple_splitter_s, 0, F_serialize_simple_splitter_s_length); + const f_string_static_t f_serialize_delimited_splitter_s = macro_f_string_static_t_initialize(F_serialize_delimited_splitter_s, 0, F_serialize_delimited_splitter_s_length); + const f_string_static_t f_serialize_delimited_delimiter_s = macro_f_string_static_t_initialize(F_serialize_delimited_delimiter_s, 0, F_serialize_delimited_delimiter_s_length); #endif // _di_f_serialize_splitter_s_ #ifdef __cplusplus diff --git a/level_0/f_status_string/c/status_string.c b/level_0/f_status_string/c/status_string.c index 14dc646..f28264a 100644 --- a/level_0/f_status_string/c/status_string.c +++ b/level_0/f_status_string/c/status_string.c @@ -6,586 +6,586 @@ extern "C" { #ifndef _di_F_status_string_ #ifndef _di_F_status_boolean_ - const f_string_static_t f_status_false_s = macro_f_string_static_t_initialize2(F_status_false_s, 0, F_status_false_s_length); - const f_string_static_t f_status_true_s = macro_f_string_static_t_initialize2(F_status_true_s, 0, F_status_true_s_length); + const f_string_static_t f_status_false_s = macro_f_string_static_t_initialize(F_status_false_s, 0, F_status_false_s_length); + const f_string_static_t f_status_true_s = macro_f_string_static_t_initialize(F_status_true_s, 0, F_status_true_s_length); #endif // _di_F_status_boolean_ #ifndef _di_F_status_signal_ - const f_string_static_t f_status_signal_hangup_s = macro_f_string_static_t_initialize2(F_status_signal_hangup_s, 0, F_status_signal_hangup_s_length); - const f_string_static_t f_status_signal_interrupt_s = macro_f_string_static_t_initialize2(F_status_signal_interrupt_s, 0, F_status_signal_interrupt_s_length); - const f_string_static_t f_status_signal_quit_s = macro_f_string_static_t_initialize2(F_status_signal_quit_s, 0, F_status_signal_quit_s_length); - const f_string_static_t f_status_signal_illegal_s = macro_f_string_static_t_initialize2(F_status_signal_illegal_s, 0, F_status_signal_illegal_s_length); - const f_string_static_t f_status_signal_trap_s = macro_f_string_static_t_initialize2(F_status_signal_trap_s, 0, F_status_signal_trap_s_length); - const f_string_static_t f_status_signal_abort_s = macro_f_string_static_t_initialize2(F_status_signal_abort_s, 0, F_status_signal_abort_s_length); - const f_string_static_t f_status_signal_bus_error_s = macro_f_string_static_t_initialize2(F_status_signal_bus_error_s, 0, F_status_signal_bus_error_s_length); - const f_string_static_t f_status_signal_floating_point_error_s = macro_f_string_static_t_initialize2(F_status_signal_floating_point_error_s, 0, F_status_signal_floating_point_error_s_length); - const f_string_static_t f_status_signal_kill_s = macro_f_string_static_t_initialize2(F_status_signal_kill_s, 0, F_status_signal_kill_s_length); - const f_string_static_t f_status_signal_user_1_s = macro_f_string_static_t_initialize2(F_status_signal_user_1_s, 0, F_status_signal_user_1_s_length); - const f_string_static_t f_status_signal_segmentation_fault_s = macro_f_string_static_t_initialize2(F_status_signal_segmentation_fault_s, 0, F_status_signal_segmentation_fault_s_length); - const f_string_static_t f_status_signal_user_2_s = macro_f_string_static_t_initialize2(F_status_signal_user_2_s, 0, F_status_signal_user_2_s_length); - const f_string_static_t f_status_signal_broken_pipe_s = macro_f_string_static_t_initialize2(F_status_signal_broken_pipe_s, 0, F_status_signal_broken_pipe_s_length); - const f_string_static_t f_status_signal_alarm_clock_s = macro_f_string_static_t_initialize2(F_status_signal_alarm_clock_s, 0, F_status_signal_alarm_clock_s_length); - const f_string_static_t f_status_signal_termination_s = macro_f_string_static_t_initialize2(F_status_signal_termination_s, 0, F_status_signal_termination_s_length); - const f_string_static_t f_status_signal_stack_fault_s = macro_f_string_static_t_initialize2(F_status_signal_stack_fault_s, 0, F_status_signal_stack_fault_s_length); - const f_string_static_t f_status_signal_child_s = macro_f_string_static_t_initialize2(F_status_signal_child_s, 0, F_status_signal_child_s_length); - const f_string_static_t f_status_signal_continue_s = macro_f_string_static_t_initialize2(F_status_signal_continue_s, 0, F_status_signal_continue_s_length); - const f_string_static_t f_status_signal_stop_s = macro_f_string_static_t_initialize2(F_status_signal_stop_s, 0, F_status_signal_stop_s_length); - const f_string_static_t f_status_signal_keyboard_stop_s = macro_f_string_static_t_initialize2(F_status_signal_keyboard_stop_s, 0, F_status_signal_keyboard_stop_s_length); - const f_string_static_t f_status_signal_tty_in_s = macro_f_string_static_t_initialize2(F_status_signal_tty_in_s, 0, F_status_signal_tty_in_s_length); - const f_string_static_t f_status_signal_tty_out_s = macro_f_string_static_t_initialize2(F_status_signal_tty_out_s, 0, F_status_signal_tty_out_s_length); - const f_string_static_t f_status_signal_urgent_s = macro_f_string_static_t_initialize2(F_status_signal_urgent_s, 0, F_status_signal_urgent_s_length); - const f_string_static_t f_status_signal_cpu_limit_s = macro_f_string_static_t_initialize2(F_status_signal_cpu_limit_s, 0, F_status_signal_cpu_limit_s_length); - const f_string_static_t f_status_signal_file_size_limit_s = macro_f_string_static_t_initialize2(F_status_signal_file_size_limit_s, 0, F_status_signal_file_size_limit_s_length); - const f_string_static_t f_status_signal_virtual_alarm_clock_s = macro_f_string_static_t_initialize2(F_status_signal_virtual_alarm_clock_s, 0, F_status_signal_virtual_alarm_clock_s_length); - const f_string_static_t f_status_signal_profile_alarm_clock_s = macro_f_string_static_t_initialize2(F_status_signal_profile_alarm_clock_s, 0, F_status_signal_profile_alarm_clock_s_length); - const f_string_static_t f_status_signal_window_size_change_s = macro_f_string_static_t_initialize2(F_status_signal_window_size_change_s, 0, F_status_signal_window_size_change_s_length); - const f_string_static_t f_status_signal_pollable_event_s = macro_f_string_static_t_initialize2(F_status_signal_pollable_event_s, 0, F_status_signal_pollable_event_s_length); - const f_string_static_t f_status_signal_power_failure_s = macro_f_string_static_t_initialize2(F_status_signal_power_failure_s, 0, F_status_signal_power_failure_s_length); - const f_string_static_t f_status_signal_bad_system_call_s = macro_f_string_static_t_initialize2(F_status_signal_bad_system_call_s, 0, F_status_signal_bad_system_call_s_length); - const f_string_static_t f_status_signal_reserved_32_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_32_s, 0, F_status_signal_reserved_32_s_length); - const f_string_static_t f_status_signal_reserved_33_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_33_s, 0, F_status_signal_reserved_33_s_length); - const f_string_static_t f_status_signal_reserved_34_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_34_s, 0, F_status_signal_reserved_34_s_length); - const f_string_static_t f_status_signal_reserved_35_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_35_s, 0, F_status_signal_reserved_35_s_length); - const f_string_static_t f_status_signal_reserved_36_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_36_s, 0, F_status_signal_reserved_36_s_length); - const f_string_static_t f_status_signal_reserved_37_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_37_s, 0, F_status_signal_reserved_37_s_length); - const f_string_static_t f_status_signal_reserved_38_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_38_s, 0, F_status_signal_reserved_38_s_length); - const f_string_static_t f_status_signal_reserved_39_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_39_s, 0, F_status_signal_reserved_39_s_length); - const f_string_static_t f_status_signal_reserved_40_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_40_s, 0, F_status_signal_reserved_40_s_length); - const f_string_static_t f_status_signal_reserved_41_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_41_s, 0, F_status_signal_reserved_41_s_length); - const f_string_static_t f_status_signal_reserved_42_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_42_s, 0, F_status_signal_reserved_42_s_length); - const f_string_static_t f_status_signal_reserved_43_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_43_s, 0, F_status_signal_reserved_43_s_length); - const f_string_static_t f_status_signal_reserved_44_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_44_s, 0, F_status_signal_reserved_44_s_length); - const f_string_static_t f_status_signal_reserved_45_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_45_s, 0, F_status_signal_reserved_45_s_length); - const f_string_static_t f_status_signal_reserved_46_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_46_s, 0, F_status_signal_reserved_46_s_length); - const f_string_static_t f_status_signal_reserved_47_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_47_s, 0, F_status_signal_reserved_47_s_length); - const f_string_static_t f_status_signal_reserved_48_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_48_s, 0, F_status_signal_reserved_48_s_length); - const f_string_static_t f_status_signal_reserved_49_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_49_s, 0, F_status_signal_reserved_49_s_length); - const f_string_static_t f_status_signal_reserved_50_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_50_s, 0, F_status_signal_reserved_50_s_length); - const f_string_static_t f_status_signal_reserved_51_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_51_s, 0, F_status_signal_reserved_51_s_length); - const f_string_static_t f_status_signal_reserved_52_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_52_s, 0, F_status_signal_reserved_52_s_length); - const f_string_static_t f_status_signal_reserved_53_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_53_s, 0, F_status_signal_reserved_53_s_length); - const f_string_static_t f_status_signal_reserved_54_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_54_s, 0, F_status_signal_reserved_54_s_length); - const f_string_static_t f_status_signal_reserved_55_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_55_s, 0, F_status_signal_reserved_55_s_length); - const f_string_static_t f_status_signal_reserved_56_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_56_s, 0, F_status_signal_reserved_56_s_length); - const f_string_static_t f_status_signal_reserved_57_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_57_s, 0, F_status_signal_reserved_57_s_length); - const f_string_static_t f_status_signal_reserved_58_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_58_s, 0, F_status_signal_reserved_58_s_length); - const f_string_static_t f_status_signal_reserved_59_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_59_s, 0, F_status_signal_reserved_59_s_length); - const f_string_static_t f_status_signal_reserved_60_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_60_s, 0, F_status_signal_reserved_60_s_length); - const f_string_static_t f_status_signal_reserved_61_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_61_s, 0, F_status_signal_reserved_61_s_length); - const f_string_static_t f_status_signal_reserved_62_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_62_s, 0, F_status_signal_reserved_62_s_length); - const f_string_static_t f_status_signal_reserved_63_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_63_s, 0, F_status_signal_reserved_63_s_length); - const f_string_static_t f_status_signal_reserved_64_s = macro_f_string_static_t_initialize2(F_status_signal_reserved_64_s, 0, F_status_signal_reserved_64_s_length); + const f_string_static_t f_status_signal_hangup_s = macro_f_string_static_t_initialize(F_status_signal_hangup_s, 0, F_status_signal_hangup_s_length); + const f_string_static_t f_status_signal_interrupt_s = macro_f_string_static_t_initialize(F_status_signal_interrupt_s, 0, F_status_signal_interrupt_s_length); + const f_string_static_t f_status_signal_quit_s = macro_f_string_static_t_initialize(F_status_signal_quit_s, 0, F_status_signal_quit_s_length); + const f_string_static_t f_status_signal_illegal_s = macro_f_string_static_t_initialize(F_status_signal_illegal_s, 0, F_status_signal_illegal_s_length); + const f_string_static_t f_status_signal_trap_s = macro_f_string_static_t_initialize(F_status_signal_trap_s, 0, F_status_signal_trap_s_length); + const f_string_static_t f_status_signal_abort_s = macro_f_string_static_t_initialize(F_status_signal_abort_s, 0, F_status_signal_abort_s_length); + const f_string_static_t f_status_signal_bus_error_s = macro_f_string_static_t_initialize(F_status_signal_bus_error_s, 0, F_status_signal_bus_error_s_length); + const f_string_static_t f_status_signal_floating_point_error_s = macro_f_string_static_t_initialize(F_status_signal_floating_point_error_s, 0, F_status_signal_floating_point_error_s_length); + const f_string_static_t f_status_signal_kill_s = macro_f_string_static_t_initialize(F_status_signal_kill_s, 0, F_status_signal_kill_s_length); + const f_string_static_t f_status_signal_user_1_s = macro_f_string_static_t_initialize(F_status_signal_user_1_s, 0, F_status_signal_user_1_s_length); + const f_string_static_t f_status_signal_segmentation_fault_s = macro_f_string_static_t_initialize(F_status_signal_segmentation_fault_s, 0, F_status_signal_segmentation_fault_s_length); + const f_string_static_t f_status_signal_user_2_s = macro_f_string_static_t_initialize(F_status_signal_user_2_s, 0, F_status_signal_user_2_s_length); + const f_string_static_t f_status_signal_broken_pipe_s = macro_f_string_static_t_initialize(F_status_signal_broken_pipe_s, 0, F_status_signal_broken_pipe_s_length); + const f_string_static_t f_status_signal_alarm_clock_s = macro_f_string_static_t_initialize(F_status_signal_alarm_clock_s, 0, F_status_signal_alarm_clock_s_length); + const f_string_static_t f_status_signal_termination_s = macro_f_string_static_t_initialize(F_status_signal_termination_s, 0, F_status_signal_termination_s_length); + const f_string_static_t f_status_signal_stack_fault_s = macro_f_string_static_t_initialize(F_status_signal_stack_fault_s, 0, F_status_signal_stack_fault_s_length); + const f_string_static_t f_status_signal_child_s = macro_f_string_static_t_initialize(F_status_signal_child_s, 0, F_status_signal_child_s_length); + const f_string_static_t f_status_signal_continue_s = macro_f_string_static_t_initialize(F_status_signal_continue_s, 0, F_status_signal_continue_s_length); + const f_string_static_t f_status_signal_stop_s = macro_f_string_static_t_initialize(F_status_signal_stop_s, 0, F_status_signal_stop_s_length); + const f_string_static_t f_status_signal_keyboard_stop_s = macro_f_string_static_t_initialize(F_status_signal_keyboard_stop_s, 0, F_status_signal_keyboard_stop_s_length); + const f_string_static_t f_status_signal_tty_in_s = macro_f_string_static_t_initialize(F_status_signal_tty_in_s, 0, F_status_signal_tty_in_s_length); + const f_string_static_t f_status_signal_tty_out_s = macro_f_string_static_t_initialize(F_status_signal_tty_out_s, 0, F_status_signal_tty_out_s_length); + const f_string_static_t f_status_signal_urgent_s = macro_f_string_static_t_initialize(F_status_signal_urgent_s, 0, F_status_signal_urgent_s_length); + const f_string_static_t f_status_signal_cpu_limit_s = macro_f_string_static_t_initialize(F_status_signal_cpu_limit_s, 0, F_status_signal_cpu_limit_s_length); + const f_string_static_t f_status_signal_file_size_limit_s = macro_f_string_static_t_initialize(F_status_signal_file_size_limit_s, 0, F_status_signal_file_size_limit_s_length); + const f_string_static_t f_status_signal_virtual_alarm_clock_s = macro_f_string_static_t_initialize(F_status_signal_virtual_alarm_clock_s, 0, F_status_signal_virtual_alarm_clock_s_length); + const f_string_static_t f_status_signal_profile_alarm_clock_s = macro_f_string_static_t_initialize(F_status_signal_profile_alarm_clock_s, 0, F_status_signal_profile_alarm_clock_s_length); + const f_string_static_t f_status_signal_window_size_change_s = macro_f_string_static_t_initialize(F_status_signal_window_size_change_s, 0, F_status_signal_window_size_change_s_length); + const f_string_static_t f_status_signal_pollable_event_s = macro_f_string_static_t_initialize(F_status_signal_pollable_event_s, 0, F_status_signal_pollable_event_s_length); + const f_string_static_t f_status_signal_power_failure_s = macro_f_string_static_t_initialize(F_status_signal_power_failure_s, 0, F_status_signal_power_failure_s_length); + const f_string_static_t f_status_signal_bad_system_call_s = macro_f_string_static_t_initialize(F_status_signal_bad_system_call_s, 0, F_status_signal_bad_system_call_s_length); + const f_string_static_t f_status_signal_reserved_32_s = macro_f_string_static_t_initialize(F_status_signal_reserved_32_s, 0, F_status_signal_reserved_32_s_length); + const f_string_static_t f_status_signal_reserved_33_s = macro_f_string_static_t_initialize(F_status_signal_reserved_33_s, 0, F_status_signal_reserved_33_s_length); + const f_string_static_t f_status_signal_reserved_34_s = macro_f_string_static_t_initialize(F_status_signal_reserved_34_s, 0, F_status_signal_reserved_34_s_length); + const f_string_static_t f_status_signal_reserved_35_s = macro_f_string_static_t_initialize(F_status_signal_reserved_35_s, 0, F_status_signal_reserved_35_s_length); + const f_string_static_t f_status_signal_reserved_36_s = macro_f_string_static_t_initialize(F_status_signal_reserved_36_s, 0, F_status_signal_reserved_36_s_length); + const f_string_static_t f_status_signal_reserved_37_s = macro_f_string_static_t_initialize(F_status_signal_reserved_37_s, 0, F_status_signal_reserved_37_s_length); + const f_string_static_t f_status_signal_reserved_38_s = macro_f_string_static_t_initialize(F_status_signal_reserved_38_s, 0, F_status_signal_reserved_38_s_length); + const f_string_static_t f_status_signal_reserved_39_s = macro_f_string_static_t_initialize(F_status_signal_reserved_39_s, 0, F_status_signal_reserved_39_s_length); + const f_string_static_t f_status_signal_reserved_40_s = macro_f_string_static_t_initialize(F_status_signal_reserved_40_s, 0, F_status_signal_reserved_40_s_length); + const f_string_static_t f_status_signal_reserved_41_s = macro_f_string_static_t_initialize(F_status_signal_reserved_41_s, 0, F_status_signal_reserved_41_s_length); + const f_string_static_t f_status_signal_reserved_42_s = macro_f_string_static_t_initialize(F_status_signal_reserved_42_s, 0, F_status_signal_reserved_42_s_length); + const f_string_static_t f_status_signal_reserved_43_s = macro_f_string_static_t_initialize(F_status_signal_reserved_43_s, 0, F_status_signal_reserved_43_s_length); + const f_string_static_t f_status_signal_reserved_44_s = macro_f_string_static_t_initialize(F_status_signal_reserved_44_s, 0, F_status_signal_reserved_44_s_length); + const f_string_static_t f_status_signal_reserved_45_s = macro_f_string_static_t_initialize(F_status_signal_reserved_45_s, 0, F_status_signal_reserved_45_s_length); + const f_string_static_t f_status_signal_reserved_46_s = macro_f_string_static_t_initialize(F_status_signal_reserved_46_s, 0, F_status_signal_reserved_46_s_length); + const f_string_static_t f_status_signal_reserved_47_s = macro_f_string_static_t_initialize(F_status_signal_reserved_47_s, 0, F_status_signal_reserved_47_s_length); + const f_string_static_t f_status_signal_reserved_48_s = macro_f_string_static_t_initialize(F_status_signal_reserved_48_s, 0, F_status_signal_reserved_48_s_length); + const f_string_static_t f_status_signal_reserved_49_s = macro_f_string_static_t_initialize(F_status_signal_reserved_49_s, 0, F_status_signal_reserved_49_s_length); + const f_string_static_t f_status_signal_reserved_50_s = macro_f_string_static_t_initialize(F_status_signal_reserved_50_s, 0, F_status_signal_reserved_50_s_length); + const f_string_static_t f_status_signal_reserved_51_s = macro_f_string_static_t_initialize(F_status_signal_reserved_51_s, 0, F_status_signal_reserved_51_s_length); + const f_string_static_t f_status_signal_reserved_52_s = macro_f_string_static_t_initialize(F_status_signal_reserved_52_s, 0, F_status_signal_reserved_52_s_length); + const f_string_static_t f_status_signal_reserved_53_s = macro_f_string_static_t_initialize(F_status_signal_reserved_53_s, 0, F_status_signal_reserved_53_s_length); + const f_string_static_t f_status_signal_reserved_54_s = macro_f_string_static_t_initialize(F_status_signal_reserved_54_s, 0, F_status_signal_reserved_54_s_length); + const f_string_static_t f_status_signal_reserved_55_s = macro_f_string_static_t_initialize(F_status_signal_reserved_55_s, 0, F_status_signal_reserved_55_s_length); + const f_string_static_t f_status_signal_reserved_56_s = macro_f_string_static_t_initialize(F_status_signal_reserved_56_s, 0, F_status_signal_reserved_56_s_length); + const f_string_static_t f_status_signal_reserved_57_s = macro_f_string_static_t_initialize(F_status_signal_reserved_57_s, 0, F_status_signal_reserved_57_s_length); + const f_string_static_t f_status_signal_reserved_58_s = macro_f_string_static_t_initialize(F_status_signal_reserved_58_s, 0, F_status_signal_reserved_58_s_length); + const f_string_static_t f_status_signal_reserved_59_s = macro_f_string_static_t_initialize(F_status_signal_reserved_59_s, 0, F_status_signal_reserved_59_s_length); + const f_string_static_t f_status_signal_reserved_60_s = macro_f_string_static_t_initialize(F_status_signal_reserved_60_s, 0, F_status_signal_reserved_60_s_length); + const f_string_static_t f_status_signal_reserved_61_s = macro_f_string_static_t_initialize(F_status_signal_reserved_61_s, 0, F_status_signal_reserved_61_s_length); + const f_string_static_t f_status_signal_reserved_62_s = macro_f_string_static_t_initialize(F_status_signal_reserved_62_s, 0, F_status_signal_reserved_62_s_length); + const f_string_static_t f_status_signal_reserved_63_s = macro_f_string_static_t_initialize(F_status_signal_reserved_63_s, 0, F_status_signal_reserved_63_s_length); + const f_string_static_t f_status_signal_reserved_64_s = macro_f_string_static_t_initialize(F_status_signal_reserved_64_s, 0, F_status_signal_reserved_64_s_length); #endif // _di_F_status_signal_ #ifndef _di_F_status_basic_ - const f_string_static_t f_status_none_s = macro_f_string_static_t_initialize2(F_status_none_s, 0, F_status_none_s_length); - const f_string_static_t f_status_abort_s = macro_f_string_static_t_initialize2(F_status_abort_s, 0, F_status_abort_s_length); - const f_string_static_t f_status_abort_not_s = macro_f_string_static_t_initialize2(F_status_abort_not_s, 0, F_status_abort_not_s_length); - const f_string_static_t f_status_absolute_s = macro_f_string_static_t_initialize2(F_status_absolute_s, 0, F_status_absolute_s_length); - const f_string_static_t f_status_absolute_not_s = macro_f_string_static_t_initialize2(F_status_absolute_not_s, 0, F_status_absolute_not_s_length); - const f_string_static_t f_status_address_s = macro_f_string_static_t_initialize2(F_status_address_s, 0, F_status_address_s_length); - const f_string_static_t f_status_address_not_s = macro_f_string_static_t_initialize2(F_status_address_not_s, 0, F_status_address_not_s_length); - const f_string_static_t f_status_ascii_s = macro_f_string_static_t_initialize2(F_status_ascii_s, 0, F_status_ascii_s_length); - const f_string_static_t f_status_ascii_not_s = macro_f_string_static_t_initialize2(F_status_ascii_not_s, 0, F_status_ascii_not_s_length); - const f_string_static_t f_status_atomic_s = macro_f_string_static_t_initialize2(F_status_atomic_s, 0, F_status_atomic_s_length); - const f_string_static_t f_status_atomic_not_s = macro_f_string_static_t_initialize2(F_status_atomic_not_s, 0, F_status_atomic_not_s_length); - const f_string_static_t f_status_begin_s = macro_f_string_static_t_initialize2(F_status_begin_s, 0, F_status_begin_s_length); - const f_string_static_t f_status_begin_not_s = macro_f_string_static_t_initialize2(F_status_begin_not_s, 0, F_status_begin_not_s_length); - const f_string_static_t f_status_block_s = macro_f_string_static_t_initialize2(F_status_block_s, 0, F_status_block_s_length); - const f_string_static_t f_status_block_not_s = macro_f_string_static_t_initialize2(F_status_block_not_s, 0, F_status_block_not_s_length); - const f_string_static_t f_status_body_s = macro_f_string_static_t_initialize2(F_status_body_s, 0, F_status_body_s_length); - const f_string_static_t f_status_body_not_s = macro_f_string_static_t_initialize2(F_status_body_not_s, 0, F_status_body_not_s_length); - const f_string_static_t f_status_bound_s = macro_f_string_static_t_initialize2(F_status_bound_s, 0, F_status_bound_s_length); - const f_string_static_t f_status_bound_not_s = macro_f_string_static_t_initialize2(F_status_bound_not_s, 0, F_status_bound_not_s_length); - const f_string_static_t f_status_capability_s = macro_f_string_static_t_initialize2(F_status_capability_s, 0, F_status_capability_s_length); - const f_string_static_t f_status_capability_not_s = macro_f_string_static_t_initialize2(F_status_capability_not_s, 0, F_status_capability_not_s_length); - const f_string_static_t f_status_child_s = macro_f_string_static_t_initialize2(F_status_child_s, 0, F_status_child_s_length); - const f_string_static_t f_status_child_not_s = macro_f_string_static_t_initialize2(F_status_child_not_s, 0, F_status_child_not_s_length); - const f_string_static_t f_status_complete_s = macro_f_string_static_t_initialize2(F_status_complete_s, 0, F_status_complete_s_length); - const f_string_static_t f_status_complete_not_s = macro_f_string_static_t_initialize2(F_status_complete_not_s, 0, F_status_complete_not_s_length); - const f_string_static_t f_status_connect_s = macro_f_string_static_t_initialize2(F_status_connect_s, 0, F_status_connect_s_length); - const f_string_static_t f_status_connect_not_s = macro_f_string_static_t_initialize2(F_status_connect_not_s, 0, F_status_connect_not_s_length); - const f_string_static_t f_status_connect_refuse_s = macro_f_string_static_t_initialize2(F_status_connect_refuse_s, 0, F_status_connect_refuse_s_length); - const f_string_static_t f_status_connect_reset_s = macro_f_string_static_t_initialize2(F_status_connect_reset_s, 0, F_status_connect_reset_s_length); - const f_string_static_t f_status_container_s = macro_f_string_static_t_initialize2(F_status_container_s, 0, F_status_container_s_length); - const f_string_static_t f_status_container_not_s = macro_f_string_static_t_initialize2(F_status_container_not_s, 0, F_status_container_not_s_length); - const f_string_static_t f_status_content_s = macro_f_string_static_t_initialize2(F_status_content_s, 0, F_status_content_s_length); - const f_string_static_t f_status_content_not_s = macro_f_string_static_t_initialize2(F_status_content_not_s, 0, F_status_content_not_s_length); - const f_string_static_t f_status_continue_s = macro_f_string_static_t_initialize2(F_status_continue_s, 0, F_status_continue_s_length); - const f_string_static_t f_status_continue_not_s = macro_f_string_static_t_initialize2(F_status_continue_not_s, 0, F_status_continue_not_s_length); - const f_string_static_t f_status_control_s = macro_f_string_static_t_initialize2(F_status_control_s, 0, F_status_control_s_length); - const f_string_static_t f_status_control_not_s = macro_f_string_static_t_initialize2(F_status_control_not_s, 0, F_status_control_not_s_length); - const f_string_static_t f_status_control_group_s = macro_f_string_static_t_initialize2(F_status_control_group_s, 0, F_status_control_group_s_length); - const f_string_static_t f_status_control_group_not_s = macro_f_string_static_t_initialize2(F_status_control_group_not_s, 0, F_status_control_group_not_s_length); - const f_string_static_t f_status_critical_s = macro_f_string_static_t_initialize2(F_status_critical_s, 0, F_status_critical_s_length); - const f_string_static_t f_status_critical_not_s = macro_f_string_static_t_initialize2(F_status_critical_not_s, 0, F_status_critical_not_s_length); - const f_string_static_t f_status_dead_s = macro_f_string_static_t_initialize2(F_status_dead_s, 0, F_status_dead_s_length); - const f_string_static_t f_status_dead_not_s = macro_f_string_static_t_initialize2(F_status_dead_not_s, 0, F_status_dead_not_s_length); - const f_string_static_t f_status_deadlock_s = macro_f_string_static_t_initialize2(F_status_deadlock_s, 0, F_status_deadlock_s_length); - const f_string_static_t f_status_deadlock_not_s = macro_f_string_static_t_initialize2(F_status_deadlock_not_s, 0, F_status_deadlock_not_s_length); - const f_string_static_t f_status_descriptor_s = macro_f_string_static_t_initialize2(F_status_descriptor_s, 0, F_status_descriptor_s_length); - const f_string_static_t f_status_descriptor_not_s = macro_f_string_static_t_initialize2(F_status_descriptor_not_s, 0, F_status_descriptor_not_s_length); - const f_string_static_t f_status_device_s = macro_f_string_static_t_initialize2(F_status_device_s, 0, F_status_device_s_length); - const f_string_static_t f_status_device_not_s = macro_f_string_static_t_initialize2(F_status_device_not_s, 0, F_status_device_not_s_length); - const f_string_static_t f_status_disable_s = macro_f_string_static_t_initialize2(F_status_disable_s, 0, F_status_disable_s_length); - const f_string_static_t f_status_disable_not_s = macro_f_string_static_t_initialize2(F_status_disable_not_s, 0, F_status_disable_not_s_length); - const f_string_static_t f_status_domain_s = macro_f_string_static_t_initialize2(F_status_domain_s, 0, F_status_domain_s_length); - const f_string_static_t f_status_domain_not_s = macro_f_string_static_t_initialize2(F_status_domain_not_s, 0, F_status_domain_not_s_length); - const f_string_static_t f_status_done_s = macro_f_string_static_t_initialize2(F_status_done_s, 0, F_status_done_s_length); - const f_string_static_t f_status_done_not_s = macro_f_string_static_t_initialize2(F_status_done_not_s, 0, F_status_done_not_s_length); - const f_string_static_t f_status_dummy_s = macro_f_string_static_t_initialize2(F_status_dummy_s, 0, F_status_dummy_s_length); - const f_string_static_t f_status_dummy_not_s = macro_f_string_static_t_initialize2(F_status_dummy_not_s, 0, F_status_dummy_not_s_length); - const f_string_static_t f_status_empty_s = macro_f_string_static_t_initialize2(F_status_empty_s, 0, F_status_empty_s_length); - const f_string_static_t f_status_empty_not_s = macro_f_string_static_t_initialize2(F_status_empty_not_s, 0, F_status_empty_not_s_length); - const f_string_static_t f_status_enable_s = macro_f_string_static_t_initialize2(F_status_enable_s, 0, F_status_enable_s_length); - const f_string_static_t f_status_enable_not_s = macro_f_string_static_t_initialize2(F_status_enable_not_s, 0, F_status_enable_not_s_length); - const f_string_static_t f_status_encoding_s = macro_f_string_static_t_initialize2(F_status_encoding_s, 0, F_status_encoding_s_length); - const f_string_static_t f_status_encoding_not_s = macro_f_string_static_t_initialize2(F_status_encoding_not_s, 0, F_status_encoding_not_s_length); - const f_string_static_t f_status_end_s = macro_f_string_static_t_initialize2(F_status_end_s, 0, F_status_end_s_length); - const f_string_static_t f_status_end_not_s = macro_f_string_static_t_initialize2(F_status_end_not_s, 0, F_status_end_not_s_length); - const f_string_static_t f_status_endian_s = macro_f_string_static_t_initialize2(F_status_endian_s, 0, F_status_endian_s_length); - const f_string_static_t f_status_endian_big_s = macro_f_string_static_t_initialize2(F_status_endian_big_s, 0, F_status_endian_big_s_length); - const f_string_static_t f_status_endian_little_s = macro_f_string_static_t_initialize2(F_status_endian_little_s, 0, F_status_endian_little_s_length); - const f_string_static_t f_status_endian_not_s = macro_f_string_static_t_initialize2(F_status_endian_not_s, 0, F_status_endian_not_s_length); - const f_string_static_t f_status_eoa_s = macro_f_string_static_t_initialize2(F_status_eoa_s, 0, F_status_eoa_s_length); - const f_string_static_t f_status_eoa_not_s = macro_f_string_static_t_initialize2(F_status_eoa_not_s, 0, F_status_eoa_not_s_length); - const f_string_static_t f_status_eof_s = macro_f_string_static_t_initialize2(F_status_eof_s, 0, F_status_eof_s_length); - const f_string_static_t f_status_eof_not_s = macro_f_string_static_t_initialize2(F_status_eof_not_s, 0, F_status_eof_not_s_length); - const f_string_static_t f_status_eol_s = macro_f_string_static_t_initialize2(F_status_eol_s, 0, F_status_eol_s_length); - const f_string_static_t f_status_eol_not_s = macro_f_string_static_t_initialize2(F_status_eol_not_s, 0, F_status_eol_not_s_length); - const f_string_static_t f_status_eos_s = macro_f_string_static_t_initialize2(F_status_eos_s, 0, F_status_eos_s_length); - const f_string_static_t f_status_eos_not_s = macro_f_string_static_t_initialize2(F_status_eos_not_s, 0, F_status_eos_not_s_length); - const f_string_static_t f_status_execute_s = macro_f_string_static_t_initialize2(F_status_execute_s, 0, F_status_execute_s_length); - const f_string_static_t f_status_execute_not_s = macro_f_string_static_t_initialize2(F_status_execute_not_s, 0, F_status_execute_not_s_length); - const f_string_static_t f_status_exist_s = macro_f_string_static_t_initialize2(F_status_exist_s, 0, F_status_exist_s_length); - const f_string_static_t f_status_exist_not_s = macro_f_string_static_t_initialize2(F_status_exist_not_s, 0, F_status_exist_not_s_length); - const f_string_static_t f_status_failure_s = macro_f_string_static_t_initialize2(F_status_failure_s, 0, F_status_failure_s_length); - const f_string_static_t f_status_failure_not_s = macro_f_string_static_t_initialize2(F_status_failure_not_s, 0, F_status_failure_not_s_length); - const f_string_static_t f_status_family_s = macro_f_string_static_t_initialize2(F_status_family_s, 0, F_status_family_s_length); - const f_string_static_t f_status_family_not_s = macro_f_string_static_t_initialize2(F_status_family_not_s, 0, F_status_family_not_s_length); - const f_string_static_t f_status_first_s = macro_f_string_static_t_initialize2(F_status_first_s, 0, F_status_first_s_length); - const f_string_static_t f_status_first_not_s = macro_f_string_static_t_initialize2(F_status_first_not_s, 0, F_status_first_not_s_length); - const f_string_static_t f_status_footer_s = macro_f_string_static_t_initialize2(F_status_footer_s, 0, F_status_footer_s_length); - const f_string_static_t f_status_footer_not_s = macro_f_string_static_t_initialize2(F_status_footer_not_s, 0, F_status_footer_not_s_length); - const f_string_static_t f_status_fork_s = macro_f_string_static_t_initialize2(F_status_fork_s, 0, F_status_fork_s_length); - const f_string_static_t f_status_fork_not_s = macro_f_string_static_t_initialize2(F_status_fork_not_s, 0, F_status_fork_not_s_length); - const f_string_static_t f_status_format_s = macro_f_string_static_t_initialize2(F_status_format_s, 0, F_status_format_s_length); - const f_string_static_t f_status_format_not_s = macro_f_string_static_t_initialize2(F_status_format_not_s, 0, F_status_format_not_s_length); - const f_string_static_t f_status_found_s = macro_f_string_static_t_initialize2(F_status_found_s, 0, F_status_found_s_length); - const f_string_static_t f_status_found_not_s = macro_f_string_static_t_initialize2(F_status_found_not_s, 0, F_status_found_not_s_length); - const f_string_static_t f_status_full_s = macro_f_string_static_t_initialize2(F_status_full_s, 0, F_status_full_s_length); - const f_string_static_t f_status_full_not_s = macro_f_string_static_t_initialize2(F_status_full_not_s, 0, F_status_full_not_s_length); - const f_string_static_t f_status_group_s = macro_f_string_static_t_initialize2(F_status_group_s, 0, F_status_group_s_length); - const f_string_static_t f_status_group_not_s = macro_f_string_static_t_initialize2(F_status_group_not_s, 0, F_status_group_not_s_length); - const f_string_static_t f_status_header_s = macro_f_string_static_t_initialize2(F_status_header_s, 0, F_status_header_s_length); - const f_string_static_t f_status_header_not_s = macro_f_string_static_t_initialize2(F_status_header_not_s, 0, F_status_header_not_s_length); - const f_string_static_t f_status_ignore_s = macro_f_string_static_t_initialize2(F_status_ignore_s, 0, F_status_ignore_s_length); - const f_string_static_t f_status_ignore_not_s = macro_f_string_static_t_initialize2(F_status_ignore_not_s, 0, F_status_ignore_not_s_length); - const f_string_static_t f_status_implemented_s = macro_f_string_static_t_initialize2(F_status_implemented_s, 0, F_status_implemented_s_length); - const f_string_static_t f_status_implemented_not_s = macro_f_string_static_t_initialize2(F_status_implemented_not_s, 0, F_status_implemented_not_s_length); - const f_string_static_t f_status_input_s = macro_f_string_static_t_initialize2(F_status_input_s, 0, F_status_input_s_length); - const f_string_static_t f_status_input_not_s = macro_f_string_static_t_initialize2(F_status_input_not_s, 0, F_status_input_not_s_length); - const f_string_static_t f_status_input_output_s = macro_f_string_static_t_initialize2(F_status_input_output_s, 0, F_status_input_output_s_length); - const f_string_static_t f_status_interrupt_s = macro_f_string_static_t_initialize2(F_status_interrupt_s, 0, F_status_interrupt_s_length); - const f_string_static_t f_status_interrupt_not_s = macro_f_string_static_t_initialize2(F_status_interrupt_not_s, 0, F_status_interrupt_not_s_length); - const f_string_static_t f_status_known_s = macro_f_string_static_t_initialize2(F_status_known_s, 0, F_status_known_s_length); - const f_string_static_t f_status_known_not_s = macro_f_string_static_t_initialize2(F_status_known_not_s, 0, F_status_known_not_s_length); - const f_string_static_t f_status_last_s = macro_f_string_static_t_initialize2(F_status_last_s, 0, F_status_last_s_length); - const f_string_static_t f_status_last_not_s = macro_f_string_static_t_initialize2(F_status_last_not_s, 0, F_status_last_not_s_length); - const f_string_static_t f_status_limit_s = macro_f_string_static_t_initialize2(F_status_limit_s, 0, F_status_limit_s_length); - const f_string_static_t f_status_limit_not_s = macro_f_string_static_t_initialize2(F_status_limit_not_s, 0, F_status_limit_not_s_length); - const f_string_static_t f_status_link_s = macro_f_string_static_t_initialize2(F_status_link_s, 0, F_status_link_s_length); - const f_string_static_t f_status_link_not_s = macro_f_string_static_t_initialize2(F_status_link_not_s, 0, F_status_link_not_s_length); - const f_string_static_t f_status_live_s = macro_f_string_static_t_initialize2(F_status_live_s, 0, F_status_live_s_length); - const f_string_static_t f_status_live_not_s = macro_f_string_static_t_initialize2(F_status_live_not_s, 0, F_status_live_not_s_length); - const f_string_static_t f_status_lock_s = macro_f_string_static_t_initialize2(F_status_lock_s, 0, F_status_lock_s_length); - const f_string_static_t f_status_lock_not_s = macro_f_string_static_t_initialize2(F_status_lock_not_s, 0, F_status_lock_not_s_length); - const f_string_static_t f_status_loop_s = macro_f_string_static_t_initialize2(F_status_loop_s, 0, F_status_loop_s_length); - const f_string_static_t f_status_loop_not_s = macro_f_string_static_t_initialize2(F_status_loop_not_s, 0, F_status_loop_not_s_length); - const f_string_static_t f_status_maybe_s = macro_f_string_static_t_initialize2(F_status_maybe_s, 0, F_status_maybe_s_length); - const f_string_static_t f_status_maybe_not_s = macro_f_string_static_t_initialize2(F_status_maybe_not_s, 0, F_status_maybe_not_s_length); - const f_string_static_t f_status_memory_s = macro_f_string_static_t_initialize2(F_status_memory_s, 0, F_status_memory_s_length); - const f_string_static_t f_status_memory_not_s = macro_f_string_static_t_initialize2(F_status_memory_not_s, 0, F_status_memory_not_s_length); - const f_string_static_t f_status_message_s = macro_f_string_static_t_initialize2(F_status_message_s, 0, F_status_message_s_length); - const f_string_static_t f_status_message_not_s = macro_f_string_static_t_initialize2(F_status_message_not_s, 0, F_status_message_not_s_length); - const f_string_static_t f_status_minor_s = macro_f_string_static_t_initialize2(F_status_minor_s, 0, F_status_minor_s_length); - const f_string_static_t f_status_minor_not_s = macro_f_string_static_t_initialize2(F_status_minor_not_s, 0, F_status_minor_not_s_length); - const f_string_static_t f_status_moderate_s = macro_f_string_static_t_initialize2(F_status_moderate_s, 0, F_status_moderate_s_length); - const f_string_static_t f_status_moderate_not_s = macro_f_string_static_t_initialize2(F_status_moderate_not_s, 0, F_status_moderate_not_s_length); - const f_string_static_t f_status_mount_s = macro_f_string_static_t_initialize2(F_status_mount_s, 0, F_status_mount_s_length); - const f_string_static_t f_status_mount_not_s = macro_f_string_static_t_initialize2(F_status_mount_not_s, 0, F_status_mount_not_s_length); - const f_string_static_t f_status_name_s = macro_f_string_static_t_initialize2(F_status_name_s, 0, F_status_name_s_length); - const f_string_static_t f_status_name_not_s = macro_f_string_static_t_initialize2(F_status_name_not_s, 0, F_status_name_not_s_length); - const f_string_static_t f_status_next_s = macro_f_string_static_t_initialize2(F_status_next_s, 0, F_status_next_s_length); - const f_string_static_t f_status_next_not_s = macro_f_string_static_t_initialize2(F_status_next_not_s, 0, F_status_next_not_s_length); - const f_string_static_t f_status_nice_s = macro_f_string_static_t_initialize2(F_status_nice_s, 0, F_status_nice_s_length); - const f_string_static_t f_status_nice_not_s = macro_f_string_static_t_initialize2(F_status_nice_not_s, 0, F_status_nice_not_s_length); - const f_string_static_t f_status_object_s = macro_f_string_static_t_initialize2(F_status_object_s, 0, F_status_object_s_length); - const f_string_static_t f_status_object_not_s = macro_f_string_static_t_initialize2(F_status_object_not_s, 0, F_status_object_not_s_length); - const f_string_static_t f_status_option_s = macro_f_string_static_t_initialize2(F_status_option_s, 0, F_status_option_s_length); - const f_string_static_t f_status_option_not_s = macro_f_string_static_t_initialize2(F_status_option_not_s, 0, F_status_option_not_s_length); - const f_string_static_t f_status_output_s = macro_f_string_static_t_initialize2(F_status_output_s, 0, F_status_output_s_length); - const f_string_static_t f_status_output_not_s = macro_f_string_static_t_initialize2(F_status_output_not_s, 0, F_status_output_not_s_length); - const f_string_static_t f_status_packet_s = macro_f_string_static_t_initialize2(F_status_packet_s, 0, F_status_packet_s_length); - const f_string_static_t f_status_packet_not_s = macro_f_string_static_t_initialize2(F_status_packet_not_s, 0, F_status_packet_not_s_length); - const f_string_static_t f_status_parameter_s = macro_f_string_static_t_initialize2(F_status_parameter_s, 0, F_status_parameter_s_length); - const f_string_static_t f_status_parameter_not_s = macro_f_string_static_t_initialize2(F_status_parameter_not_s, 0, F_status_parameter_not_s_length); - const f_string_static_t f_status_parent_s = macro_f_string_static_t_initialize2(F_status_parent_s, 0, F_status_parent_s_length); - const f_string_static_t f_status_parent_not_s = macro_f_string_static_t_initialize2(F_status_parent_not_s, 0, F_status_parent_not_s_length); - const f_string_static_t f_status_payload_s = macro_f_string_static_t_initialize2(F_status_payload_s, 0, F_status_payload_s_length); - const f_string_static_t f_status_payload_not_s = macro_f_string_static_t_initialize2(F_status_payload_not_s, 0, F_status_payload_not_s_length); - const f_string_static_t f_status_pipe_s = macro_f_string_static_t_initialize2(F_status_pipe_s, 0, F_status_pipe_s_length); - const f_string_static_t f_status_pipe_not_s = macro_f_string_static_t_initialize2(F_status_pipe_not_s, 0, F_status_pipe_not_s_length); - const f_string_static_t f_status_port_s = macro_f_string_static_t_initialize2(F_status_port_s, 0, F_status_port_s_length); - const f_string_static_t f_status_port_not_s = macro_f_string_static_t_initialize2(F_status_port_not_s, 0, F_status_port_not_s_length); - const f_string_static_t f_status_previous_s = macro_f_string_static_t_initialize2(F_status_previous_s, 0, F_status_previous_s_length); - const f_string_static_t f_status_previous_not_s = macro_f_string_static_t_initialize2(F_status_previous_not_s, 0, F_status_previous_not_s_length); - const f_string_static_t f_status_processor_s = macro_f_string_static_t_initialize2(F_status_processor_s, 0, F_status_processor_s_length); - const f_string_static_t f_status_processor_not_s = macro_f_string_static_t_initialize2(F_status_processor_not_s, 0, F_status_processor_not_s_length); - const f_string_static_t f_status_progress_s = macro_f_string_static_t_initialize2(F_status_progress_s, 0, F_status_progress_s_length); - const f_string_static_t f_status_progress_not_s = macro_f_string_static_t_initialize2(F_status_progress_not_s, 0, F_status_progress_not_s_length); - const f_string_static_t f_status_prohibited_s = macro_f_string_static_t_initialize2(F_status_prohibited_s, 0, F_status_prohibited_s_length); - const f_string_static_t f_status_prohibited_not_s = macro_f_string_static_t_initialize2(F_status_prohibited_not_s, 0, F_status_prohibited_not_s_length); - const f_string_static_t f_status_property_s = macro_f_string_static_t_initialize2(F_status_property_s, 0, F_status_property_s_length); - const f_string_static_t f_status_property_not_s = macro_f_string_static_t_initialize2(F_status_property_not_s, 0, F_status_property_not_s_length); - const f_string_static_t f_status_protocol_s = macro_f_string_static_t_initialize2(F_status_protocol_s, 0, F_status_protocol_s_length); - const f_string_static_t f_status_protocol_not_s = macro_f_string_static_t_initialize2(F_status_protocol_not_s, 0, F_status_protocol_not_s_length); - const f_string_static_t f_status_range_s = macro_f_string_static_t_initialize2(F_status_range_s, 0, F_status_range_s_length); - const f_string_static_t f_status_range_not_s = macro_f_string_static_t_initialize2(F_status_range_not_s, 0, F_status_range_not_s_length); - const f_string_static_t f_status_read_s = macro_f_string_static_t_initialize2(F_status_read_s, 0, F_status_read_s_length); - const f_string_static_t f_status_read_not_s = macro_f_string_static_t_initialize2(F_status_read_not_s, 0, F_status_read_not_s_length); - const f_string_static_t f_status_read_only_s = macro_f_string_static_t_initialize2(F_status_read_only_s, 0, F_status_read_only_s_length); - const f_string_static_t f_status_ready_s = macro_f_string_static_t_initialize2(F_status_ready_s, 0, F_status_ready_s_length); - const f_string_static_t f_status_ready_not_s = macro_f_string_static_t_initialize2(F_status_ready_not_s, 0, F_status_ready_not_s_length); - const f_string_static_t f_status_recover_s = macro_f_string_static_t_initialize2(F_status_recover_s, 0, F_status_recover_s_length); - const f_string_static_t f_status_recover_not_s = macro_f_string_static_t_initialize2(F_status_recover_not_s, 0, F_status_recover_not_s_length); - const f_string_static_t f_status_recurse_s = macro_f_string_static_t_initialize2(F_status_recurse_s, 0, F_status_recurse_s_length); - const f_string_static_t f_status_recurse_not_s = macro_f_string_static_t_initialize2(F_status_recurse_not_s, 0, F_status_recurse_not_s_length); - const f_string_static_t f_status_relative_s = macro_f_string_static_t_initialize2(F_status_relative_s, 0, F_status_relative_s_length); - const f_string_static_t f_status_relative_not_s = macro_f_string_static_t_initialize2(F_status_relative_not_s, 0, F_status_relative_not_s_length); - const f_string_static_t f_status_require_s = macro_f_string_static_t_initialize2(F_status_require_s, 0, F_status_require_s_length); - const f_string_static_t f_status_require_not_s = macro_f_string_static_t_initialize2(F_status_require_not_s, 0, F_status_require_not_s_length); - const f_string_static_t f_status_resource_s = macro_f_string_static_t_initialize2(F_status_resource_s, 0, F_status_resource_s_length); - const f_string_static_t f_status_resource_not_s = macro_f_string_static_t_initialize2(F_status_resource_not_s, 0, F_status_resource_not_s_length); - const f_string_static_t f_status_search_s = macro_f_string_static_t_initialize2(F_status_search_s, 0, F_status_search_s_length); - const f_string_static_t f_status_search_not_s = macro_f_string_static_t_initialize2(F_status_search_not_s, 0, F_status_search_not_s_length); - const f_string_static_t f_status_schedule_s = macro_f_string_static_t_initialize2(F_status_schedule_s, 0, F_status_schedule_s_length); - const f_string_static_t f_status_schedule_not_s = macro_f_string_static_t_initialize2(F_status_schedule_not_s, 0, F_status_schedule_not_s_length); - const f_string_static_t f_status_size_s = macro_f_string_static_t_initialize2(F_status_size_s, 0, F_status_size_s_length); - const f_string_static_t f_status_size_not_s = macro_f_string_static_t_initialize2(F_status_size_not_s, 0, F_status_size_not_s_length); - const f_string_static_t f_status_signal_s = macro_f_string_static_t_initialize2(F_status_signal_s, 0, F_status_signal_s_length); - const f_string_static_t f_status_signal_not_s = macro_f_string_static_t_initialize2(F_status_signal_not_s, 0, F_status_signal_not_s_length); - const f_string_static_t f_status_space_s = macro_f_string_static_t_initialize2(F_status_space_s, 0, F_status_space_s_length); - const f_string_static_t f_status_space_not_s = macro_f_string_static_t_initialize2(F_status_space_not_s, 0, F_status_space_not_s_length); - const f_string_static_t f_status_start_s = macro_f_string_static_t_initialize2(F_status_start_s, 0, F_status_start_s_length); - const f_string_static_t f_status_start_not_s = macro_f_string_static_t_initialize2(F_status_start_not_s, 0, F_status_start_not_s_length); - const f_string_static_t f_status_stop_s = macro_f_string_static_t_initialize2(F_status_stop_s, 0, F_status_stop_s_length); - const f_string_static_t f_status_stop_not_s = macro_f_string_static_t_initialize2(F_status_stop_not_s, 0, F_status_stop_not_s_length); - const f_string_static_t f_status_stream_s = macro_f_string_static_t_initialize2(F_status_stream_s, 0, F_status_stream_s_length); - const f_string_static_t f_status_stream_not_s = macro_f_string_static_t_initialize2(F_status_stream_not_s, 0, F_status_stream_not_s_length); - const f_string_static_t f_status_string_s = macro_f_string_static_t_initialize2(F_status_string_s, 0, F_status_string_s_length); - const f_string_static_t f_status_string_not_s = macro_f_string_static_t_initialize2(F_status_string_not_s, 0, F_status_string_not_s_length); - const f_string_static_t f_status_string_too_large_s = macro_f_string_static_t_initialize2(F_status_string_too_large_s, 0, F_status_string_too_large_s_length); - const f_string_static_t f_status_string_too_small_s = macro_f_string_static_t_initialize2(F_status_string_too_small_s, 0, F_status_string_too_small_s_length); - const f_string_static_t f_status_syntax_s = macro_f_string_static_t_initialize2(F_status_syntax_s, 0, F_status_syntax_s_length); - const f_string_static_t f_status_syntax_not_s = macro_f_string_static_t_initialize2(F_status_syntax_not_s, 0, F_status_syntax_not_s_length); - const f_string_static_t f_status_thread_s = macro_f_string_static_t_initialize2(F_status_thread_s, 0, F_status_thread_s_length); - const f_string_static_t f_status_thread_not_s = macro_f_string_static_t_initialize2(F_status_thread_not_s, 0, F_status_thread_not_s_length); - const f_string_static_t f_status_time_s = macro_f_string_static_t_initialize2(F_status_time_s, 0, F_status_time_s_length); - const f_string_static_t f_status_time_not_s = macro_f_string_static_t_initialize2(F_status_time_not_s, 0, F_status_time_not_s_length); - const f_string_static_t f_status_time_out_s = macro_f_string_static_t_initialize2(F_status_time_out_s, 0, F_status_time_out_s_length); - const f_string_static_t f_status_too_large_s = macro_f_string_static_t_initialize2(F_status_too_large_s, 0, F_status_too_large_s_length); - const f_string_static_t f_status_too_small_s = macro_f_string_static_t_initialize2(F_status_too_small_s, 0, F_status_too_small_s_length); - const f_string_static_t f_status_type_s = macro_f_string_static_t_initialize2(F_status_type_s, 0, F_status_type_s_length); - const f_string_static_t f_status_type_not_s = macro_f_string_static_t_initialize2(F_status_type_not_s, 0, F_status_type_not_s_length); - const f_string_static_t f_status_success_s = macro_f_string_static_t_initialize2(F_status_success_s, 0, F_status_success_s_length); - const f_string_static_t f_status_success_not_s = macro_f_string_static_t_initialize2(F_status_success_not_s, 0, F_status_success_not_s_length); - const f_string_static_t f_status_supported_s = macro_f_string_static_t_initialize2(F_status_supported_s, 0, F_status_supported_s_length); - const f_string_static_t f_status_supported_not_s = macro_f_string_static_t_initialize2(F_status_supported_not_s, 0, F_status_supported_not_s_length); - const f_string_static_t f_status_user_s = macro_f_string_static_t_initialize2(F_status_user_s, 0, F_status_user_s_length); - const f_string_static_t f_status_user_not_s = macro_f_string_static_t_initialize2(F_status_user_not_s, 0, F_status_user_not_s_length); - const f_string_static_t f_status_utf_s = macro_f_string_static_t_initialize2(F_status_utf_s, 0, F_status_utf_s_length); - const f_string_static_t f_status_utf_fragment_s = macro_f_string_static_t_initialize2(F_status_utf_fragment_s, 0, F_status_utf_fragment_s_length); - const f_string_static_t f_status_utf_fragment_not_s = macro_f_string_static_t_initialize2(F_status_utf_fragment_not_s, 0, F_status_utf_fragment_not_s_length); - const f_string_static_t f_status_utf_not_s = macro_f_string_static_t_initialize2(F_status_utf_not_s, 0, F_status_utf_not_s_length); - const f_string_static_t f_status_valid_s = macro_f_string_static_t_initialize2(F_status_valid_s, 0, F_status_valid_s_length); - const f_string_static_t f_status_valid_not_s = macro_f_string_static_t_initialize2(F_status_valid_not_s, 0, F_status_valid_not_s_length); - const f_string_static_t f_status_value_s = macro_f_string_static_t_initialize2(F_status_value_s, 0, F_status_value_s_length); - const f_string_static_t f_status_value_not_s = macro_f_string_static_t_initialize2(F_status_value_not_s, 0, F_status_value_not_s_length); - const f_string_static_t f_status_wait_s = macro_f_string_static_t_initialize2(F_status_wait_s, 0, F_status_wait_s_length); - const f_string_static_t f_status_wait_not_s = macro_f_string_static_t_initialize2(F_status_wait_not_s, 0, F_status_wait_not_s_length); - const f_string_static_t f_status_warn_s = macro_f_string_static_t_initialize2(F_status_warn_s, 0, F_status_warn_s_length); - const f_string_static_t f_status_warn_not_s = macro_f_string_static_t_initialize2(F_status_warn_not_s, 0, F_status_warn_not_s_length); - const f_string_static_t f_status_world_s = macro_f_string_static_t_initialize2(F_status_world_s, 0, F_status_world_s_length); - const f_string_static_t f_status_world_not_s = macro_f_string_static_t_initialize2(F_status_world_not_s, 0, F_status_world_not_s_length); - const f_string_static_t f_status_write_s = macro_f_string_static_t_initialize2(F_status_write_s, 0, F_status_write_s_length); - const f_string_static_t f_status_write_not_s = macro_f_string_static_t_initialize2(F_status_write_not_s, 0, F_status_write_not_s_length); - const f_string_static_t f_status_write_only_s = macro_f_string_static_t_initialize2(F_status_write_only_s, 0, F_status_write_only_s_length); + const f_string_static_t f_status_none_s = macro_f_string_static_t_initialize(F_status_none_s, 0, F_status_none_s_length); + const f_string_static_t f_status_abort_s = macro_f_string_static_t_initialize(F_status_abort_s, 0, F_status_abort_s_length); + const f_string_static_t f_status_abort_not_s = macro_f_string_static_t_initialize(F_status_abort_not_s, 0, F_status_abort_not_s_length); + const f_string_static_t f_status_absolute_s = macro_f_string_static_t_initialize(F_status_absolute_s, 0, F_status_absolute_s_length); + const f_string_static_t f_status_absolute_not_s = macro_f_string_static_t_initialize(F_status_absolute_not_s, 0, F_status_absolute_not_s_length); + const f_string_static_t f_status_address_s = macro_f_string_static_t_initialize(F_status_address_s, 0, F_status_address_s_length); + const f_string_static_t f_status_address_not_s = macro_f_string_static_t_initialize(F_status_address_not_s, 0, F_status_address_not_s_length); + const f_string_static_t f_status_ascii_s = macro_f_string_static_t_initialize(F_status_ascii_s, 0, F_status_ascii_s_length); + const f_string_static_t f_status_ascii_not_s = macro_f_string_static_t_initialize(F_status_ascii_not_s, 0, F_status_ascii_not_s_length); + const f_string_static_t f_status_atomic_s = macro_f_string_static_t_initialize(F_status_atomic_s, 0, F_status_atomic_s_length); + const f_string_static_t f_status_atomic_not_s = macro_f_string_static_t_initialize(F_status_atomic_not_s, 0, F_status_atomic_not_s_length); + const f_string_static_t f_status_begin_s = macro_f_string_static_t_initialize(F_status_begin_s, 0, F_status_begin_s_length); + const f_string_static_t f_status_begin_not_s = macro_f_string_static_t_initialize(F_status_begin_not_s, 0, F_status_begin_not_s_length); + const f_string_static_t f_status_block_s = macro_f_string_static_t_initialize(F_status_block_s, 0, F_status_block_s_length); + const f_string_static_t f_status_block_not_s = macro_f_string_static_t_initialize(F_status_block_not_s, 0, F_status_block_not_s_length); + const f_string_static_t f_status_body_s = macro_f_string_static_t_initialize(F_status_body_s, 0, F_status_body_s_length); + const f_string_static_t f_status_body_not_s = macro_f_string_static_t_initialize(F_status_body_not_s, 0, F_status_body_not_s_length); + const f_string_static_t f_status_bound_s = macro_f_string_static_t_initialize(F_status_bound_s, 0, F_status_bound_s_length); + const f_string_static_t f_status_bound_not_s = macro_f_string_static_t_initialize(F_status_bound_not_s, 0, F_status_bound_not_s_length); + const f_string_static_t f_status_capability_s = macro_f_string_static_t_initialize(F_status_capability_s, 0, F_status_capability_s_length); + const f_string_static_t f_status_capability_not_s = macro_f_string_static_t_initialize(F_status_capability_not_s, 0, F_status_capability_not_s_length); + const f_string_static_t f_status_child_s = macro_f_string_static_t_initialize(F_status_child_s, 0, F_status_child_s_length); + const f_string_static_t f_status_child_not_s = macro_f_string_static_t_initialize(F_status_child_not_s, 0, F_status_child_not_s_length); + const f_string_static_t f_status_complete_s = macro_f_string_static_t_initialize(F_status_complete_s, 0, F_status_complete_s_length); + const f_string_static_t f_status_complete_not_s = macro_f_string_static_t_initialize(F_status_complete_not_s, 0, F_status_complete_not_s_length); + const f_string_static_t f_status_connect_s = macro_f_string_static_t_initialize(F_status_connect_s, 0, F_status_connect_s_length); + const f_string_static_t f_status_connect_not_s = macro_f_string_static_t_initialize(F_status_connect_not_s, 0, F_status_connect_not_s_length); + const f_string_static_t f_status_connect_refuse_s = macro_f_string_static_t_initialize(F_status_connect_refuse_s, 0, F_status_connect_refuse_s_length); + const f_string_static_t f_status_connect_reset_s = macro_f_string_static_t_initialize(F_status_connect_reset_s, 0, F_status_connect_reset_s_length); + const f_string_static_t f_status_container_s = macro_f_string_static_t_initialize(F_status_container_s, 0, F_status_container_s_length); + const f_string_static_t f_status_container_not_s = macro_f_string_static_t_initialize(F_status_container_not_s, 0, F_status_container_not_s_length); + const f_string_static_t f_status_content_s = macro_f_string_static_t_initialize(F_status_content_s, 0, F_status_content_s_length); + const f_string_static_t f_status_content_not_s = macro_f_string_static_t_initialize(F_status_content_not_s, 0, F_status_content_not_s_length); + const f_string_static_t f_status_continue_s = macro_f_string_static_t_initialize(F_status_continue_s, 0, F_status_continue_s_length); + const f_string_static_t f_status_continue_not_s = macro_f_string_static_t_initialize(F_status_continue_not_s, 0, F_status_continue_not_s_length); + const f_string_static_t f_status_control_s = macro_f_string_static_t_initialize(F_status_control_s, 0, F_status_control_s_length); + const f_string_static_t f_status_control_not_s = macro_f_string_static_t_initialize(F_status_control_not_s, 0, F_status_control_not_s_length); + const f_string_static_t f_status_control_group_s = macro_f_string_static_t_initialize(F_status_control_group_s, 0, F_status_control_group_s_length); + const f_string_static_t f_status_control_group_not_s = macro_f_string_static_t_initialize(F_status_control_group_not_s, 0, F_status_control_group_not_s_length); + const f_string_static_t f_status_critical_s = macro_f_string_static_t_initialize(F_status_critical_s, 0, F_status_critical_s_length); + const f_string_static_t f_status_critical_not_s = macro_f_string_static_t_initialize(F_status_critical_not_s, 0, F_status_critical_not_s_length); + const f_string_static_t f_status_dead_s = macro_f_string_static_t_initialize(F_status_dead_s, 0, F_status_dead_s_length); + const f_string_static_t f_status_dead_not_s = macro_f_string_static_t_initialize(F_status_dead_not_s, 0, F_status_dead_not_s_length); + const f_string_static_t f_status_deadlock_s = macro_f_string_static_t_initialize(F_status_deadlock_s, 0, F_status_deadlock_s_length); + const f_string_static_t f_status_deadlock_not_s = macro_f_string_static_t_initialize(F_status_deadlock_not_s, 0, F_status_deadlock_not_s_length); + const f_string_static_t f_status_descriptor_s = macro_f_string_static_t_initialize(F_status_descriptor_s, 0, F_status_descriptor_s_length); + const f_string_static_t f_status_descriptor_not_s = macro_f_string_static_t_initialize(F_status_descriptor_not_s, 0, F_status_descriptor_not_s_length); + const f_string_static_t f_status_device_s = macro_f_string_static_t_initialize(F_status_device_s, 0, F_status_device_s_length); + const f_string_static_t f_status_device_not_s = macro_f_string_static_t_initialize(F_status_device_not_s, 0, F_status_device_not_s_length); + const f_string_static_t f_status_disable_s = macro_f_string_static_t_initialize(F_status_disable_s, 0, F_status_disable_s_length); + const f_string_static_t f_status_disable_not_s = macro_f_string_static_t_initialize(F_status_disable_not_s, 0, F_status_disable_not_s_length); + const f_string_static_t f_status_domain_s = macro_f_string_static_t_initialize(F_status_domain_s, 0, F_status_domain_s_length); + const f_string_static_t f_status_domain_not_s = macro_f_string_static_t_initialize(F_status_domain_not_s, 0, F_status_domain_not_s_length); + const f_string_static_t f_status_done_s = macro_f_string_static_t_initialize(F_status_done_s, 0, F_status_done_s_length); + const f_string_static_t f_status_done_not_s = macro_f_string_static_t_initialize(F_status_done_not_s, 0, F_status_done_not_s_length); + const f_string_static_t f_status_dummy_s = macro_f_string_static_t_initialize(F_status_dummy_s, 0, F_status_dummy_s_length); + const f_string_static_t f_status_dummy_not_s = macro_f_string_static_t_initialize(F_status_dummy_not_s, 0, F_status_dummy_not_s_length); + const f_string_static_t f_status_empty_s = macro_f_string_static_t_initialize(F_status_empty_s, 0, F_status_empty_s_length); + const f_string_static_t f_status_empty_not_s = macro_f_string_static_t_initialize(F_status_empty_not_s, 0, F_status_empty_not_s_length); + const f_string_static_t f_status_enable_s = macro_f_string_static_t_initialize(F_status_enable_s, 0, F_status_enable_s_length); + const f_string_static_t f_status_enable_not_s = macro_f_string_static_t_initialize(F_status_enable_not_s, 0, F_status_enable_not_s_length); + const f_string_static_t f_status_encoding_s = macro_f_string_static_t_initialize(F_status_encoding_s, 0, F_status_encoding_s_length); + const f_string_static_t f_status_encoding_not_s = macro_f_string_static_t_initialize(F_status_encoding_not_s, 0, F_status_encoding_not_s_length); + const f_string_static_t f_status_end_s = macro_f_string_static_t_initialize(F_status_end_s, 0, F_status_end_s_length); + const f_string_static_t f_status_end_not_s = macro_f_string_static_t_initialize(F_status_end_not_s, 0, F_status_end_not_s_length); + const f_string_static_t f_status_endian_s = macro_f_string_static_t_initialize(F_status_endian_s, 0, F_status_endian_s_length); + const f_string_static_t f_status_endian_big_s = macro_f_string_static_t_initialize(F_status_endian_big_s, 0, F_status_endian_big_s_length); + const f_string_static_t f_status_endian_little_s = macro_f_string_static_t_initialize(F_status_endian_little_s, 0, F_status_endian_little_s_length); + const f_string_static_t f_status_endian_not_s = macro_f_string_static_t_initialize(F_status_endian_not_s, 0, F_status_endian_not_s_length); + const f_string_static_t f_status_eoa_s = macro_f_string_static_t_initialize(F_status_eoa_s, 0, F_status_eoa_s_length); + const f_string_static_t f_status_eoa_not_s = macro_f_string_static_t_initialize(F_status_eoa_not_s, 0, F_status_eoa_not_s_length); + const f_string_static_t f_status_eof_s = macro_f_string_static_t_initialize(F_status_eof_s, 0, F_status_eof_s_length); + const f_string_static_t f_status_eof_not_s = macro_f_string_static_t_initialize(F_status_eof_not_s, 0, F_status_eof_not_s_length); + const f_string_static_t f_status_eol_s = macro_f_string_static_t_initialize(F_status_eol_s, 0, F_status_eol_s_length); + const f_string_static_t f_status_eol_not_s = macro_f_string_static_t_initialize(F_status_eol_not_s, 0, F_status_eol_not_s_length); + const f_string_static_t f_status_eos_s = macro_f_string_static_t_initialize(F_status_eos_s, 0, F_status_eos_s_length); + const f_string_static_t f_status_eos_not_s = macro_f_string_static_t_initialize(F_status_eos_not_s, 0, F_status_eos_not_s_length); + const f_string_static_t f_status_execute_s = macro_f_string_static_t_initialize(F_status_execute_s, 0, F_status_execute_s_length); + const f_string_static_t f_status_execute_not_s = macro_f_string_static_t_initialize(F_status_execute_not_s, 0, F_status_execute_not_s_length); + const f_string_static_t f_status_exist_s = macro_f_string_static_t_initialize(F_status_exist_s, 0, F_status_exist_s_length); + const f_string_static_t f_status_exist_not_s = macro_f_string_static_t_initialize(F_status_exist_not_s, 0, F_status_exist_not_s_length); + const f_string_static_t f_status_failure_s = macro_f_string_static_t_initialize(F_status_failure_s, 0, F_status_failure_s_length); + const f_string_static_t f_status_failure_not_s = macro_f_string_static_t_initialize(F_status_failure_not_s, 0, F_status_failure_not_s_length); + const f_string_static_t f_status_family_s = macro_f_string_static_t_initialize(F_status_family_s, 0, F_status_family_s_length); + const f_string_static_t f_status_family_not_s = macro_f_string_static_t_initialize(F_status_family_not_s, 0, F_status_family_not_s_length); + const f_string_static_t f_status_first_s = macro_f_string_static_t_initialize(F_status_first_s, 0, F_status_first_s_length); + const f_string_static_t f_status_first_not_s = macro_f_string_static_t_initialize(F_status_first_not_s, 0, F_status_first_not_s_length); + const f_string_static_t f_status_footer_s = macro_f_string_static_t_initialize(F_status_footer_s, 0, F_status_footer_s_length); + const f_string_static_t f_status_footer_not_s = macro_f_string_static_t_initialize(F_status_footer_not_s, 0, F_status_footer_not_s_length); + const f_string_static_t f_status_fork_s = macro_f_string_static_t_initialize(F_status_fork_s, 0, F_status_fork_s_length); + const f_string_static_t f_status_fork_not_s = macro_f_string_static_t_initialize(F_status_fork_not_s, 0, F_status_fork_not_s_length); + const f_string_static_t f_status_format_s = macro_f_string_static_t_initialize(F_status_format_s, 0, F_status_format_s_length); + const f_string_static_t f_status_format_not_s = macro_f_string_static_t_initialize(F_status_format_not_s, 0, F_status_format_not_s_length); + const f_string_static_t f_status_found_s = macro_f_string_static_t_initialize(F_status_found_s, 0, F_status_found_s_length); + const f_string_static_t f_status_found_not_s = macro_f_string_static_t_initialize(F_status_found_not_s, 0, F_status_found_not_s_length); + const f_string_static_t f_status_full_s = macro_f_string_static_t_initialize(F_status_full_s, 0, F_status_full_s_length); + const f_string_static_t f_status_full_not_s = macro_f_string_static_t_initialize(F_status_full_not_s, 0, F_status_full_not_s_length); + const f_string_static_t f_status_group_s = macro_f_string_static_t_initialize(F_status_group_s, 0, F_status_group_s_length); + const f_string_static_t f_status_group_not_s = macro_f_string_static_t_initialize(F_status_group_not_s, 0, F_status_group_not_s_length); + const f_string_static_t f_status_header_s = macro_f_string_static_t_initialize(F_status_header_s, 0, F_status_header_s_length); + const f_string_static_t f_status_header_not_s = macro_f_string_static_t_initialize(F_status_header_not_s, 0, F_status_header_not_s_length); + const f_string_static_t f_status_ignore_s = macro_f_string_static_t_initialize(F_status_ignore_s, 0, F_status_ignore_s_length); + const f_string_static_t f_status_ignore_not_s = macro_f_string_static_t_initialize(F_status_ignore_not_s, 0, F_status_ignore_not_s_length); + const f_string_static_t f_status_implemented_s = macro_f_string_static_t_initialize(F_status_implemented_s, 0, F_status_implemented_s_length); + const f_string_static_t f_status_implemented_not_s = macro_f_string_static_t_initialize(F_status_implemented_not_s, 0, F_status_implemented_not_s_length); + const f_string_static_t f_status_input_s = macro_f_string_static_t_initialize(F_status_input_s, 0, F_status_input_s_length); + const f_string_static_t f_status_input_not_s = macro_f_string_static_t_initialize(F_status_input_not_s, 0, F_status_input_not_s_length); + const f_string_static_t f_status_input_output_s = macro_f_string_static_t_initialize(F_status_input_output_s, 0, F_status_input_output_s_length); + const f_string_static_t f_status_interrupt_s = macro_f_string_static_t_initialize(F_status_interrupt_s, 0, F_status_interrupt_s_length); + const f_string_static_t f_status_interrupt_not_s = macro_f_string_static_t_initialize(F_status_interrupt_not_s, 0, F_status_interrupt_not_s_length); + const f_string_static_t f_status_known_s = macro_f_string_static_t_initialize(F_status_known_s, 0, F_status_known_s_length); + const f_string_static_t f_status_known_not_s = macro_f_string_static_t_initialize(F_status_known_not_s, 0, F_status_known_not_s_length); + const f_string_static_t f_status_last_s = macro_f_string_static_t_initialize(F_status_last_s, 0, F_status_last_s_length); + const f_string_static_t f_status_last_not_s = macro_f_string_static_t_initialize(F_status_last_not_s, 0, F_status_last_not_s_length); + const f_string_static_t f_status_limit_s = macro_f_string_static_t_initialize(F_status_limit_s, 0, F_status_limit_s_length); + const f_string_static_t f_status_limit_not_s = macro_f_string_static_t_initialize(F_status_limit_not_s, 0, F_status_limit_not_s_length); + const f_string_static_t f_status_link_s = macro_f_string_static_t_initialize(F_status_link_s, 0, F_status_link_s_length); + const f_string_static_t f_status_link_not_s = macro_f_string_static_t_initialize(F_status_link_not_s, 0, F_status_link_not_s_length); + const f_string_static_t f_status_live_s = macro_f_string_static_t_initialize(F_status_live_s, 0, F_status_live_s_length); + const f_string_static_t f_status_live_not_s = macro_f_string_static_t_initialize(F_status_live_not_s, 0, F_status_live_not_s_length); + const f_string_static_t f_status_lock_s = macro_f_string_static_t_initialize(F_status_lock_s, 0, F_status_lock_s_length); + const f_string_static_t f_status_lock_not_s = macro_f_string_static_t_initialize(F_status_lock_not_s, 0, F_status_lock_not_s_length); + const f_string_static_t f_status_loop_s = macro_f_string_static_t_initialize(F_status_loop_s, 0, F_status_loop_s_length); + const f_string_static_t f_status_loop_not_s = macro_f_string_static_t_initialize(F_status_loop_not_s, 0, F_status_loop_not_s_length); + const f_string_static_t f_status_maybe_s = macro_f_string_static_t_initialize(F_status_maybe_s, 0, F_status_maybe_s_length); + const f_string_static_t f_status_maybe_not_s = macro_f_string_static_t_initialize(F_status_maybe_not_s, 0, F_status_maybe_not_s_length); + const f_string_static_t f_status_memory_s = macro_f_string_static_t_initialize(F_status_memory_s, 0, F_status_memory_s_length); + const f_string_static_t f_status_memory_not_s = macro_f_string_static_t_initialize(F_status_memory_not_s, 0, F_status_memory_not_s_length); + const f_string_static_t f_status_message_s = macro_f_string_static_t_initialize(F_status_message_s, 0, F_status_message_s_length); + const f_string_static_t f_status_message_not_s = macro_f_string_static_t_initialize(F_status_message_not_s, 0, F_status_message_not_s_length); + const f_string_static_t f_status_minor_s = macro_f_string_static_t_initialize(F_status_minor_s, 0, F_status_minor_s_length); + const f_string_static_t f_status_minor_not_s = macro_f_string_static_t_initialize(F_status_minor_not_s, 0, F_status_minor_not_s_length); + const f_string_static_t f_status_moderate_s = macro_f_string_static_t_initialize(F_status_moderate_s, 0, F_status_moderate_s_length); + const f_string_static_t f_status_moderate_not_s = macro_f_string_static_t_initialize(F_status_moderate_not_s, 0, F_status_moderate_not_s_length); + const f_string_static_t f_status_mount_s = macro_f_string_static_t_initialize(F_status_mount_s, 0, F_status_mount_s_length); + const f_string_static_t f_status_mount_not_s = macro_f_string_static_t_initialize(F_status_mount_not_s, 0, F_status_mount_not_s_length); + const f_string_static_t f_status_name_s = macro_f_string_static_t_initialize(F_status_name_s, 0, F_status_name_s_length); + const f_string_static_t f_status_name_not_s = macro_f_string_static_t_initialize(F_status_name_not_s, 0, F_status_name_not_s_length); + const f_string_static_t f_status_next_s = macro_f_string_static_t_initialize(F_status_next_s, 0, F_status_next_s_length); + const f_string_static_t f_status_next_not_s = macro_f_string_static_t_initialize(F_status_next_not_s, 0, F_status_next_not_s_length); + const f_string_static_t f_status_nice_s = macro_f_string_static_t_initialize(F_status_nice_s, 0, F_status_nice_s_length); + const f_string_static_t f_status_nice_not_s = macro_f_string_static_t_initialize(F_status_nice_not_s, 0, F_status_nice_not_s_length); + const f_string_static_t f_status_object_s = macro_f_string_static_t_initialize(F_status_object_s, 0, F_status_object_s_length); + const f_string_static_t f_status_object_not_s = macro_f_string_static_t_initialize(F_status_object_not_s, 0, F_status_object_not_s_length); + const f_string_static_t f_status_option_s = macro_f_string_static_t_initialize(F_status_option_s, 0, F_status_option_s_length); + const f_string_static_t f_status_option_not_s = macro_f_string_static_t_initialize(F_status_option_not_s, 0, F_status_option_not_s_length); + const f_string_static_t f_status_output_s = macro_f_string_static_t_initialize(F_status_output_s, 0, F_status_output_s_length); + const f_string_static_t f_status_output_not_s = macro_f_string_static_t_initialize(F_status_output_not_s, 0, F_status_output_not_s_length); + const f_string_static_t f_status_packet_s = macro_f_string_static_t_initialize(F_status_packet_s, 0, F_status_packet_s_length); + const f_string_static_t f_status_packet_not_s = macro_f_string_static_t_initialize(F_status_packet_not_s, 0, F_status_packet_not_s_length); + const f_string_static_t f_status_parameter_s = macro_f_string_static_t_initialize(F_status_parameter_s, 0, F_status_parameter_s_length); + const f_string_static_t f_status_parameter_not_s = macro_f_string_static_t_initialize(F_status_parameter_not_s, 0, F_status_parameter_not_s_length); + const f_string_static_t f_status_parent_s = macro_f_string_static_t_initialize(F_status_parent_s, 0, F_status_parent_s_length); + const f_string_static_t f_status_parent_not_s = macro_f_string_static_t_initialize(F_status_parent_not_s, 0, F_status_parent_not_s_length); + const f_string_static_t f_status_payload_s = macro_f_string_static_t_initialize(F_status_payload_s, 0, F_status_payload_s_length); + const f_string_static_t f_status_payload_not_s = macro_f_string_static_t_initialize(F_status_payload_not_s, 0, F_status_payload_not_s_length); + const f_string_static_t f_status_pipe_s = macro_f_string_static_t_initialize(F_status_pipe_s, 0, F_status_pipe_s_length); + const f_string_static_t f_status_pipe_not_s = macro_f_string_static_t_initialize(F_status_pipe_not_s, 0, F_status_pipe_not_s_length); + const f_string_static_t f_status_port_s = macro_f_string_static_t_initialize(F_status_port_s, 0, F_status_port_s_length); + const f_string_static_t f_status_port_not_s = macro_f_string_static_t_initialize(F_status_port_not_s, 0, F_status_port_not_s_length); + const f_string_static_t f_status_previous_s = macro_f_string_static_t_initialize(F_status_previous_s, 0, F_status_previous_s_length); + const f_string_static_t f_status_previous_not_s = macro_f_string_static_t_initialize(F_status_previous_not_s, 0, F_status_previous_not_s_length); + const f_string_static_t f_status_processor_s = macro_f_string_static_t_initialize(F_status_processor_s, 0, F_status_processor_s_length); + const f_string_static_t f_status_processor_not_s = macro_f_string_static_t_initialize(F_status_processor_not_s, 0, F_status_processor_not_s_length); + const f_string_static_t f_status_progress_s = macro_f_string_static_t_initialize(F_status_progress_s, 0, F_status_progress_s_length); + const f_string_static_t f_status_progress_not_s = macro_f_string_static_t_initialize(F_status_progress_not_s, 0, F_status_progress_not_s_length); + const f_string_static_t f_status_prohibited_s = macro_f_string_static_t_initialize(F_status_prohibited_s, 0, F_status_prohibited_s_length); + const f_string_static_t f_status_prohibited_not_s = macro_f_string_static_t_initialize(F_status_prohibited_not_s, 0, F_status_prohibited_not_s_length); + const f_string_static_t f_status_property_s = macro_f_string_static_t_initialize(F_status_property_s, 0, F_status_property_s_length); + const f_string_static_t f_status_property_not_s = macro_f_string_static_t_initialize(F_status_property_not_s, 0, F_status_property_not_s_length); + const f_string_static_t f_status_protocol_s = macro_f_string_static_t_initialize(F_status_protocol_s, 0, F_status_protocol_s_length); + const f_string_static_t f_status_protocol_not_s = macro_f_string_static_t_initialize(F_status_protocol_not_s, 0, F_status_protocol_not_s_length); + const f_string_static_t f_status_range_s = macro_f_string_static_t_initialize(F_status_range_s, 0, F_status_range_s_length); + const f_string_static_t f_status_range_not_s = macro_f_string_static_t_initialize(F_status_range_not_s, 0, F_status_range_not_s_length); + const f_string_static_t f_status_read_s = macro_f_string_static_t_initialize(F_status_read_s, 0, F_status_read_s_length); + const f_string_static_t f_status_read_not_s = macro_f_string_static_t_initialize(F_status_read_not_s, 0, F_status_read_not_s_length); + const f_string_static_t f_status_read_only_s = macro_f_string_static_t_initialize(F_status_read_only_s, 0, F_status_read_only_s_length); + const f_string_static_t f_status_ready_s = macro_f_string_static_t_initialize(F_status_ready_s, 0, F_status_ready_s_length); + const f_string_static_t f_status_ready_not_s = macro_f_string_static_t_initialize(F_status_ready_not_s, 0, F_status_ready_not_s_length); + const f_string_static_t f_status_recover_s = macro_f_string_static_t_initialize(F_status_recover_s, 0, F_status_recover_s_length); + const f_string_static_t f_status_recover_not_s = macro_f_string_static_t_initialize(F_status_recover_not_s, 0, F_status_recover_not_s_length); + const f_string_static_t f_status_recurse_s = macro_f_string_static_t_initialize(F_status_recurse_s, 0, F_status_recurse_s_length); + const f_string_static_t f_status_recurse_not_s = macro_f_string_static_t_initialize(F_status_recurse_not_s, 0, F_status_recurse_not_s_length); + const f_string_static_t f_status_relative_s = macro_f_string_static_t_initialize(F_status_relative_s, 0, F_status_relative_s_length); + const f_string_static_t f_status_relative_not_s = macro_f_string_static_t_initialize(F_status_relative_not_s, 0, F_status_relative_not_s_length); + const f_string_static_t f_status_require_s = macro_f_string_static_t_initialize(F_status_require_s, 0, F_status_require_s_length); + const f_string_static_t f_status_require_not_s = macro_f_string_static_t_initialize(F_status_require_not_s, 0, F_status_require_not_s_length); + const f_string_static_t f_status_resource_s = macro_f_string_static_t_initialize(F_status_resource_s, 0, F_status_resource_s_length); + const f_string_static_t f_status_resource_not_s = macro_f_string_static_t_initialize(F_status_resource_not_s, 0, F_status_resource_not_s_length); + const f_string_static_t f_status_search_s = macro_f_string_static_t_initialize(F_status_search_s, 0, F_status_search_s_length); + const f_string_static_t f_status_search_not_s = macro_f_string_static_t_initialize(F_status_search_not_s, 0, F_status_search_not_s_length); + const f_string_static_t f_status_schedule_s = macro_f_string_static_t_initialize(F_status_schedule_s, 0, F_status_schedule_s_length); + const f_string_static_t f_status_schedule_not_s = macro_f_string_static_t_initialize(F_status_schedule_not_s, 0, F_status_schedule_not_s_length); + const f_string_static_t f_status_size_s = macro_f_string_static_t_initialize(F_status_size_s, 0, F_status_size_s_length); + const f_string_static_t f_status_size_not_s = macro_f_string_static_t_initialize(F_status_size_not_s, 0, F_status_size_not_s_length); + const f_string_static_t f_status_signal_s = macro_f_string_static_t_initialize(F_status_signal_s, 0, F_status_signal_s_length); + const f_string_static_t f_status_signal_not_s = macro_f_string_static_t_initialize(F_status_signal_not_s, 0, F_status_signal_not_s_length); + const f_string_static_t f_status_space_s = macro_f_string_static_t_initialize(F_status_space_s, 0, F_status_space_s_length); + const f_string_static_t f_status_space_not_s = macro_f_string_static_t_initialize(F_status_space_not_s, 0, F_status_space_not_s_length); + const f_string_static_t f_status_start_s = macro_f_string_static_t_initialize(F_status_start_s, 0, F_status_start_s_length); + const f_string_static_t f_status_start_not_s = macro_f_string_static_t_initialize(F_status_start_not_s, 0, F_status_start_not_s_length); + const f_string_static_t f_status_stop_s = macro_f_string_static_t_initialize(F_status_stop_s, 0, F_status_stop_s_length); + const f_string_static_t f_status_stop_not_s = macro_f_string_static_t_initialize(F_status_stop_not_s, 0, F_status_stop_not_s_length); + const f_string_static_t f_status_stream_s = macro_f_string_static_t_initialize(F_status_stream_s, 0, F_status_stream_s_length); + const f_string_static_t f_status_stream_not_s = macro_f_string_static_t_initialize(F_status_stream_not_s, 0, F_status_stream_not_s_length); + const f_string_static_t f_status_string_s = macro_f_string_static_t_initialize(F_status_string_s, 0, F_status_string_s_length); + const f_string_static_t f_status_string_not_s = macro_f_string_static_t_initialize(F_status_string_not_s, 0, F_status_string_not_s_length); + const f_string_static_t f_status_string_too_large_s = macro_f_string_static_t_initialize(F_status_string_too_large_s, 0, F_status_string_too_large_s_length); + const f_string_static_t f_status_string_too_small_s = macro_f_string_static_t_initialize(F_status_string_too_small_s, 0, F_status_string_too_small_s_length); + const f_string_static_t f_status_syntax_s = macro_f_string_static_t_initialize(F_status_syntax_s, 0, F_status_syntax_s_length); + const f_string_static_t f_status_syntax_not_s = macro_f_string_static_t_initialize(F_status_syntax_not_s, 0, F_status_syntax_not_s_length); + const f_string_static_t f_status_thread_s = macro_f_string_static_t_initialize(F_status_thread_s, 0, F_status_thread_s_length); + const f_string_static_t f_status_thread_not_s = macro_f_string_static_t_initialize(F_status_thread_not_s, 0, F_status_thread_not_s_length); + const f_string_static_t f_status_time_s = macro_f_string_static_t_initialize(F_status_time_s, 0, F_status_time_s_length); + const f_string_static_t f_status_time_not_s = macro_f_string_static_t_initialize(F_status_time_not_s, 0, F_status_time_not_s_length); + const f_string_static_t f_status_time_out_s = macro_f_string_static_t_initialize(F_status_time_out_s, 0, F_status_time_out_s_length); + const f_string_static_t f_status_too_large_s = macro_f_string_static_t_initialize(F_status_too_large_s, 0, F_status_too_large_s_length); + const f_string_static_t f_status_too_small_s = macro_f_string_static_t_initialize(F_status_too_small_s, 0, F_status_too_small_s_length); + const f_string_static_t f_status_type_s = macro_f_string_static_t_initialize(F_status_type_s, 0, F_status_type_s_length); + const f_string_static_t f_status_type_not_s = macro_f_string_static_t_initialize(F_status_type_not_s, 0, F_status_type_not_s_length); + const f_string_static_t f_status_success_s = macro_f_string_static_t_initialize(F_status_success_s, 0, F_status_success_s_length); + const f_string_static_t f_status_success_not_s = macro_f_string_static_t_initialize(F_status_success_not_s, 0, F_status_success_not_s_length); + const f_string_static_t f_status_supported_s = macro_f_string_static_t_initialize(F_status_supported_s, 0, F_status_supported_s_length); + const f_string_static_t f_status_supported_not_s = macro_f_string_static_t_initialize(F_status_supported_not_s, 0, F_status_supported_not_s_length); + const f_string_static_t f_status_user_s = macro_f_string_static_t_initialize(F_status_user_s, 0, F_status_user_s_length); + const f_string_static_t f_status_user_not_s = macro_f_string_static_t_initialize(F_status_user_not_s, 0, F_status_user_not_s_length); + const f_string_static_t f_status_utf_s = macro_f_string_static_t_initialize(F_status_utf_s, 0, F_status_utf_s_length); + const f_string_static_t f_status_utf_fragment_s = macro_f_string_static_t_initialize(F_status_utf_fragment_s, 0, F_status_utf_fragment_s_length); + const f_string_static_t f_status_utf_fragment_not_s = macro_f_string_static_t_initialize(F_status_utf_fragment_not_s, 0, F_status_utf_fragment_not_s_length); + const f_string_static_t f_status_utf_not_s = macro_f_string_static_t_initialize(F_status_utf_not_s, 0, F_status_utf_not_s_length); + const f_string_static_t f_status_valid_s = macro_f_string_static_t_initialize(F_status_valid_s, 0, F_status_valid_s_length); + const f_string_static_t f_status_valid_not_s = macro_f_string_static_t_initialize(F_status_valid_not_s, 0, F_status_valid_not_s_length); + const f_string_static_t f_status_value_s = macro_f_string_static_t_initialize(F_status_value_s, 0, F_status_value_s_length); + const f_string_static_t f_status_value_not_s = macro_f_string_static_t_initialize(F_status_value_not_s, 0, F_status_value_not_s_length); + const f_string_static_t f_status_wait_s = macro_f_string_static_t_initialize(F_status_wait_s, 0, F_status_wait_s_length); + const f_string_static_t f_status_wait_not_s = macro_f_string_static_t_initialize(F_status_wait_not_s, 0, F_status_wait_not_s_length); + const f_string_static_t f_status_warn_s = macro_f_string_static_t_initialize(F_status_warn_s, 0, F_status_warn_s_length); + const f_string_static_t f_status_warn_not_s = macro_f_string_static_t_initialize(F_status_warn_not_s, 0, F_status_warn_not_s_length); + const f_string_static_t f_status_world_s = macro_f_string_static_t_initialize(F_status_world_s, 0, F_status_world_s_length); + const f_string_static_t f_status_world_not_s = macro_f_string_static_t_initialize(F_status_world_not_s, 0, F_status_world_not_s_length); + const f_string_static_t f_status_write_s = macro_f_string_static_t_initialize(F_status_write_s, 0, F_status_write_s_length); + const f_string_static_t f_status_write_not_s = macro_f_string_static_t_initialize(F_status_write_not_s, 0, F_status_write_not_s_length); + const f_string_static_t f_status_write_only_s = macro_f_string_static_t_initialize(F_status_write_only_s, 0, F_status_write_only_s_length); #endif // _di_F_status_basic_ #ifndef _di_F_status_array_ - const f_string_static_t f_status_array_s = macro_f_string_static_t_initialize2(F_status_array_s, 0, F_status_array_s_length); - const f_string_static_t f_status_array_not_s = macro_f_string_static_t_initialize2(F_status_array_not_s, 0, F_status_array_not_s_length); - const f_string_static_t f_status_array_too_large_s = macro_f_string_static_t_initialize2(F_status_array_too_large_s, 0, F_status_array_too_large_s_length); - const f_string_static_t f_status_array_too_small_s = macro_f_string_static_t_initialize2(F_status_array_too_small_s, 0, F_status_array_too_small_s_length); + const f_string_static_t f_status_array_s = macro_f_string_static_t_initialize(F_status_array_s, 0, F_status_array_s_length); + const f_string_static_t f_status_array_not_s = macro_f_string_static_t_initialize(F_status_array_not_s, 0, F_status_array_not_s_length); + const f_string_static_t f_status_array_too_large_s = macro_f_string_static_t_initialize(F_status_array_too_large_s, 0, F_status_array_too_large_s_length); + const f_string_static_t f_status_array_too_small_s = macro_f_string_static_t_initialize(F_status_array_too_small_s, 0, F_status_array_too_small_s_length); #endif // _di_F_status_array_ #ifndef _di_F_status_available_ - const f_string_static_t f_status_available_s = macro_f_string_static_t_initialize2(F_status_available_s, 0, F_status_available_s_length); - const f_string_static_t f_status_available_not_s = macro_f_string_static_t_initialize2(F_status_available_not_s, 0, F_status_available_not_s_length); - const f_string_static_t f_status_available_not_address_s = macro_f_string_static_t_initialize2(F_status_available_not_address_s, 0, F_status_available_not_address_s_length); - const f_string_static_t f_status_available_not_buffer_s = macro_f_string_static_t_initialize2(F_status_available_not_buffer_s, 0, F_status_available_not_buffer_s_length); - const f_string_static_t f_status_available_not_device_s = macro_f_string_static_t_initialize2(F_status_available_not_device_s, 0, F_status_available_not_device_s_length); - const f_string_static_t f_status_available_not_pipe_s = macro_f_string_static_t_initialize2(F_status_available_not_pipe_s, 0, F_status_available_not_pipe_s_length); - const f_string_static_t f_status_available_not_port_s = macro_f_string_static_t_initialize2(F_status_available_not_port_s, 0, F_status_available_not_port_s_length); - const f_string_static_t f_status_available_not_process_s = macro_f_string_static_t_initialize2(F_status_available_not_process_s, 0, F_status_available_not_process_s_length); - const f_string_static_t f_status_available_not_socket_s = macro_f_string_static_t_initialize2(F_status_available_not_socket_s, 0, F_status_available_not_socket_s_length); + const f_string_static_t f_status_available_s = macro_f_string_static_t_initialize(F_status_available_s, 0, F_status_available_s_length); + const f_string_static_t f_status_available_not_s = macro_f_string_static_t_initialize(F_status_available_not_s, 0, F_status_available_not_s_length); + const f_string_static_t f_status_available_not_address_s = macro_f_string_static_t_initialize(F_status_available_not_address_s, 0, F_status_available_not_address_s_length); + const f_string_static_t f_status_available_not_buffer_s = macro_f_string_static_t_initialize(F_status_available_not_buffer_s, 0, F_status_available_not_buffer_s_length); + const f_string_static_t f_status_available_not_device_s = macro_f_string_static_t_initialize(F_status_available_not_device_s, 0, F_status_available_not_device_s_length); + const f_string_static_t f_status_available_not_pipe_s = macro_f_string_static_t_initialize(F_status_available_not_pipe_s, 0, F_status_available_not_pipe_s_length); + const f_string_static_t f_status_available_not_port_s = macro_f_string_static_t_initialize(F_status_available_not_port_s, 0, F_status_available_not_port_s_length); + const f_string_static_t f_status_available_not_process_s = macro_f_string_static_t_initialize(F_status_available_not_process_s, 0, F_status_available_not_process_s_length); + const f_string_static_t f_status_available_not_socket_s = macro_f_string_static_t_initialize(F_status_available_not_socket_s, 0, F_status_available_not_socket_s_length); #endif // _di_F_status_available_ #ifndef _di_F_status_busy_ - const f_string_static_t f_status_busy_s = macro_f_string_static_t_initialize2(F_status_busy_s, 0, F_status_busy_s_length); - const f_string_static_t f_status_busy_address_s = macro_f_string_static_t_initialize2(F_status_busy_address_s, 0, F_status_busy_address_s_length); - const f_string_static_t f_status_busy_buffer_s = macro_f_string_static_t_initialize2(F_status_busy_buffer_s, 0, F_status_busy_buffer_s_length); - const f_string_static_t f_status_busy_device_s = macro_f_string_static_t_initialize2(F_status_busy_device_s, 0, F_status_busy_device_s_length); - const f_string_static_t f_status_busy_not_s = macro_f_string_static_t_initialize2(F_status_busy_not_s, 0, F_status_busy_not_s_length); - const f_string_static_t f_status_busy_pipe_s = macro_f_string_static_t_initialize2(F_status_busy_pipe_s, 0, F_status_busy_pipe_s_length); - const f_string_static_t f_status_busy_port_s = macro_f_string_static_t_initialize2(F_status_busy_port_s, 0, F_status_busy_port_s_length); - const f_string_static_t f_status_busy_process_s = macro_f_string_static_t_initialize2(F_status_busy_process_s, 0, F_status_busy_process_s_length); - const f_string_static_t f_status_busy_socket_s = macro_f_string_static_t_initialize2(F_status_busy_socket_s, 0, F_status_busy_socket_s_length); + const f_string_static_t f_status_busy_s = macro_f_string_static_t_initialize(F_status_busy_s, 0, F_status_busy_s_length); + const f_string_static_t f_status_busy_address_s = macro_f_string_static_t_initialize(F_status_busy_address_s, 0, F_status_busy_address_s_length); + const f_string_static_t f_status_busy_buffer_s = macro_f_string_static_t_initialize(F_status_busy_buffer_s, 0, F_status_busy_buffer_s_length); + const f_string_static_t f_status_busy_device_s = macro_f_string_static_t_initialize(F_status_busy_device_s, 0, F_status_busy_device_s_length); + const f_string_static_t f_status_busy_not_s = macro_f_string_static_t_initialize(F_status_busy_not_s, 0, F_status_busy_not_s_length); + const f_string_static_t f_status_busy_pipe_s = macro_f_string_static_t_initialize(F_status_busy_pipe_s, 0, F_status_busy_pipe_s_length); + const f_string_static_t f_status_busy_port_s = macro_f_string_static_t_initialize(F_status_busy_port_s, 0, F_status_busy_port_s_length); + const f_string_static_t f_status_busy_process_s = macro_f_string_static_t_initialize(F_status_busy_process_s, 0, F_status_busy_process_s_length); + const f_string_static_t f_status_busy_socket_s = macro_f_string_static_t_initialize(F_status_busy_socket_s, 0, F_status_busy_socket_s_length); #endif // _di_F_status_busy_ #ifndef _di_F_status_network_ - const f_string_static_t f_status_network_s = macro_f_string_static_t_initialize2(F_status_network_s, 0, F_status_network_s_length); - const f_string_static_t f_status_network_busy_s = macro_f_string_static_t_initialize2(F_status_network_busy_s, 0, F_status_network_busy_s_length); - const f_string_static_t f_status_network_busy_not_s = macro_f_string_static_t_initialize2(F_status_network_busy_not_s, 0, F_status_network_busy_not_s_length); - const f_string_static_t f_status_network_client_s = macro_f_string_static_t_initialize2(F_status_network_client_s, 0, F_status_network_client_s_length); - const f_string_static_t f_status_network_client_not_s = macro_f_string_static_t_initialize2(F_status_network_client_not_s, 0, F_status_network_client_not_s_length); - const f_string_static_t f_status_network_device_s = macro_f_string_static_t_initialize2(F_status_network_device_s, 0, F_status_network_device_s_length); - const f_string_static_t f_status_network_device_not_s = macro_f_string_static_t_initialize2(F_status_network_device_not_s, 0, F_status_network_device_not_s_length); - const f_string_static_t f_status_network_found_s = macro_f_string_static_t_initialize2(F_status_network_found_s, 0, F_status_network_found_s_length); - const f_string_static_t f_status_network_found_not_s = macro_f_string_static_t_initialize2(F_status_network_found_not_s, 0, F_status_network_found_not_s_length); - const f_string_static_t f_status_network_lost_s = macro_f_string_static_t_initialize2(F_status_network_lost_s, 0, F_status_network_lost_s_length); - const f_string_static_t f_status_network_lost_not_s = macro_f_string_static_t_initialize2(F_status_network_lost_not_s, 0, F_status_network_lost_not_s_length); - const f_string_static_t f_status_network_not_s = macro_f_string_static_t_initialize2(F_status_network_not_s, 0, F_status_network_not_s_length); - const f_string_static_t f_status_network_reach_s = macro_f_string_static_t_initialize2(F_status_network_reach_s, 0, F_status_network_reach_s_length); - const f_string_static_t f_status_network_reach_client_s = macro_f_string_static_t_initialize2(F_status_network_reach_client_s, 0, F_status_network_reach_client_s_length); - const f_string_static_t f_status_network_reach_client_not_s = macro_f_string_static_t_initialize2(F_status_network_reach_client_not_s, 0, F_status_network_reach_client_not_s_length); - const f_string_static_t f_status_network_reach_not_s = macro_f_string_static_t_initialize2(F_status_network_reach_not_s, 0, F_status_network_reach_not_s_length); - const f_string_static_t f_status_network_reach_server_s = macro_f_string_static_t_initialize2(F_status_network_reach_server_s, 0, F_status_network_reach_server_s_length); - const f_string_static_t f_status_network_reach_server_not_s = macro_f_string_static_t_initialize2(F_status_network_reach_server_not_s, 0, F_status_network_reach_server_not_s_length); - const f_string_static_t f_status_network_server_s = macro_f_string_static_t_initialize2(F_status_network_server_s, 0, F_status_network_server_s_length); - const f_string_static_t f_status_network_server_not_s = macro_f_string_static_t_initialize2(F_status_network_server_not_s, 0, F_status_network_server_not_s_length); - const f_string_static_t f_status_network_time_s = macro_f_string_static_t_initialize2(F_status_network_time_s, 0, F_status_network_time_s_length); - const f_string_static_t f_status_network_time_not_s = macro_f_string_static_t_initialize2(F_status_network_time_not_s, 0, F_status_network_time_not_s_length); + const f_string_static_t f_status_network_s = macro_f_string_static_t_initialize(F_status_network_s, 0, F_status_network_s_length); + const f_string_static_t f_status_network_busy_s = macro_f_string_static_t_initialize(F_status_network_busy_s, 0, F_status_network_busy_s_length); + const f_string_static_t f_status_network_busy_not_s = macro_f_string_static_t_initialize(F_status_network_busy_not_s, 0, F_status_network_busy_not_s_length); + const f_string_static_t f_status_network_client_s = macro_f_string_static_t_initialize(F_status_network_client_s, 0, F_status_network_client_s_length); + const f_string_static_t f_status_network_client_not_s = macro_f_string_static_t_initialize(F_status_network_client_not_s, 0, F_status_network_client_not_s_length); + const f_string_static_t f_status_network_device_s = macro_f_string_static_t_initialize(F_status_network_device_s, 0, F_status_network_device_s_length); + const f_string_static_t f_status_network_device_not_s = macro_f_string_static_t_initialize(F_status_network_device_not_s, 0, F_status_network_device_not_s_length); + const f_string_static_t f_status_network_found_s = macro_f_string_static_t_initialize(F_status_network_found_s, 0, F_status_network_found_s_length); + const f_string_static_t f_status_network_found_not_s = macro_f_string_static_t_initialize(F_status_network_found_not_s, 0, F_status_network_found_not_s_length); + const f_string_static_t f_status_network_lost_s = macro_f_string_static_t_initialize(F_status_network_lost_s, 0, F_status_network_lost_s_length); + const f_string_static_t f_status_network_lost_not_s = macro_f_string_static_t_initialize(F_status_network_lost_not_s, 0, F_status_network_lost_not_s_length); + const f_string_static_t f_status_network_not_s = macro_f_string_static_t_initialize(F_status_network_not_s, 0, F_status_network_not_s_length); + const f_string_static_t f_status_network_reach_s = macro_f_string_static_t_initialize(F_status_network_reach_s, 0, F_status_network_reach_s_length); + const f_string_static_t f_status_network_reach_client_s = macro_f_string_static_t_initialize(F_status_network_reach_client_s, 0, F_status_network_reach_client_s_length); + const f_string_static_t f_status_network_reach_client_not_s = macro_f_string_static_t_initialize(F_status_network_reach_client_not_s, 0, F_status_network_reach_client_not_s_length); + const f_string_static_t f_status_network_reach_not_s = macro_f_string_static_t_initialize(F_status_network_reach_not_s, 0, F_status_network_reach_not_s_length); + const f_string_static_t f_status_network_reach_server_s = macro_f_string_static_t_initialize(F_status_network_reach_server_s, 0, F_status_network_reach_server_s_length); + const f_string_static_t f_status_network_reach_server_not_s = macro_f_string_static_t_initialize(F_status_network_reach_server_not_s, 0, F_status_network_reach_server_not_s_length); + const f_string_static_t f_status_network_server_s = macro_f_string_static_t_initialize(F_status_network_server_s, 0, F_status_network_server_s_length); + const f_string_static_t f_status_network_server_not_s = macro_f_string_static_t_initialize(F_status_network_server_not_s, 0, F_status_network_server_not_s_length); + const f_string_static_t f_status_network_time_s = macro_f_string_static_t_initialize(F_status_network_time_s, 0, F_status_network_time_s_length); + const f_string_static_t f_status_network_time_not_s = macro_f_string_static_t_initialize(F_status_network_time_not_s, 0, F_status_network_time_not_s_length); #endif // _di_F_status_network_ #ifndef _di_F_status_number_ - const f_string_static_t f_status_number_s = macro_f_string_static_t_initialize2(F_status_number_s, 0, F_status_number_s_length); - const f_string_static_t f_status_number_decimal_s = macro_f_string_static_t_initialize2(F_status_number_decimal_s, 0, F_status_number_decimal_s_length); - const f_string_static_t f_status_number_decimal_not_s = macro_f_string_static_t_initialize2(F_status_number_decimal_not_s, 0, F_status_number_decimal_not_s_length); - const f_string_static_t f_status_number_divide_by_zero_s = macro_f_string_static_t_initialize2(F_status_number_divide_by_zero_s, 0, F_status_number_divide_by_zero_s_length); - const f_string_static_t f_status_number_negative_s = macro_f_string_static_t_initialize2(F_status_number_negative_s, 0, F_status_number_negative_s_length); - const f_string_static_t f_status_number_negative_not_s = macro_f_string_static_t_initialize2(F_status_number_negative_not_s, 0, F_status_number_negative_not_s_length); - const f_string_static_t f_status_number_not_s = macro_f_string_static_t_initialize2(F_status_number_not_s, 0, F_status_number_not_s_length); - const f_string_static_t f_status_number_overflow_s = macro_f_string_static_t_initialize2(F_status_number_overflow_s, 0, F_status_number_overflow_s_length); - const f_string_static_t f_status_number_positive_s = macro_f_string_static_t_initialize2(F_status_number_positive_s, 0, F_status_number_positive_s_length); - const f_string_static_t f_status_number_positive_not_s = macro_f_string_static_t_initialize2(F_status_number_positive_not_s, 0, F_status_number_positive_not_s_length); - const f_string_static_t f_status_number_too_large_s = macro_f_string_static_t_initialize2(F_status_number_too_large_s, 0, F_status_number_too_large_s_length); - const f_string_static_t f_status_number_too_small_s = macro_f_string_static_t_initialize2(F_status_number_too_small_s, 0, F_status_number_too_small_s_length); - const f_string_static_t f_status_number_underflow_s = macro_f_string_static_t_initialize2(F_status_number_underflow_s, 0, F_status_number_underflow_s_length); - const f_string_static_t f_status_number_whole_s = macro_f_string_static_t_initialize2(F_status_number_whole_s, 0, F_status_number_whole_s_length); - const f_string_static_t f_status_number_whole_not_s = macro_f_string_static_t_initialize2(F_status_number_whole_not_s, 0, F_status_number_whole_not_s_length); - const f_string_static_t f_status_number_zero_s = macro_f_string_static_t_initialize2(F_status_number_zero_s, 0, F_status_number_zero_s_length); - const f_string_static_t f_status_number_zero_not_s = macro_f_string_static_t_initialize2(F_status_number_zero_not_s, 0, F_status_number_zero_not_s_length); + const f_string_static_t f_status_number_s = macro_f_string_static_t_initialize(F_status_number_s, 0, F_status_number_s_length); + const f_string_static_t f_status_number_decimal_s = macro_f_string_static_t_initialize(F_status_number_decimal_s, 0, F_status_number_decimal_s_length); + const f_string_static_t f_status_number_decimal_not_s = macro_f_string_static_t_initialize(F_status_number_decimal_not_s, 0, F_status_number_decimal_not_s_length); + const f_string_static_t f_status_number_divide_by_zero_s = macro_f_string_static_t_initialize(F_status_number_divide_by_zero_s, 0, F_status_number_divide_by_zero_s_length); + const f_string_static_t f_status_number_negative_s = macro_f_string_static_t_initialize(F_status_number_negative_s, 0, F_status_number_negative_s_length); + const f_string_static_t f_status_number_negative_not_s = macro_f_string_static_t_initialize(F_status_number_negative_not_s, 0, F_status_number_negative_not_s_length); + const f_string_static_t f_status_number_not_s = macro_f_string_static_t_initialize(F_status_number_not_s, 0, F_status_number_not_s_length); + const f_string_static_t f_status_number_overflow_s = macro_f_string_static_t_initialize(F_status_number_overflow_s, 0, F_status_number_overflow_s_length); + const f_string_static_t f_status_number_positive_s = macro_f_string_static_t_initialize(F_status_number_positive_s, 0, F_status_number_positive_s_length); + const f_string_static_t f_status_number_positive_not_s = macro_f_string_static_t_initialize(F_status_number_positive_not_s, 0, F_status_number_positive_not_s_length); + const f_string_static_t f_status_number_too_large_s = macro_f_string_static_t_initialize(F_status_number_too_large_s, 0, F_status_number_too_large_s_length); + const f_string_static_t f_status_number_too_small_s = macro_f_string_static_t_initialize(F_status_number_too_small_s, 0, F_status_number_too_small_s_length); + const f_string_static_t f_status_number_underflow_s = macro_f_string_static_t_initialize(F_status_number_underflow_s, 0, F_status_number_underflow_s_length); + const f_string_static_t f_status_number_whole_s = macro_f_string_static_t_initialize(F_status_number_whole_s, 0, F_status_number_whole_s_length); + const f_string_static_t f_status_number_whole_not_s = macro_f_string_static_t_initialize(F_status_number_whole_not_s, 0, F_status_number_whole_not_s_length); + const f_string_static_t f_status_number_zero_s = macro_f_string_static_t_initialize(F_status_number_zero_s, 0, F_status_number_zero_s_length); + const f_string_static_t f_status_number_zero_not_s = macro_f_string_static_t_initialize(F_status_number_zero_not_s, 0, F_status_number_zero_not_s_length); #endif // _di_F_status_number_ #ifndef _di_F_status_buffer_ - const f_string_static_t f_status_buffer_s = macro_f_string_static_t_initialize2(F_status_buffer_s, 0, F_status_buffer_s_length); - const f_string_static_t f_status_buffer_not_s = macro_f_string_static_t_initialize2(F_status_buffer_not_s, 0, F_status_buffer_not_s_length); - const f_string_static_t f_status_buffer_too_large_s = macro_f_string_static_t_initialize2(F_status_buffer_too_large_s, 0, F_status_buffer_too_large_s_length); - const f_string_static_t f_status_buffer_too_small_s = macro_f_string_static_t_initialize2(F_status_buffer_too_small_s, 0, F_status_buffer_too_small_s_length); - const f_string_static_t f_status_complete_not_utf_s = macro_f_string_static_t_initialize2(F_status_complete_not_utf_s, 0, F_status_complete_not_utf_s_length); - const f_string_static_t f_status_complete_not_utf_block_s = macro_f_string_static_t_initialize2(F_status_complete_not_utf_block_s, 0, F_status_complete_not_utf_block_s_length); - const f_string_static_t f_status_complete_not_utf_eoa_s = macro_f_string_static_t_initialize2(F_status_complete_not_utf_eoa_s, 0, F_status_complete_not_utf_eoa_s_length); - const f_string_static_t f_status_complete_not_utf_eof_s = macro_f_string_static_t_initialize2(F_status_complete_not_utf_eof_s, 0, F_status_complete_not_utf_eof_s_length); - const f_string_static_t f_status_complete_not_utf_eol_s = macro_f_string_static_t_initialize2(F_status_complete_not_utf_eol_s, 0, F_status_complete_not_utf_eol_s_length); - const f_string_static_t f_status_complete_not_utf_eos_s = macro_f_string_static_t_initialize2(F_status_complete_not_utf_eos_s, 0, F_status_complete_not_utf_eos_s_length); - const f_string_static_t f_status_complete_not_utf_stop_s = macro_f_string_static_t_initialize2(F_status_complete_not_utf_stop_s, 0, F_status_complete_not_utf_stop_s_length); - const f_string_static_t f_status_none_block_s = macro_f_string_static_t_initialize2(F_status_none_block_s, 0, F_status_none_block_s_length); - const f_string_static_t f_status_none_eoa_s = macro_f_string_static_t_initialize2(F_status_none_eoa_s, 0, F_status_none_eoa_s_length); - const f_string_static_t f_status_none_eof_s = macro_f_string_static_t_initialize2(F_status_none_eof_s, 0, F_status_none_eof_s_length); - const f_string_static_t f_status_none_eol_s = macro_f_string_static_t_initialize2(F_status_none_eol_s, 0, F_status_none_eol_s_length); - const f_string_static_t f_status_none_eos_s = macro_f_string_static_t_initialize2(F_status_none_eos_s, 0, F_status_none_eos_s_length); - const f_string_static_t f_status_none_not_s = macro_f_string_static_t_initialize2(F_status_none_not_s, 0, F_status_none_not_s_length); - const f_string_static_t f_status_none_stop_s = macro_f_string_static_t_initialize2(F_status_none_stop_s, 0, F_status_none_stop_s_length); - const f_string_static_t f_status_data_s = macro_f_string_static_t_initialize2(F_status_data_s, 0, F_status_data_s_length); - const f_string_static_t f_status_data_not_s = macro_f_string_static_t_initialize2(F_status_data_not_s, 0, F_status_data_not_s_length); - const f_string_static_t f_status_data_not_block_s = macro_f_string_static_t_initialize2(F_status_data_not_block_s, 0, F_status_data_not_block_s_length); - const f_string_static_t f_status_data_not_eoa_s = macro_f_string_static_t_initialize2(F_status_data_not_eoa_s, 0, F_status_data_not_eoa_s_length); - const f_string_static_t f_status_data_not_eof_s = macro_f_string_static_t_initialize2(F_status_data_not_eof_s, 0, F_status_data_not_eof_s_length); - const f_string_static_t f_status_data_not_eol_s = macro_f_string_static_t_initialize2(F_status_data_not_eol_s, 0, F_status_data_not_eol_s_length); - const f_string_static_t f_status_data_not_eos_s = macro_f_string_static_t_initialize2(F_status_data_not_eos_s, 0, F_status_data_not_eos_s_length); - const f_string_static_t f_status_data_not_stop_s = macro_f_string_static_t_initialize2(F_status_data_not_stop_s, 0, F_status_data_not_stop_s_length); - const f_string_static_t f_status_terminated_s = macro_f_string_static_t_initialize2(F_status_terminated_s, 0, F_status_terminated_s_length); - const f_string_static_t f_status_terminated_not_s = macro_f_string_static_t_initialize2(F_status_terminated_not_s, 0, F_status_terminated_not_s_length); - const f_string_static_t f_status_terminated_not_block_s = macro_f_string_static_t_initialize2(F_status_terminated_not_block_s, 0, F_status_terminated_not_block_s_length); - const f_string_static_t f_status_terminated_not_eoa_s = macro_f_string_static_t_initialize2(F_status_terminated_not_eoa_s, 0, F_status_terminated_not_eoa_s_length); - const f_string_static_t f_status_terminated_not_eof_s = macro_f_string_static_t_initialize2(F_status_terminated_not_eof_s, 0, F_status_terminated_not_eof_s_length); - const f_string_static_t f_status_terminated_not_eol_s = macro_f_string_static_t_initialize2(F_status_terminated_not_eol_s, 0, F_status_terminated_not_eol_s_length); - const f_string_static_t f_status_terminated_not_eos_s = macro_f_string_static_t_initialize2(F_status_terminated_not_eos_s, 0, F_status_terminated_not_eos_s_length); - const f_string_static_t f_status_terminated_not_stop_s = macro_f_string_static_t_initialize2(F_status_terminated_not_stop_s, 0, F_status_terminated_not_stop_s_length); - const f_string_static_t f_status_terminated_not_group_s = macro_f_string_static_t_initialize2(F_status_terminated_not_group_s, 0, F_status_terminated_not_group_s_length); - const f_string_static_t f_status_terminated_not_group_block_s = macro_f_string_static_t_initialize2(F_status_terminated_not_group_block_s, 0, F_status_terminated_not_group_block_s_length); - const f_string_static_t f_status_terminated_not_group_eoa_s = macro_f_string_static_t_initialize2(F_status_terminated_not_group_eoa_s, 0, F_status_terminated_not_group_eoa_s_length); - const f_string_static_t f_status_terminated_not_group_eof_s = macro_f_string_static_t_initialize2(F_status_terminated_not_group_eof_s, 0, F_status_terminated_not_group_eof_s_length); - const f_string_static_t f_status_terminated_not_group_eol_s = macro_f_string_static_t_initialize2(F_status_terminated_not_group_eol_s, 0, F_status_terminated_not_group_eol_s_length); - const f_string_static_t f_status_terminated_not_group_eos_s = macro_f_string_static_t_initialize2(F_status_terminated_not_group_eos_s, 0, F_status_terminated_not_group_eos_s_length); - const f_string_static_t f_status_terminated_not_group_stop_s = macro_f_string_static_t_initialize2(F_status_terminated_not_group_stop_s, 0, F_status_terminated_not_group_stop_s_length); - const f_string_static_t f_status_terminated_not_nest_s = macro_f_string_static_t_initialize2(F_status_terminated_not_nest_s, 0, F_status_terminated_not_nest_s_length); - const f_string_static_t f_status_terminated_not_nest_block_s = macro_f_string_static_t_initialize2(F_status_terminated_not_nest_block_s, 0, F_status_terminated_not_nest_block_s_length); - const f_string_static_t f_status_terminated_not_nest_eoa_s = macro_f_string_static_t_initialize2(F_status_terminated_not_nest_eoa_s, 0, F_status_terminated_not_nest_eoa_s_length); - const f_string_static_t f_status_terminated_not_nest_eof_s = macro_f_string_static_t_initialize2(F_status_terminated_not_nest_eof_s, 0, F_status_terminated_not_nest_eof_s_length); - const f_string_static_t f_status_terminated_not_nest_eol_s = macro_f_string_static_t_initialize2(F_status_terminated_not_nest_eol_s, 0, F_status_terminated_not_nest_eol_s_length); - const f_string_static_t f_status_terminated_not_nest_eos_s = macro_f_string_static_t_initialize2(F_status_terminated_not_nest_eos_s, 0, F_status_terminated_not_nest_eos_s_length); - const f_string_static_t f_status_terminated_not_nest_stop_s = macro_f_string_static_t_initialize2(F_status_terminated_not_nest_stop_s, 0, F_status_terminated_not_nest_stop_s_length); + const f_string_static_t f_status_buffer_s = macro_f_string_static_t_initialize(F_status_buffer_s, 0, F_status_buffer_s_length); + const f_string_static_t f_status_buffer_not_s = macro_f_string_static_t_initialize(F_status_buffer_not_s, 0, F_status_buffer_not_s_length); + const f_string_static_t f_status_buffer_too_large_s = macro_f_string_static_t_initialize(F_status_buffer_too_large_s, 0, F_status_buffer_too_large_s_length); + const f_string_static_t f_status_buffer_too_small_s = macro_f_string_static_t_initialize(F_status_buffer_too_small_s, 0, F_status_buffer_too_small_s_length); + const f_string_static_t f_status_complete_not_utf_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_s, 0, F_status_complete_not_utf_s_length); + const f_string_static_t f_status_complete_not_utf_block_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_block_s, 0, F_status_complete_not_utf_block_s_length); + const f_string_static_t f_status_complete_not_utf_eoa_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_eoa_s, 0, F_status_complete_not_utf_eoa_s_length); + const f_string_static_t f_status_complete_not_utf_eof_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_eof_s, 0, F_status_complete_not_utf_eof_s_length); + const f_string_static_t f_status_complete_not_utf_eol_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_eol_s, 0, F_status_complete_not_utf_eol_s_length); + const f_string_static_t f_status_complete_not_utf_eos_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_eos_s, 0, F_status_complete_not_utf_eos_s_length); + const f_string_static_t f_status_complete_not_utf_stop_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_stop_s, 0, F_status_complete_not_utf_stop_s_length); + const f_string_static_t f_status_none_block_s = macro_f_string_static_t_initialize(F_status_none_block_s, 0, F_status_none_block_s_length); + const f_string_static_t f_status_none_eoa_s = macro_f_string_static_t_initialize(F_status_none_eoa_s, 0, F_status_none_eoa_s_length); + const f_string_static_t f_status_none_eof_s = macro_f_string_static_t_initialize(F_status_none_eof_s, 0, F_status_none_eof_s_length); + const f_string_static_t f_status_none_eol_s = macro_f_string_static_t_initialize(F_status_none_eol_s, 0, F_status_none_eol_s_length); + const f_string_static_t f_status_none_eos_s = macro_f_string_static_t_initialize(F_status_none_eos_s, 0, F_status_none_eos_s_length); + const f_string_static_t f_status_none_not_s = macro_f_string_static_t_initialize(F_status_none_not_s, 0, F_status_none_not_s_length); + const f_string_static_t f_status_none_stop_s = macro_f_string_static_t_initialize(F_status_none_stop_s, 0, F_status_none_stop_s_length); + const f_string_static_t f_status_data_s = macro_f_string_static_t_initialize(F_status_data_s, 0, F_status_data_s_length); + const f_string_static_t f_status_data_not_s = macro_f_string_static_t_initialize(F_status_data_not_s, 0, F_status_data_not_s_length); + const f_string_static_t f_status_data_not_block_s = macro_f_string_static_t_initialize(F_status_data_not_block_s, 0, F_status_data_not_block_s_length); + const f_string_static_t f_status_data_not_eoa_s = macro_f_string_static_t_initialize(F_status_data_not_eoa_s, 0, F_status_data_not_eoa_s_length); + const f_string_static_t f_status_data_not_eof_s = macro_f_string_static_t_initialize(F_status_data_not_eof_s, 0, F_status_data_not_eof_s_length); + const f_string_static_t f_status_data_not_eol_s = macro_f_string_static_t_initialize(F_status_data_not_eol_s, 0, F_status_data_not_eol_s_length); + const f_string_static_t f_status_data_not_eos_s = macro_f_string_static_t_initialize(F_status_data_not_eos_s, 0, F_status_data_not_eos_s_length); + const f_string_static_t f_status_data_not_stop_s = macro_f_string_static_t_initialize(F_status_data_not_stop_s, 0, F_status_data_not_stop_s_length); + const f_string_static_t f_status_terminated_s = macro_f_string_static_t_initialize(F_status_terminated_s, 0, F_status_terminated_s_length); + const f_string_static_t f_status_terminated_not_s = macro_f_string_static_t_initialize(F_status_terminated_not_s, 0, F_status_terminated_not_s_length); + const f_string_static_t f_status_terminated_not_block_s = macro_f_string_static_t_initialize(F_status_terminated_not_block_s, 0, F_status_terminated_not_block_s_length); + const f_string_static_t f_status_terminated_not_eoa_s = macro_f_string_static_t_initialize(F_status_terminated_not_eoa_s, 0, F_status_terminated_not_eoa_s_length); + const f_string_static_t f_status_terminated_not_eof_s = macro_f_string_static_t_initialize(F_status_terminated_not_eof_s, 0, F_status_terminated_not_eof_s_length); + const f_string_static_t f_status_terminated_not_eol_s = macro_f_string_static_t_initialize(F_status_terminated_not_eol_s, 0, F_status_terminated_not_eol_s_length); + const f_string_static_t f_status_terminated_not_eos_s = macro_f_string_static_t_initialize(F_status_terminated_not_eos_s, 0, F_status_terminated_not_eos_s_length); + const f_string_static_t f_status_terminated_not_stop_s = macro_f_string_static_t_initialize(F_status_terminated_not_stop_s, 0, F_status_terminated_not_stop_s_length); + const f_string_static_t f_status_terminated_not_group_s = macro_f_string_static_t_initialize(F_status_terminated_not_group_s, 0, F_status_terminated_not_group_s_length); + const f_string_static_t f_status_terminated_not_group_block_s = macro_f_string_static_t_initialize(F_status_terminated_not_group_block_s, 0, F_status_terminated_not_group_block_s_length); + const f_string_static_t f_status_terminated_not_group_eoa_s = macro_f_string_static_t_initialize(F_status_terminated_not_group_eoa_s, 0, F_status_terminated_not_group_eoa_s_length); + const f_string_static_t f_status_terminated_not_group_eof_s = macro_f_string_static_t_initialize(F_status_terminated_not_group_eof_s, 0, F_status_terminated_not_group_eof_s_length); + const f_string_static_t f_status_terminated_not_group_eol_s = macro_f_string_static_t_initialize(F_status_terminated_not_group_eol_s, 0, F_status_terminated_not_group_eol_s_length); + const f_string_static_t f_status_terminated_not_group_eos_s = macro_f_string_static_t_initialize(F_status_terminated_not_group_eos_s, 0, F_status_terminated_not_group_eos_s_length); + const f_string_static_t f_status_terminated_not_group_stop_s = macro_f_string_static_t_initialize(F_status_terminated_not_group_stop_s, 0, F_status_terminated_not_group_stop_s_length); + const f_string_static_t f_status_terminated_not_nest_s = macro_f_string_static_t_initialize(F_status_terminated_not_nest_s, 0, F_status_terminated_not_nest_s_length); + const f_string_static_t f_status_terminated_not_nest_block_s = macro_f_string_static_t_initialize(F_status_terminated_not_nest_block_s, 0, F_status_terminated_not_nest_block_s_length); + const f_string_static_t f_status_terminated_not_nest_eoa_s = macro_f_string_static_t_initialize(F_status_terminated_not_nest_eoa_s, 0, F_status_terminated_not_nest_eoa_s_length); + const f_string_static_t f_status_terminated_not_nest_eof_s = macro_f_string_static_t_initialize(F_status_terminated_not_nest_eof_s, 0, F_status_terminated_not_nest_eof_s_length); + const f_string_static_t f_status_terminated_not_nest_eol_s = macro_f_string_static_t_initialize(F_status_terminated_not_nest_eol_s, 0, F_status_terminated_not_nest_eol_s_length); + const f_string_static_t f_status_terminated_not_nest_eos_s = macro_f_string_static_t_initialize(F_status_terminated_not_nest_eos_s, 0, F_status_terminated_not_nest_eos_s_length); + const f_string_static_t f_status_terminated_not_nest_stop_s = macro_f_string_static_t_initialize(F_status_terminated_not_nest_stop_s, 0, F_status_terminated_not_nest_stop_s_length); #endif // _di_F_status_buffer_ #ifndef _di_F_status_process_ - const f_string_static_t f_status_process_s = macro_f_string_static_t_initialize2(F_status_process_s, 0, F_status_process_s_length); - const f_string_static_t f_status_process_not_s = macro_f_string_static_t_initialize2(F_status_process_not_s, 0, F_status_process_not_s_length); - const f_string_static_t f_status_process_too_many_s = macro_f_string_static_t_initialize2(F_status_process_too_many_s, 0, F_status_process_too_many_s_length); + const f_string_static_t f_status_process_s = macro_f_string_static_t_initialize(F_status_process_s, 0, F_status_process_s_length); + const f_string_static_t f_status_process_not_s = macro_f_string_static_t_initialize(F_status_process_not_s, 0, F_status_process_not_s_length); + const f_string_static_t f_status_process_too_many_s = macro_f_string_static_t_initialize(F_status_process_too_many_s, 0, F_status_process_too_many_s_length); #endif // _di_F_status_process_ #ifndef _di_F_status_file_ - const f_string_static_t f_status_file_s = macro_f_string_static_t_initialize2(F_status_file_s, 0, F_status_file_s_length); - const f_string_static_t f_status_file_close_s = macro_f_string_static_t_initialize2(F_status_file_close_s, 0, F_status_file_close_s_length); - const f_string_static_t f_status_file_closed_s = macro_f_string_static_t_initialize2(F_status_file_closed_s, 0, F_status_file_closed_s_length); - const f_string_static_t f_status_file_descriptor_s = macro_f_string_static_t_initialize2(F_status_file_descriptor_s, 0, F_status_file_descriptor_s_length); - const f_string_static_t f_status_file_descriptor_max_s = macro_f_string_static_t_initialize2(F_status_file_descriptor_max_s, 0, F_status_file_descriptor_max_s_length); - const f_string_static_t f_status_file_descriptor_not_s = macro_f_string_static_t_initialize2(F_status_file_descriptor_not_s, 0, F_status_file_descriptor_not_s_length); - const f_string_static_t f_status_file_empty_s = macro_f_string_static_t_initialize2(F_status_file_empty_s, 0, F_status_file_empty_s_length); - const f_string_static_t f_status_file_flush_s = macro_f_string_static_t_initialize2(F_status_file_flush_s, 0, F_status_file_flush_s_length); - const f_string_static_t f_status_file_found_s = macro_f_string_static_t_initialize2(F_status_file_found_s, 0, F_status_file_found_s_length); - const f_string_static_t f_status_file_found_not_s = macro_f_string_static_t_initialize2(F_status_file_found_not_s, 0, F_status_file_found_not_s_length); - const f_string_static_t f_status_file_not_s = macro_f_string_static_t_initialize2(F_status_file_not_s, 0, F_status_file_not_s_length); - const f_string_static_t f_status_file_open_s = macro_f_string_static_t_initialize2(F_status_file_open_s, 0, F_status_file_open_s_length); - const f_string_static_t f_status_file_open_max_s = macro_f_string_static_t_initialize2(F_status_file_open_max_s, 0, F_status_file_open_max_s_length); - const f_string_static_t f_status_file_opened_s = macro_f_string_static_t_initialize2(F_status_file_opened_s, 0, F_status_file_opened_s_length); - const f_string_static_t f_status_file_overflow_s = macro_f_string_static_t_initialize2(F_status_file_overflow_s, 0, F_status_file_overflow_s_length); - const f_string_static_t f_status_file_purge_s = macro_f_string_static_t_initialize2(F_status_file_purge_s, 0, F_status_file_purge_s_length); - const f_string_static_t f_status_file_read_s = macro_f_string_static_t_initialize2(F_status_file_read_s, 0, F_status_file_read_s_length); - const f_string_static_t f_status_file_reallocation_s = macro_f_string_static_t_initialize2(F_status_file_reallocation_s, 0, F_status_file_reallocation_s_length); - const f_string_static_t f_status_file_seek_s = macro_f_string_static_t_initialize2(F_status_file_seek_s, 0, F_status_file_seek_s_length); - const f_string_static_t f_status_file_stat_s = macro_f_string_static_t_initialize2(F_status_file_stat_s, 0, F_status_file_stat_s_length); - const f_string_static_t f_status_file_synchronize_s = macro_f_string_static_t_initialize2(F_status_file_synchronize_s, 0, F_status_file_synchronize_s_length); - const f_string_static_t f_status_file_type_block_s = macro_f_string_static_t_initialize2(F_status_file_type_block_s, 0, F_status_file_type_block_s_length); - const f_string_static_t f_status_file_type_character_s = macro_f_string_static_t_initialize2(F_status_file_type_character_s, 0, F_status_file_type_character_s_length); - const f_string_static_t f_status_file_type_directory_s = macro_f_string_static_t_initialize2(F_status_file_type_directory_s, 0, F_status_file_type_directory_s_length); - const f_string_static_t f_status_file_type_fifo_s = macro_f_string_static_t_initialize2(F_status_file_type_fifo_s, 0, F_status_file_type_fifo_s_length); - const f_string_static_t f_status_file_type_link_s = macro_f_string_static_t_initialize2(F_status_file_type_link_s, 0, F_status_file_type_link_s_length); - const f_string_static_t f_status_file_type_not_block_s = macro_f_string_static_t_initialize2(F_status_file_type_not_block_s, 0, F_status_file_type_not_block_s_length); - const f_string_static_t f_status_file_type_not_character_s = macro_f_string_static_t_initialize2(F_status_file_type_not_character_s, 0, F_status_file_type_not_character_s_length); - const f_string_static_t f_status_file_type_not_directory_s = macro_f_string_static_t_initialize2(F_status_file_type_not_directory_s, 0, F_status_file_type_not_directory_s_length); - const f_string_static_t f_status_file_type_not_fifo_s = macro_f_string_static_t_initialize2(F_status_file_type_not_fifo_s, 0, F_status_file_type_not_fifo_s_length); - const f_string_static_t f_status_file_type_not_link_s = macro_f_string_static_t_initialize2(F_status_file_type_not_link_s, 0, F_status_file_type_not_link_s_length); - const f_string_static_t f_status_file_type_not_pipe_s = macro_f_string_static_t_initialize2(F_status_file_type_not_pipe_s, 0, F_status_file_type_not_pipe_s_length); - const f_string_static_t f_status_file_type_not_regular_s = macro_f_string_static_t_initialize2(F_status_file_type_not_regular_s, 0, F_status_file_type_not_regular_s_length); - const f_string_static_t f_status_file_type_not_socket_s = macro_f_string_static_t_initialize2(F_status_file_type_not_socket_s, 0, F_status_file_type_not_socket_s_length); - const f_string_static_t f_status_file_type_not_unknown_s = macro_f_string_static_t_initialize2(F_status_file_type_not_unknown_s, 0, F_status_file_type_not_unknown_s_length); - const f_string_static_t f_status_file_type_pipe_s = macro_f_string_static_t_initialize2(F_status_file_type_pipe_s, 0, F_status_file_type_pipe_s_length); - const f_string_static_t f_status_file_type_regular_s = macro_f_string_static_t_initialize2(F_status_file_type_regular_s, 0, F_status_file_type_regular_s_length); - const f_string_static_t f_status_file_type_socket_s = macro_f_string_static_t_initialize2(F_status_file_type_socket_s, 0, F_status_file_type_socket_s_length); - const f_string_static_t f_status_file_type_unknown_s = macro_f_string_static_t_initialize2(F_status_file_type_unknown_s, 0, F_status_file_type_unknown_s_length); - const f_string_static_t f_status_file_underflow_s = macro_f_string_static_t_initialize2(F_status_file_underflow_s, 0, F_status_file_underflow_s_length); - const f_string_static_t f_status_file_utf_s = macro_f_string_static_t_initialize2(F_status_file_utf_s, 0, F_status_file_utf_s_length); - const f_string_static_t f_status_file_utf_not_s = macro_f_string_static_t_initialize2(F_status_file_utf_not_s, 0, F_status_file_utf_not_s_length); - const f_string_static_t f_status_file_write_s = macro_f_string_static_t_initialize2(F_status_file_write_s, 0, F_status_file_write_s_length); + const f_string_static_t f_status_file_s = macro_f_string_static_t_initialize(F_status_file_s, 0, F_status_file_s_length); + const f_string_static_t f_status_file_close_s = macro_f_string_static_t_initialize(F_status_file_close_s, 0, F_status_file_close_s_length); + const f_string_static_t f_status_file_closed_s = macro_f_string_static_t_initialize(F_status_file_closed_s, 0, F_status_file_closed_s_length); + const f_string_static_t f_status_file_descriptor_s = macro_f_string_static_t_initialize(F_status_file_descriptor_s, 0, F_status_file_descriptor_s_length); + const f_string_static_t f_status_file_descriptor_max_s = macro_f_string_static_t_initialize(F_status_file_descriptor_max_s, 0, F_status_file_descriptor_max_s_length); + const f_string_static_t f_status_file_descriptor_not_s = macro_f_string_static_t_initialize(F_status_file_descriptor_not_s, 0, F_status_file_descriptor_not_s_length); + const f_string_static_t f_status_file_empty_s = macro_f_string_static_t_initialize(F_status_file_empty_s, 0, F_status_file_empty_s_length); + const f_string_static_t f_status_file_flush_s = macro_f_string_static_t_initialize(F_status_file_flush_s, 0, F_status_file_flush_s_length); + const f_string_static_t f_status_file_found_s = macro_f_string_static_t_initialize(F_status_file_found_s, 0, F_status_file_found_s_length); + const f_string_static_t f_status_file_found_not_s = macro_f_string_static_t_initialize(F_status_file_found_not_s, 0, F_status_file_found_not_s_length); + const f_string_static_t f_status_file_not_s = macro_f_string_static_t_initialize(F_status_file_not_s, 0, F_status_file_not_s_length); + const f_string_static_t f_status_file_open_s = macro_f_string_static_t_initialize(F_status_file_open_s, 0, F_status_file_open_s_length); + const f_string_static_t f_status_file_open_max_s = macro_f_string_static_t_initialize(F_status_file_open_max_s, 0, F_status_file_open_max_s_length); + const f_string_static_t f_status_file_opened_s = macro_f_string_static_t_initialize(F_status_file_opened_s, 0, F_status_file_opened_s_length); + const f_string_static_t f_status_file_overflow_s = macro_f_string_static_t_initialize(F_status_file_overflow_s, 0, F_status_file_overflow_s_length); + const f_string_static_t f_status_file_purge_s = macro_f_string_static_t_initialize(F_status_file_purge_s, 0, F_status_file_purge_s_length); + const f_string_static_t f_status_file_read_s = macro_f_string_static_t_initialize(F_status_file_read_s, 0, F_status_file_read_s_length); + const f_string_static_t f_status_file_reallocation_s = macro_f_string_static_t_initialize(F_status_file_reallocation_s, 0, F_status_file_reallocation_s_length); + const f_string_static_t f_status_file_seek_s = macro_f_string_static_t_initialize(F_status_file_seek_s, 0, F_status_file_seek_s_length); + const f_string_static_t f_status_file_stat_s = macro_f_string_static_t_initialize(F_status_file_stat_s, 0, F_status_file_stat_s_length); + const f_string_static_t f_status_file_synchronize_s = macro_f_string_static_t_initialize(F_status_file_synchronize_s, 0, F_status_file_synchronize_s_length); + const f_string_static_t f_status_file_type_block_s = macro_f_string_static_t_initialize(F_status_file_type_block_s, 0, F_status_file_type_block_s_length); + const f_string_static_t f_status_file_type_character_s = macro_f_string_static_t_initialize(F_status_file_type_character_s, 0, F_status_file_type_character_s_length); + const f_string_static_t f_status_file_type_directory_s = macro_f_string_static_t_initialize(F_status_file_type_directory_s, 0, F_status_file_type_directory_s_length); + const f_string_static_t f_status_file_type_fifo_s = macro_f_string_static_t_initialize(F_status_file_type_fifo_s, 0, F_status_file_type_fifo_s_length); + const f_string_static_t f_status_file_type_link_s = macro_f_string_static_t_initialize(F_status_file_type_link_s, 0, F_status_file_type_link_s_length); + const f_string_static_t f_status_file_type_not_block_s = macro_f_string_static_t_initialize(F_status_file_type_not_block_s, 0, F_status_file_type_not_block_s_length); + const f_string_static_t f_status_file_type_not_character_s = macro_f_string_static_t_initialize(F_status_file_type_not_character_s, 0, F_status_file_type_not_character_s_length); + const f_string_static_t f_status_file_type_not_directory_s = macro_f_string_static_t_initialize(F_status_file_type_not_directory_s, 0, F_status_file_type_not_directory_s_length); + const f_string_static_t f_status_file_type_not_fifo_s = macro_f_string_static_t_initialize(F_status_file_type_not_fifo_s, 0, F_status_file_type_not_fifo_s_length); + const f_string_static_t f_status_file_type_not_link_s = macro_f_string_static_t_initialize(F_status_file_type_not_link_s, 0, F_status_file_type_not_link_s_length); + const f_string_static_t f_status_file_type_not_pipe_s = macro_f_string_static_t_initialize(F_status_file_type_not_pipe_s, 0, F_status_file_type_not_pipe_s_length); + const f_string_static_t f_status_file_type_not_regular_s = macro_f_string_static_t_initialize(F_status_file_type_not_regular_s, 0, F_status_file_type_not_regular_s_length); + const f_string_static_t f_status_file_type_not_socket_s = macro_f_string_static_t_initialize(F_status_file_type_not_socket_s, 0, F_status_file_type_not_socket_s_length); + const f_string_static_t f_status_file_type_not_unknown_s = macro_f_string_static_t_initialize(F_status_file_type_not_unknown_s, 0, F_status_file_type_not_unknown_s_length); + const f_string_static_t f_status_file_type_pipe_s = macro_f_string_static_t_initialize(F_status_file_type_pipe_s, 0, F_status_file_type_pipe_s_length); + const f_string_static_t f_status_file_type_regular_s = macro_f_string_static_t_initialize(F_status_file_type_regular_s, 0, F_status_file_type_regular_s_length); + const f_string_static_t f_status_file_type_socket_s = macro_f_string_static_t_initialize(F_status_file_type_socket_s, 0, F_status_file_type_socket_s_length); + const f_string_static_t f_status_file_type_unknown_s = macro_f_string_static_t_initialize(F_status_file_type_unknown_s, 0, F_status_file_type_unknown_s_length); + const f_string_static_t f_status_file_underflow_s = macro_f_string_static_t_initialize(F_status_file_underflow_s, 0, F_status_file_underflow_s_length); + const f_string_static_t f_status_file_utf_s = macro_f_string_static_t_initialize(F_status_file_utf_s, 0, F_status_file_utf_s_length); + const f_string_static_t f_status_file_utf_not_s = macro_f_string_static_t_initialize(F_status_file_utf_not_s, 0, F_status_file_utf_not_s_length); + const f_string_static_t f_status_file_write_s = macro_f_string_static_t_initialize(F_status_file_write_s, 0, F_status_file_write_s_length); #endif // _di_F_status_file_ #ifndef _di_F_status_filesystem_ - const f_string_static_t f_status_filesystem_s = macro_f_string_static_t_initialize2(F_status_filesystem_s, 0, F_status_filesystem_s_length); - const f_string_static_t f_status_filesystem_not_s = macro_f_string_static_t_initialize2(F_status_filesystem_not_s, 0, F_status_filesystem_not_s_length); - const f_string_static_t f_status_filesystem_quota_block_s = macro_f_string_static_t_initialize2(F_status_filesystem_quota_block_s, 0, F_status_filesystem_quota_block_s_length); - const f_string_static_t f_status_filesystem_quota_reached_s = macro_f_string_static_t_initialize2(F_status_filesystem_quota_reached_s, 0, F_status_filesystem_quota_reached_s_length); + const f_string_static_t f_status_filesystem_s = macro_f_string_static_t_initialize(F_status_filesystem_s, 0, F_status_filesystem_s_length); + const f_string_static_t f_status_filesystem_not_s = macro_f_string_static_t_initialize(F_status_filesystem_not_s, 0, F_status_filesystem_not_s_length); + const f_string_static_t f_status_filesystem_quota_block_s = macro_f_string_static_t_initialize(F_status_filesystem_quota_block_s, 0, F_status_filesystem_quota_block_s_length); + const f_string_static_t f_status_filesystem_quota_reached_s = macro_f_string_static_t_initialize(F_status_filesystem_quota_reached_s, 0, F_status_filesystem_quota_reached_s_length); #endif // _di_F_status_filesystem_ #ifndef _di_F_status_directory_ - const f_string_static_t f_status_directory_s = macro_f_string_static_t_initialize2(F_status_directory_s, 0, F_status_directory_s_length); - const f_string_static_t f_status_directory_close_s = macro_f_string_static_t_initialize2(F_status_directory_close_s, 0, F_status_directory_close_s_length); - const f_string_static_t f_status_directory_closed_s = macro_f_string_static_t_initialize2(F_status_directory_closed_s, 0, F_status_directory_closed_s_length); - const f_string_static_t f_status_directory_descriptor_s = macro_f_string_static_t_initialize2(F_status_directory_descriptor_s, 0, F_status_directory_descriptor_s_length); - const f_string_static_t f_status_directory_empty_s = macro_f_string_static_t_initialize2(F_status_directory_empty_s, 0, F_status_directory_empty_s_length); - const f_string_static_t f_status_directory_empty_not_s = macro_f_string_static_t_initialize2(F_status_directory_empty_not_s, 0, F_status_directory_empty_not_s_length); - const f_string_static_t f_status_directory_found_s = macro_f_string_static_t_initialize2(F_status_directory_found_s, 0, F_status_directory_found_s_length); - const f_string_static_t f_status_directory_found_not_s = macro_f_string_static_t_initialize2(F_status_directory_found_not_s, 0, F_status_directory_found_not_s_length); - const f_string_static_t f_status_directory_flush_s = macro_f_string_static_t_initialize2(F_status_directory_flush_s, 0, F_status_directory_flush_s_length); - const f_string_static_t f_status_directory_link_max_s = macro_f_string_static_t_initialize2(F_status_directory_link_max_s, 0, F_status_directory_link_max_s_length); - const f_string_static_t f_status_directory_not_s = macro_f_string_static_t_initialize2(F_status_directory_not_s, 0, F_status_directory_not_s_length); - const f_string_static_t f_status_directory_open_s = macro_f_string_static_t_initialize2(F_status_directory_open_s, 0, F_status_directory_open_s_length); - const f_string_static_t f_status_directory_purge_s = macro_f_string_static_t_initialize2(F_status_directory_purge_s, 0, F_status_directory_purge_s_length); - const f_string_static_t f_status_directory_read_s = macro_f_string_static_t_initialize2(F_status_directory_read_s, 0, F_status_directory_read_s_length); - const f_string_static_t f_status_directory_stream_s = macro_f_string_static_t_initialize2(F_status_directory_stream_s, 0, F_status_directory_stream_s_length); - const f_string_static_t f_status_directory_supported_not_s = macro_f_string_static_t_initialize2(F_status_directory_supported_not_s, 0, F_status_directory_supported_not_s_length); - const f_string_static_t f_status_directory_synchronize_s = macro_f_string_static_t_initialize2(F_status_directory_synchronize_s, 0, F_status_directory_synchronize_s_length); - const f_string_static_t f_status_directory_utf_s = macro_f_string_static_t_initialize2(F_status_directory_utf_s, 0, F_status_directory_utf_s_length); - const f_string_static_t f_status_directory_utf_not_s = macro_f_string_static_t_initialize2(F_status_directory_utf_not_s, 0, F_status_directory_utf_not_s_length); - const f_string_static_t f_status_directory_write_s = macro_f_string_static_t_initialize2(F_status_directory_write_s, 0, F_status_directory_write_s_length); + const f_string_static_t f_status_directory_s = macro_f_string_static_t_initialize(F_status_directory_s, 0, F_status_directory_s_length); + const f_string_static_t f_status_directory_close_s = macro_f_string_static_t_initialize(F_status_directory_close_s, 0, F_status_directory_close_s_length); + const f_string_static_t f_status_directory_closed_s = macro_f_string_static_t_initialize(F_status_directory_closed_s, 0, F_status_directory_closed_s_length); + const f_string_static_t f_status_directory_descriptor_s = macro_f_string_static_t_initialize(F_status_directory_descriptor_s, 0, F_status_directory_descriptor_s_length); + const f_string_static_t f_status_directory_empty_s = macro_f_string_static_t_initialize(F_status_directory_empty_s, 0, F_status_directory_empty_s_length); + const f_string_static_t f_status_directory_empty_not_s = macro_f_string_static_t_initialize(F_status_directory_empty_not_s, 0, F_status_directory_empty_not_s_length); + const f_string_static_t f_status_directory_found_s = macro_f_string_static_t_initialize(F_status_directory_found_s, 0, F_status_directory_found_s_length); + const f_string_static_t f_status_directory_found_not_s = macro_f_string_static_t_initialize(F_status_directory_found_not_s, 0, F_status_directory_found_not_s_length); + const f_string_static_t f_status_directory_flush_s = macro_f_string_static_t_initialize(F_status_directory_flush_s, 0, F_status_directory_flush_s_length); + const f_string_static_t f_status_directory_link_max_s = macro_f_string_static_t_initialize(F_status_directory_link_max_s, 0, F_status_directory_link_max_s_length); + const f_string_static_t f_status_directory_not_s = macro_f_string_static_t_initialize(F_status_directory_not_s, 0, F_status_directory_not_s_length); + const f_string_static_t f_status_directory_open_s = macro_f_string_static_t_initialize(F_status_directory_open_s, 0, F_status_directory_open_s_length); + const f_string_static_t f_status_directory_purge_s = macro_f_string_static_t_initialize(F_status_directory_purge_s, 0, F_status_directory_purge_s_length); + const f_string_static_t f_status_directory_read_s = macro_f_string_static_t_initialize(F_status_directory_read_s, 0, F_status_directory_read_s_length); + const f_string_static_t f_status_directory_stream_s = macro_f_string_static_t_initialize(F_status_directory_stream_s, 0, F_status_directory_stream_s_length); + const f_string_static_t f_status_directory_supported_not_s = macro_f_string_static_t_initialize(F_status_directory_supported_not_s, 0, F_status_directory_supported_not_s_length); + const f_string_static_t f_status_directory_synchronize_s = macro_f_string_static_t_initialize(F_status_directory_synchronize_s, 0, F_status_directory_synchronize_s_length); + const f_string_static_t f_status_directory_utf_s = macro_f_string_static_t_initialize(F_status_directory_utf_s, 0, F_status_directory_utf_s_length); + const f_string_static_t f_status_directory_utf_not_s = macro_f_string_static_t_initialize(F_status_directory_utf_not_s, 0, F_status_directory_utf_not_s_length); + const f_string_static_t f_status_directory_write_s = macro_f_string_static_t_initialize(F_status_directory_write_s, 0, F_status_directory_write_s_length); #endif // _di_F_status_directory_ #ifndef _di_F_status_socket_ - const f_string_static_t f_status_socket_s = macro_f_string_static_t_initialize2(F_status_socket_s, 0, F_status_socket_s_length); - const f_string_static_t f_status_socket_client_s = macro_f_string_static_t_initialize2(F_status_socket_client_s, 0, F_status_socket_client_s_length); - const f_string_static_t f_status_socket_not_s = macro_f_string_static_t_initialize2(F_status_socket_not_s, 0, F_status_socket_not_s_length); - const f_string_static_t f_status_socket_receive_s = macro_f_string_static_t_initialize2(F_status_socket_receive_s, 0, F_status_socket_receive_s_length); - const f_string_static_t f_status_socket_send_s = macro_f_string_static_t_initialize2(F_status_socket_send_s, 0, F_status_socket_send_s_length); - const f_string_static_t f_status_socket_target_s = macro_f_string_static_t_initialize2(F_status_socket_target_s, 0, F_status_socket_target_s_length); + const f_string_static_t f_status_socket_s = macro_f_string_static_t_initialize(F_status_socket_s, 0, F_status_socket_s_length); + const f_string_static_t f_status_socket_client_s = macro_f_string_static_t_initialize(F_status_socket_client_s, 0, F_status_socket_client_s_length); + const f_string_static_t f_status_socket_not_s = macro_f_string_static_t_initialize(F_status_socket_not_s, 0, F_status_socket_not_s_length); + const f_string_static_t f_status_socket_receive_s = macro_f_string_static_t_initialize(F_status_socket_receive_s, 0, F_status_socket_receive_s_length); + const f_string_static_t f_status_socket_send_s = macro_f_string_static_t_initialize(F_status_socket_send_s, 0, F_status_socket_send_s_length); + const f_string_static_t f_status_socket_target_s = macro_f_string_static_t_initialize(F_status_socket_target_s, 0, F_status_socket_target_s_length); #endif // _di_F_status_socket_ #ifndef _di_F_status_compare_ - const f_string_static_t f_status_equal_to_s = macro_f_string_static_t_initialize2(F_status_equal_to_s, 0, F_status_equal_to_s_length); - const f_string_static_t f_status_equal_to_not_s = macro_f_string_static_t_initialize2(F_status_equal_to_not_s, 0, F_status_equal_to_not_s_length); - const f_string_static_t f_status_than_greater_s = macro_f_string_static_t_initialize2(F_status_than_greater_s, 0, F_status_than_greater_s_length); - const f_string_static_t f_status_than_less_s = macro_f_string_static_t_initialize2(F_status_than_less_s, 0, F_status_than_less_s_length); + const f_string_static_t f_status_equal_to_s = macro_f_string_static_t_initialize(F_status_equal_to_s, 0, F_status_equal_to_s_length); + const f_string_static_t f_status_equal_to_not_s = macro_f_string_static_t_initialize(F_status_equal_to_not_s, 0, F_status_equal_to_not_s_length); + const f_string_static_t f_status_than_greater_s = macro_f_string_static_t_initialize(F_status_than_greater_s, 0, F_status_than_greater_s_length); + const f_string_static_t f_status_than_less_s = macro_f_string_static_t_initialize(F_status_than_less_s, 0, F_status_than_less_s_length); #endif // _di_F_status_compare_ #ifndef _di_F_status_access_ - const f_string_static_t f_status_access_s = macro_f_string_static_t_initialize2(F_status_access_s, 0, F_status_access_s_length); - const f_string_static_t f_status_access_denied_s = macro_f_string_static_t_initialize2(F_status_access_denied_s, 0, F_status_access_denied_s_length); - const f_string_static_t f_status_access_denied_user_s = macro_f_string_static_t_initialize2(F_status_access_denied_user_s, 0, F_status_access_denied_user_s_length); - const f_string_static_t f_status_access_denied_group_s = macro_f_string_static_t_initialize2(F_status_access_denied_group_s, 0, F_status_access_denied_group_s_length); - const f_string_static_t f_status_access_denied_world_s = macro_f_string_static_t_initialize2(F_status_access_denied_world_s, 0, F_status_access_denied_world_s_length); - const f_string_static_t f_status_access_denied_read_s = macro_f_string_static_t_initialize2(F_status_access_denied_read_s, 0, F_status_access_denied_read_s_length); - const f_string_static_t f_status_access_denied_write_s = macro_f_string_static_t_initialize2(F_status_access_denied_write_s, 0, F_status_access_denied_write_s_length); - const f_string_static_t f_status_access_denied_execute_s = macro_f_string_static_t_initialize2(F_status_access_denied_execute_s, 0, F_status_access_denied_execute_s_length); - const f_string_static_t f_status_access_denied_super_s = macro_f_string_static_t_initialize2(F_status_access_denied_super_s, 0, F_status_access_denied_super_s_length); - const f_string_static_t f_status_access_granted_s = macro_f_string_static_t_initialize2(F_status_access_granted_s, 0, F_status_access_granted_s_length); - const f_string_static_t f_status_access_granted_user_s = macro_f_string_static_t_initialize2(F_status_access_granted_user_s, 0, F_status_access_granted_user_s_length); - const f_string_static_t f_status_access_granted_group_s = macro_f_string_static_t_initialize2(F_status_access_granted_group_s, 0, F_status_access_granted_group_s_length); - const f_string_static_t f_status_access_granted_world_s = macro_f_string_static_t_initialize2(F_status_access_granted_world_s, 0, F_status_access_granted_world_s_length); - const f_string_static_t f_status_access_granted_read_s = macro_f_string_static_t_initialize2(F_status_access_granted_read_s, 0, F_status_access_granted_read_s_length); - const f_string_static_t f_status_access_granted_write_s = macro_f_string_static_t_initialize2(F_status_access_granted_write_s, 0, F_status_access_granted_write_s_length); - const f_string_static_t f_status_access_granted_execute_s = macro_f_string_static_t_initialize2(F_status_access_granted_execute_s, 0, F_status_access_granted_execute_s_length); - const f_string_static_t f_status_access_granted_super_s = macro_f_string_static_t_initialize2(F_status_access_granted_super_s, 0, F_status_access_granted_super_s_length); - const f_string_static_t f_status_access_group_s = macro_f_string_static_t_initialize2(F_status_access_group_s, 0, F_status_access_group_s_length); - const f_string_static_t f_status_access_mode_s = macro_f_string_static_t_initialize2(F_status_access_mode_s, 0, F_status_access_mode_s_length); - const f_string_static_t f_status_access_not_s = macro_f_string_static_t_initialize2(F_status_access_not_s, 0, F_status_access_not_s_length); - const f_string_static_t f_status_access_owner_s = macro_f_string_static_t_initialize2(F_status_access_owner_s, 0, F_status_access_owner_s_length); + const f_string_static_t f_status_access_s = macro_f_string_static_t_initialize(F_status_access_s, 0, F_status_access_s_length); + const f_string_static_t f_status_access_denied_s = macro_f_string_static_t_initialize(F_status_access_denied_s, 0, F_status_access_denied_s_length); + const f_string_static_t f_status_access_denied_user_s = macro_f_string_static_t_initialize(F_status_access_denied_user_s, 0, F_status_access_denied_user_s_length); + const f_string_static_t f_status_access_denied_group_s = macro_f_string_static_t_initialize(F_status_access_denied_group_s, 0, F_status_access_denied_group_s_length); + const f_string_static_t f_status_access_denied_world_s = macro_f_string_static_t_initialize(F_status_access_denied_world_s, 0, F_status_access_denied_world_s_length); + const f_string_static_t f_status_access_denied_read_s = macro_f_string_static_t_initialize(F_status_access_denied_read_s, 0, F_status_access_denied_read_s_length); + const f_string_static_t f_status_access_denied_write_s = macro_f_string_static_t_initialize(F_status_access_denied_write_s, 0, F_status_access_denied_write_s_length); + const f_string_static_t f_status_access_denied_execute_s = macro_f_string_static_t_initialize(F_status_access_denied_execute_s, 0, F_status_access_denied_execute_s_length); + const f_string_static_t f_status_access_denied_super_s = macro_f_string_static_t_initialize(F_status_access_denied_super_s, 0, F_status_access_denied_super_s_length); + const f_string_static_t f_status_access_granted_s = macro_f_string_static_t_initialize(F_status_access_granted_s, 0, F_status_access_granted_s_length); + const f_string_static_t f_status_access_granted_user_s = macro_f_string_static_t_initialize(F_status_access_granted_user_s, 0, F_status_access_granted_user_s_length); + const f_string_static_t f_status_access_granted_group_s = macro_f_string_static_t_initialize(F_status_access_granted_group_s, 0, F_status_access_granted_group_s_length); + const f_string_static_t f_status_access_granted_world_s = macro_f_string_static_t_initialize(F_status_access_granted_world_s, 0, F_status_access_granted_world_s_length); + const f_string_static_t f_status_access_granted_read_s = macro_f_string_static_t_initialize(F_status_access_granted_read_s, 0, F_status_access_granted_read_s_length); + const f_string_static_t f_status_access_granted_write_s = macro_f_string_static_t_initialize(F_status_access_granted_write_s, 0, F_status_access_granted_write_s_length); + const f_string_static_t f_status_access_granted_execute_s = macro_f_string_static_t_initialize(F_status_access_granted_execute_s, 0, F_status_access_granted_execute_s_length); + const f_string_static_t f_status_access_granted_super_s = macro_f_string_static_t_initialize(F_status_access_granted_super_s, 0, F_status_access_granted_super_s_length); + const f_string_static_t f_status_access_group_s = macro_f_string_static_t_initialize(F_status_access_group_s, 0, F_status_access_group_s_length); + const f_string_static_t f_status_access_mode_s = macro_f_string_static_t_initialize(F_status_access_mode_s, 0, F_status_access_mode_s_length); + const f_string_static_t f_status_access_not_s = macro_f_string_static_t_initialize(F_status_access_not_s, 0, F_status_access_not_s_length); + const f_string_static_t f_status_access_owner_s = macro_f_string_static_t_initialize(F_status_access_owner_s, 0, F_status_access_owner_s_length); #endif // _di_F_status_access_ #ifndef _di_F_status_terminal_ - const f_string_static_t f_status_terminal_s = macro_f_string_static_t_initialize2(F_status_terminal_s, 0, F_status_terminal_s_length); - const f_string_static_t f_status_terminal_access_s = macro_f_string_static_t_initialize2(F_status_terminal_access_s, 0, F_status_terminal_access_s_length); - const f_string_static_t f_status_terminal_known_s = macro_f_string_static_t_initialize2(F_status_terminal_known_s, 0, F_status_terminal_known_s_length); - const f_string_static_t f_status_terminal_known_not_s = macro_f_string_static_t_initialize2(F_status_terminal_known_not_s, 0, F_status_terminal_known_not_s_length); - const f_string_static_t f_status_terminal_not_s = macro_f_string_static_t_initialize2(F_status_terminal_not_s, 0, F_status_terminal_not_s_length); - const f_string_static_t f_status_terminal_prohibited_s = macro_f_string_static_t_initialize2(F_status_terminal_prohibited_s, 0, F_status_terminal_prohibited_s_length); - const f_string_static_t f_status_terminal_read_s = macro_f_string_static_t_initialize2(F_status_terminal_read_s, 0, F_status_terminal_read_s_length); - const f_string_static_t f_status_terminal_valid_s = macro_f_string_static_t_initialize2(F_status_terminal_valid_s, 0, F_status_terminal_valid_s_length); - const f_string_static_t f_status_terminal_valid_not_s = macro_f_string_static_t_initialize2(F_status_terminal_valid_not_s, 0, F_status_terminal_valid_not_s_length); - const f_string_static_t f_status_terminal_write_s = macro_f_string_static_t_initialize2(F_status_terminal_write_s, 0, F_status_terminal_write_s_length); + const f_string_static_t f_status_terminal_s = macro_f_string_static_t_initialize(F_status_terminal_s, 0, F_status_terminal_s_length); + const f_string_static_t f_status_terminal_access_s = macro_f_string_static_t_initialize(F_status_terminal_access_s, 0, F_status_terminal_access_s_length); + const f_string_static_t f_status_terminal_known_s = macro_f_string_static_t_initialize(F_status_terminal_known_s, 0, F_status_terminal_known_s_length); + const f_string_static_t f_status_terminal_known_not_s = macro_f_string_static_t_initialize(F_status_terminal_known_not_s, 0, F_status_terminal_known_not_s_length); + const f_string_static_t f_status_terminal_not_s = macro_f_string_static_t_initialize(F_status_terminal_not_s, 0, F_status_terminal_not_s_length); + const f_string_static_t f_status_terminal_prohibited_s = macro_f_string_static_t_initialize(F_status_terminal_prohibited_s, 0, F_status_terminal_prohibited_s_length); + const f_string_static_t f_status_terminal_read_s = macro_f_string_static_t_initialize(F_status_terminal_read_s, 0, F_status_terminal_read_s_length); + const f_string_static_t f_status_terminal_valid_s = macro_f_string_static_t_initialize(F_status_terminal_valid_s, 0, F_status_terminal_valid_s_length); + const f_string_static_t f_status_terminal_valid_not_s = macro_f_string_static_t_initialize(F_status_terminal_valid_not_s, 0, F_status_terminal_valid_not_s_length); + const f_string_static_t f_status_terminal_write_s = macro_f_string_static_t_initialize(F_status_terminal_write_s, 0, F_status_terminal_write_s_length); #endif // _di_F_status_terminal_ - const f_string_static_t f_status_status_code_last_s = macro_f_string_static_t_initialize2(F_status_status_code_last_s, 0, F_status_status_code_last_s_length); + const f_string_static_t f_status_status_code_last_s = macro_f_string_static_t_initialize(F_status_status_code_last_s, 0, F_status_status_code_last_s_length); #endif // _di_F_status_string_ #ifndef _di_f_status_string_to_ diff --git a/level_0/f_string/c/string_dynamic.c b/level_0/f_string/c/string_dynamic.c index 73f9193..ee6af60 100644 --- a/level_0/f_string/c/string_dynamic.c +++ b/level_0/f_string/c/string_dynamic.c @@ -6,145 +6,145 @@ extern "C" { #endif #ifndef _di_f_string_empty_s_ - const f_string_static_t f_string_empty_s = macro_f_string_static_t_initialize2(F_string_empty_s, 0, F_string_empty_s_length); + const f_string_static_t f_string_empty_s = macro_f_string_static_t_initialize(F_string_empty_s, 0, F_string_empty_s_length); #endif // _di_f_string_empty_s_ #ifndef _di_f_string_null_s_ - const f_string_static_t f_string_null_s = macro_f_string_static_t_initialize2(F_string_null_s, 0, F_string_null_s_length); + const f_string_static_t f_string_null_s = macro_f_string_static_t_initialize(F_string_null_s, 0, F_string_null_s_length); #endif // _di_f_string_null_s_ #ifndef _di_string_ascii_s_ - const f_string_static_t f_string_ascii_0_s = macro_f_string_static_t_initialize2(F_string_ascii_0_s, 0, F_string_ascii_0_s_length); - const f_string_static_t f_string_ascii_1_s = macro_f_string_static_t_initialize2(F_string_ascii_1_s, 0, F_string_ascii_1_s_length); - const f_string_static_t f_string_ascii_2_s = macro_f_string_static_t_initialize2(F_string_ascii_2_s, 0, F_string_ascii_2_s_length); - const f_string_static_t f_string_ascii_3_s = macro_f_string_static_t_initialize2(F_string_ascii_3_s, 0, F_string_ascii_3_s_length); - const f_string_static_t f_string_ascii_4_s = macro_f_string_static_t_initialize2(F_string_ascii_4_s, 0, F_string_ascii_4_s_length); - const f_string_static_t f_string_ascii_5_s = macro_f_string_static_t_initialize2(F_string_ascii_5_s, 0, F_string_ascii_5_s_length); - const f_string_static_t f_string_ascii_6_s = macro_f_string_static_t_initialize2(F_string_ascii_6_s, 0, F_string_ascii_6_s_length); - const f_string_static_t f_string_ascii_7_s = macro_f_string_static_t_initialize2(F_string_ascii_7_s, 0, F_string_ascii_7_s_length); - const f_string_static_t f_string_ascii_8_s = macro_f_string_static_t_initialize2(F_string_ascii_8_s, 0, F_string_ascii_8_s_length); - const f_string_static_t f_string_ascii_9_s = macro_f_string_static_t_initialize2(F_string_ascii_9_s, 0, F_string_ascii_9_s_length); - - const f_string_static_t f_string_ascii_a_s = macro_f_string_static_t_initialize2(F_string_ascii_a_s, 0, F_string_ascii_a_s_length); - const f_string_static_t f_string_ascii_b_s = macro_f_string_static_t_initialize2(F_string_ascii_b_s, 0, F_string_ascii_b_s_length); - const f_string_static_t f_string_ascii_c_s = macro_f_string_static_t_initialize2(F_string_ascii_c_s, 0, F_string_ascii_c_s_length); - const f_string_static_t f_string_ascii_d_s = macro_f_string_static_t_initialize2(F_string_ascii_d_s, 0, F_string_ascii_d_s_length); - const f_string_static_t f_string_ascii_e_s = macro_f_string_static_t_initialize2(F_string_ascii_e_s, 0, F_string_ascii_e_s_length); - const f_string_static_t f_string_ascii_f_s = macro_f_string_static_t_initialize2(F_string_ascii_f_s, 0, F_string_ascii_f_s_length); - const f_string_static_t f_string_ascii_g_s = macro_f_string_static_t_initialize2(F_string_ascii_g_s, 0, F_string_ascii_g_s_length); - const f_string_static_t f_string_ascii_h_s = macro_f_string_static_t_initialize2(F_string_ascii_h_s, 0, F_string_ascii_h_s_length); - const f_string_static_t f_string_ascii_i_s = macro_f_string_static_t_initialize2(F_string_ascii_i_s, 0, F_string_ascii_i_s_length); - const f_string_static_t f_string_ascii_j_s = macro_f_string_static_t_initialize2(F_string_ascii_j_s, 0, F_string_ascii_j_s_length); - const f_string_static_t f_string_ascii_k_s = macro_f_string_static_t_initialize2(F_string_ascii_k_s, 0, F_string_ascii_k_s_length); - const f_string_static_t f_string_ascii_l_s = macro_f_string_static_t_initialize2(F_string_ascii_l_s, 0, F_string_ascii_l_s_length); - const f_string_static_t f_string_ascii_m_s = macro_f_string_static_t_initialize2(F_string_ascii_m_s, 0, F_string_ascii_m_s_length); - const f_string_static_t f_string_ascii_n_s = macro_f_string_static_t_initialize2(F_string_ascii_n_s, 0, F_string_ascii_n_s_length); - const f_string_static_t f_string_ascii_o_s = macro_f_string_static_t_initialize2(F_string_ascii_o_s, 0, F_string_ascii_o_s_length); - const f_string_static_t f_string_ascii_p_s = macro_f_string_static_t_initialize2(F_string_ascii_p_s, 0, F_string_ascii_p_s_length); - const f_string_static_t f_string_ascii_q_s = macro_f_string_static_t_initialize2(F_string_ascii_q_s, 0, F_string_ascii_q_s_length); - const f_string_static_t f_string_ascii_r_s = macro_f_string_static_t_initialize2(F_string_ascii_r_s, 0, F_string_ascii_r_s_length); - const f_string_static_t f_string_ascii_s_s = macro_f_string_static_t_initialize2(F_string_ascii_s_s, 0, F_string_ascii_s_s_length); - const f_string_static_t f_string_ascii_t_s = macro_f_string_static_t_initialize2(F_string_ascii_t_s, 0, F_string_ascii_t_s_length); - const f_string_static_t f_string_ascii_u_s = macro_f_string_static_t_initialize2(F_string_ascii_u_s, 0, F_string_ascii_u_s_length); - const f_string_static_t f_string_ascii_v_s = macro_f_string_static_t_initialize2(F_string_ascii_v_s, 0, F_string_ascii_v_s_length); - const f_string_static_t f_string_ascii_w_s = macro_f_string_static_t_initialize2(F_string_ascii_w_s, 0, F_string_ascii_w_s_length); - const f_string_static_t f_string_ascii_x_s = macro_f_string_static_t_initialize2(F_string_ascii_x_s, 0, F_string_ascii_x_s_length); - const f_string_static_t f_string_ascii_y_s = macro_f_string_static_t_initialize2(F_string_ascii_y_s, 0, F_string_ascii_y_s_length); - const f_string_static_t f_string_ascii_z_s = macro_f_string_static_t_initialize2(F_string_ascii_z_s, 0, F_string_ascii_z_s_length); - - const f_string_static_t f_string_ascii_A_s = macro_f_string_static_t_initialize2(F_string_ascii_A_s, 0, F_string_ascii_A_s_length); - const f_string_static_t f_string_ascii_B_s = macro_f_string_static_t_initialize2(F_string_ascii_B_s, 0, F_string_ascii_B_s_length); - const f_string_static_t f_string_ascii_C_s = macro_f_string_static_t_initialize2(F_string_ascii_C_s, 0, F_string_ascii_C_s_length); - const f_string_static_t f_string_ascii_D_s = macro_f_string_static_t_initialize2(F_string_ascii_D_s, 0, F_string_ascii_D_s_length); - const f_string_static_t f_string_ascii_E_s = macro_f_string_static_t_initialize2(F_string_ascii_E_s, 0, F_string_ascii_E_s_length); - const f_string_static_t f_string_ascii_F_s = macro_f_string_static_t_initialize2(F_string_ascii_F_s, 0, F_string_ascii_F_s_length); - const f_string_static_t f_string_ascii_G_s = macro_f_string_static_t_initialize2(F_string_ascii_G_s, 0, F_string_ascii_G_s_length); - const f_string_static_t f_string_ascii_H_s = macro_f_string_static_t_initialize2(F_string_ascii_H_s, 0, F_string_ascii_H_s_length); - const f_string_static_t f_string_ascii_I_s = macro_f_string_static_t_initialize2(F_string_ascii_I_s, 0, F_string_ascii_I_s_length); - const f_string_static_t f_string_ascii_J_s = macro_f_string_static_t_initialize2(F_string_ascii_J_s, 0, F_string_ascii_J_s_length); - const f_string_static_t f_string_ascii_K_s = macro_f_string_static_t_initialize2(F_string_ascii_K_s, 0, F_string_ascii_K_s_length); - const f_string_static_t f_string_ascii_L_s = macro_f_string_static_t_initialize2(F_string_ascii_L_s, 0, F_string_ascii_L_s_length); - const f_string_static_t f_string_ascii_M_s = macro_f_string_static_t_initialize2(F_string_ascii_M_s, 0, F_string_ascii_M_s_length); - const f_string_static_t f_string_ascii_N_s = macro_f_string_static_t_initialize2(F_string_ascii_N_s, 0, F_string_ascii_N_s_length); - const f_string_static_t f_string_ascii_O_s = macro_f_string_static_t_initialize2(F_string_ascii_O_s, 0, F_string_ascii_O_s_length); - const f_string_static_t f_string_ascii_P_s = macro_f_string_static_t_initialize2(F_string_ascii_P_s, 0, F_string_ascii_P_s_length); - const f_string_static_t f_string_ascii_Q_s = macro_f_string_static_t_initialize2(F_string_ascii_Q_s, 0, F_string_ascii_Q_s_length); - const f_string_static_t f_string_ascii_R_s = macro_f_string_static_t_initialize2(F_string_ascii_R_s, 0, F_string_ascii_R_s_length); - const f_string_static_t f_string_ascii_S_s = macro_f_string_static_t_initialize2(F_string_ascii_S_s, 0, F_string_ascii_S_s_length); - const f_string_static_t f_string_ascii_T_s = macro_f_string_static_t_initialize2(F_string_ascii_T_s, 0, F_string_ascii_T_s_length); - const f_string_static_t f_string_ascii_U_s = macro_f_string_static_t_initialize2(F_string_ascii_U_s, 0, F_string_ascii_U_s_length); - const f_string_static_t f_string_ascii_V_s = macro_f_string_static_t_initialize2(F_string_ascii_V_s, 0, F_string_ascii_V_s_length); - const f_string_static_t f_string_ascii_W_s = macro_f_string_static_t_initialize2(F_string_ascii_W_s, 0, F_string_ascii_W_s_length); - const f_string_static_t f_string_ascii_X_s = macro_f_string_static_t_initialize2(F_string_ascii_X_s, 0, F_string_ascii_X_s_length); - const f_string_static_t f_string_ascii_Y_s = macro_f_string_static_t_initialize2(F_string_ascii_Y_s, 0, F_string_ascii_Y_s_length); - const f_string_static_t f_string_ascii_Z_s = macro_f_string_static_t_initialize2(F_string_ascii_Z_s, 0, F_string_ascii_Z_s_length); - - const f_string_static_t f_string_ascii_ampersand_s = macro_f_string_static_t_initialize2(F_string_ascii_ampersand_s, 0, F_string_ascii_ampersand_s_length); - const f_string_static_t f_string_ascii_asterisk_s = macro_f_string_static_t_initialize2(F_string_ascii_asterisk_s, 0, F_string_ascii_asterisk_s_length); - const f_string_static_t f_string_ascii_brace_close_s = macro_f_string_static_t_initialize2(F_string_ascii_brace_close_s, 0, F_string_ascii_brace_close_s_length); - const f_string_static_t f_string_ascii_brace_open_s = macro_f_string_static_t_initialize2(F_string_ascii_brace_open_s, 0, F_string_ascii_brace_open_s_length); - const f_string_static_t f_string_ascii_bracket_close_s = macro_f_string_static_t_initialize2(F_string_ascii_bracket_close_s, 0, F_string_ascii_bracket_close_s_length); - const f_string_static_t f_string_ascii_bracket_open_s = macro_f_string_static_t_initialize2(F_string_ascii_bracket_open_s, 0, F_string_ascii_bracket_open_s_length); - const f_string_static_t f_string_ascii_caret_s = macro_f_string_static_t_initialize2(F_string_ascii_caret_s, 0, F_string_ascii_caret_s_length); - const f_string_static_t f_string_ascii_comma_s = macro_f_string_static_t_initialize2(F_string_ascii_comma_s, 0, F_string_ascii_comma_s_length); - const f_string_static_t f_string_ascii_colon_s = macro_f_string_static_t_initialize2(F_string_ascii_colon_s, 0, F_string_ascii_colon_s_length); - const f_string_static_t f_string_ascii_colon_semi_s = macro_f_string_static_t_initialize2(F_string_ascii_colon_semi_s, 0, F_string_ascii_colon_semi_s_length); - const f_string_static_t f_string_ascii_dollar_s = macro_f_string_static_t_initialize2(F_string_ascii_dollar_s, 0, F_string_ascii_dollar_s_length); - const f_string_static_t f_string_ascii_equal_s = macro_f_string_static_t_initialize2(F_string_ascii_equal_s, 0, F_string_ascii_equal_s_length); - const f_string_static_t f_string_ascii_exclamation_s = macro_f_string_static_t_initialize2(F_string_ascii_exclamation_s, 0, F_string_ascii_exclamation_s_length); - const f_string_static_t f_string_ascii_grave_s = macro_f_string_static_t_initialize2(F_string_ascii_grave_s, 0, F_string_ascii_grave_s_length); - const f_string_static_t f_string_ascii_mark_question_s = macro_f_string_static_t_initialize2(F_string_ascii_mark_question_s, 0, F_string_ascii_mark_question_s_length); - const f_string_static_t f_string_ascii_minus_s = macro_f_string_static_t_initialize2(F_string_ascii_minus_s, 0, F_string_ascii_minus_s_length); - const f_string_static_t f_string_ascii_parenthesis_open_s = macro_f_string_static_t_initialize2(F_string_ascii_parenthesis_open_s, 0, F_string_ascii_parenthesis_open_s_length); - const f_string_static_t f_string_ascii_parenthesis_close_s = macro_f_string_static_t_initialize2(F_string_ascii_parenthesis_close_s, 0, F_string_ascii_parenthesis_close_s_length); - const f_string_static_t f_string_ascii_percent_s = macro_f_string_static_t_initialize2(F_string_ascii_percent_s, 0, F_string_ascii_percent_s_length); - const f_string_static_t f_string_ascii_period_s = macro_f_string_static_t_initialize2(F_string_ascii_period_s, 0, F_string_ascii_period_s_length); - const f_string_static_t f_string_ascii_pipe_s = macro_f_string_static_t_initialize2(F_string_ascii_pipe_s, 0, F_string_ascii_pipe_s_length); - const f_string_static_t f_string_ascii_plus_s = macro_f_string_static_t_initialize2(F_string_ascii_plus_s, 0, F_string_ascii_plus_s_length); - const f_string_static_t f_string_ascii_pound_s = macro_f_string_static_t_initialize2(F_string_ascii_pound_s, 0, F_string_ascii_pound_s_length); - const f_string_static_t f_string_ascii_quote_double_s = macro_f_string_static_t_initialize2(F_string_ascii_quote_double_s, 0, F_string_ascii_quote_double_s_length); - const f_string_static_t f_string_ascii_quote_single_s = macro_f_string_static_t_initialize2(F_string_ascii_quote_single_s, 0, F_string_ascii_quote_single_s_length); - const f_string_static_t f_string_ascii_sign_at_s = macro_f_string_static_t_initialize2(F_string_ascii_sign_at_s, 0, F_string_ascii_sign_at_s_length); - const f_string_static_t f_string_ascii_sign_greater_than_s = macro_f_string_static_t_initialize2(F_string_ascii_sign_greater_than_s, 0, F_string_ascii_sign_greater_than_s_length); - const f_string_static_t f_string_ascii_sign_less_than_s = macro_f_string_static_t_initialize2(F_string_ascii_sign_less_than_s, 0, F_string_ascii_sign_less_than_s_length); - const f_string_static_t f_string_ascii_slash_forward_s = macro_f_string_static_t_initialize2(F_string_ascii_slash_forward_s, 0, F_string_ascii_slash_forward_s_length); - const f_string_static_t f_string_ascii_slash_backward_s = macro_f_string_static_t_initialize2(F_string_ascii_slash_backward_s, 0, F_string_ascii_slash_backward_s_length); - const f_string_static_t f_string_ascii_tilde_s = macro_f_string_static_t_initialize2(F_string_ascii_tilde_s, 0, F_string_ascii_tilde_s_length); - const f_string_static_t f_string_ascii_underscore_s = macro_f_string_static_t_initialize2(F_string_ascii_underscore_s, 0, F_string_ascii_underscore_s_length); - - const f_string_static_t f_string_ascii_acknowledge_s = macro_f_string_static_t_initialize2(F_string_ascii_acknowledge_s, 0, F_string_ascii_acknowledge_s_length); - const f_string_static_t f_string_ascii_acknowledge_negative_s = macro_f_string_static_t_initialize2(F_string_ascii_acknowledge_negative_s, 0, F_string_ascii_acknowledge_negative_s_length); - const f_string_static_t f_string_ascii_bell_s = macro_f_string_static_t_initialize2(F_string_ascii_bell_s, 0, F_string_ascii_bell_s_length); - const f_string_static_t f_string_ascii_cancel_s = macro_f_string_static_t_initialize2(F_string_ascii_cancel_s, 0, F_string_ascii_cancel_s_length); - const f_string_static_t f_string_ascii_data_link_escape_s = macro_f_string_static_t_initialize2(F_string_ascii_data_link_escape_s, 0, F_string_ascii_data_link_escape_s_length); - const f_string_static_t f_string_ascii_device_control_one_s = macro_f_string_static_t_initialize2(F_string_ascii_device_control_one_s, 0, F_string_ascii_device_control_one_s_length); - const f_string_static_t f_string_ascii_device_control_two_s = macro_f_string_static_t_initialize2(F_string_ascii_device_control_two_s, 0, F_string_ascii_device_control_two_s_length); - const f_string_static_t f_string_ascii_device_control_three_s = macro_f_string_static_t_initialize2(F_string_ascii_device_control_three_s, 0, F_string_ascii_device_control_three_s_length); - const f_string_static_t f_string_ascii_device_control_four_s = macro_f_string_static_t_initialize2(F_string_ascii_device_control_four_s, 0, F_string_ascii_device_control_four_s_length); - const f_string_static_t f_string_ascii_enquiry_s = macro_f_string_static_t_initialize2(F_string_ascii_enquiry_s, 0, F_string_ascii_enquiry_s_length); - const f_string_static_t f_string_ascii_escape_s = macro_f_string_static_t_initialize2(F_string_ascii_escape_s, 0, F_string_ascii_escape_s_length); - const f_string_static_t f_string_ascii_feed_form_s = macro_f_string_static_t_initialize2(F_string_ascii_feed_form_s, 0, F_string_ascii_feed_form_s_length); - const f_string_static_t f_string_ascii_feed_line_s = macro_f_string_static_t_initialize2(F_string_ascii_feed_line_s, 0, F_string_ascii_feed_line_s_length); - const f_string_static_t f_string_ascii_header_start_s = macro_f_string_static_t_initialize2(F_string_ascii_header_start_s, 0, F_string_ascii_header_start_s_length); - const f_string_static_t f_string_ascii_medium_stop_s = macro_f_string_static_t_initialize2(F_string_ascii_medium_stop_s, 0, F_string_ascii_medium_stop_s_length); - const f_string_static_t f_string_ascii_null_s = macro_f_string_static_t_initialize2(F_string_ascii_null_s, 0, F_string_ascii_null_s_length); - const f_string_static_t f_string_ascii_return_carriage_s = macro_f_string_static_t_initialize2(F_string_ascii_return_carriage_s, 0, F_string_ascii_return_carriage_s_length); - const f_string_static_t f_string_ascii_separator_file_s = macro_f_string_static_t_initialize2(F_string_ascii_separator_file_s, 0, F_string_ascii_separator_file_s_length); - const f_string_static_t f_string_ascii_separator_group_s = macro_f_string_static_t_initialize2(F_string_ascii_separator_group_s, 0, F_string_ascii_separator_group_s_length); - const f_string_static_t f_string_ascii_separator_record_s = macro_f_string_static_t_initialize2(F_string_ascii_separator_record_s, 0, F_string_ascii_separator_record_s_length); - const f_string_static_t f_string_ascii_separator_unit_s = macro_f_string_static_t_initialize2(F_string_ascii_separator_unit_s, 0, F_string_ascii_separator_unit_s_length); - const f_string_static_t f_string_ascii_shift_in_s = macro_f_string_static_t_initialize2(F_string_ascii_shift_in_s, 0, F_string_ascii_shift_in_s_length); - const f_string_static_t f_string_ascii_shift_out_s = macro_f_string_static_t_initialize2(F_string_ascii_shift_out_s, 0, F_string_ascii_shift_out_s_length); - const f_string_static_t f_string_ascii_space_s = macro_f_string_static_t_initialize2(F_string_ascii_space_s, 0, F_string_ascii_space_s_length); - const f_string_static_t f_string_ascii_space_back_s = macro_f_string_static_t_initialize2(F_string_ascii_space_back_s, 0, F_string_ascii_space_back_s_length); - const f_string_static_t f_string_ascii_substitute_s = macro_f_string_static_t_initialize2(F_string_ascii_substitute_s, 0, F_string_ascii_substitute_s_length); - const f_string_static_t f_string_ascii_synchronous_idle_s = macro_f_string_static_t_initialize2(F_string_ascii_synchronous_idle_s, 0, F_string_ascii_synchronous_idle_s_length); - const f_string_static_t f_string_ascii_tab_horizontal_s = macro_f_string_static_t_initialize2(F_string_ascii_tab_horizontal_s, 0, F_string_ascii_tab_horizontal_s_length); - const f_string_static_t f_string_ascii_tab_vertical_s = macro_f_string_static_t_initialize2(F_string_ascii_tab_vertical_s, 0, F_string_ascii_tab_vertical_s_length); - const f_string_static_t f_string_ascii_text_start_s = macro_f_string_static_t_initialize2(F_string_ascii_text_start_s, 0, F_string_ascii_text_start_s_length); - const f_string_static_t f_string_ascii_text_stop_s = macro_f_string_static_t_initialize2(F_string_ascii_text_stop_s, 0, F_string_ascii_text_stop_s_length); - const f_string_static_t f_string_ascii_transmission_stop_s = macro_f_string_static_t_initialize2(F_string_ascii_transmission_stop_s, 0, F_string_ascii_transmission_stop_s_length); - const f_string_static_t f_string_ascii_transmission_block_end_s = macro_f_string_static_t_initialize2(F_string_ascii_transmission_block_end_s, 0, F_string_ascii_transmission_block_end_s_length); + const f_string_static_t f_string_ascii_0_s = macro_f_string_static_t_initialize(F_string_ascii_0_s, 0, F_string_ascii_0_s_length); + const f_string_static_t f_string_ascii_1_s = macro_f_string_static_t_initialize(F_string_ascii_1_s, 0, F_string_ascii_1_s_length); + const f_string_static_t f_string_ascii_2_s = macro_f_string_static_t_initialize(F_string_ascii_2_s, 0, F_string_ascii_2_s_length); + const f_string_static_t f_string_ascii_3_s = macro_f_string_static_t_initialize(F_string_ascii_3_s, 0, F_string_ascii_3_s_length); + const f_string_static_t f_string_ascii_4_s = macro_f_string_static_t_initialize(F_string_ascii_4_s, 0, F_string_ascii_4_s_length); + const f_string_static_t f_string_ascii_5_s = macro_f_string_static_t_initialize(F_string_ascii_5_s, 0, F_string_ascii_5_s_length); + const f_string_static_t f_string_ascii_6_s = macro_f_string_static_t_initialize(F_string_ascii_6_s, 0, F_string_ascii_6_s_length); + const f_string_static_t f_string_ascii_7_s = macro_f_string_static_t_initialize(F_string_ascii_7_s, 0, F_string_ascii_7_s_length); + const f_string_static_t f_string_ascii_8_s = macro_f_string_static_t_initialize(F_string_ascii_8_s, 0, F_string_ascii_8_s_length); + const f_string_static_t f_string_ascii_9_s = macro_f_string_static_t_initialize(F_string_ascii_9_s, 0, F_string_ascii_9_s_length); + + const f_string_static_t f_string_ascii_a_s = macro_f_string_static_t_initialize(F_string_ascii_a_s, 0, F_string_ascii_a_s_length); + const f_string_static_t f_string_ascii_b_s = macro_f_string_static_t_initialize(F_string_ascii_b_s, 0, F_string_ascii_b_s_length); + const f_string_static_t f_string_ascii_c_s = macro_f_string_static_t_initialize(F_string_ascii_c_s, 0, F_string_ascii_c_s_length); + const f_string_static_t f_string_ascii_d_s = macro_f_string_static_t_initialize(F_string_ascii_d_s, 0, F_string_ascii_d_s_length); + const f_string_static_t f_string_ascii_e_s = macro_f_string_static_t_initialize(F_string_ascii_e_s, 0, F_string_ascii_e_s_length); + const f_string_static_t f_string_ascii_f_s = macro_f_string_static_t_initialize(F_string_ascii_f_s, 0, F_string_ascii_f_s_length); + const f_string_static_t f_string_ascii_g_s = macro_f_string_static_t_initialize(F_string_ascii_g_s, 0, F_string_ascii_g_s_length); + const f_string_static_t f_string_ascii_h_s = macro_f_string_static_t_initialize(F_string_ascii_h_s, 0, F_string_ascii_h_s_length); + const f_string_static_t f_string_ascii_i_s = macro_f_string_static_t_initialize(F_string_ascii_i_s, 0, F_string_ascii_i_s_length); + const f_string_static_t f_string_ascii_j_s = macro_f_string_static_t_initialize(F_string_ascii_j_s, 0, F_string_ascii_j_s_length); + const f_string_static_t f_string_ascii_k_s = macro_f_string_static_t_initialize(F_string_ascii_k_s, 0, F_string_ascii_k_s_length); + const f_string_static_t f_string_ascii_l_s = macro_f_string_static_t_initialize(F_string_ascii_l_s, 0, F_string_ascii_l_s_length); + const f_string_static_t f_string_ascii_m_s = macro_f_string_static_t_initialize(F_string_ascii_m_s, 0, F_string_ascii_m_s_length); + const f_string_static_t f_string_ascii_n_s = macro_f_string_static_t_initialize(F_string_ascii_n_s, 0, F_string_ascii_n_s_length); + const f_string_static_t f_string_ascii_o_s = macro_f_string_static_t_initialize(F_string_ascii_o_s, 0, F_string_ascii_o_s_length); + const f_string_static_t f_string_ascii_p_s = macro_f_string_static_t_initialize(F_string_ascii_p_s, 0, F_string_ascii_p_s_length); + const f_string_static_t f_string_ascii_q_s = macro_f_string_static_t_initialize(F_string_ascii_q_s, 0, F_string_ascii_q_s_length); + const f_string_static_t f_string_ascii_r_s = macro_f_string_static_t_initialize(F_string_ascii_r_s, 0, F_string_ascii_r_s_length); + const f_string_static_t f_string_ascii_s_s = macro_f_string_static_t_initialize(F_string_ascii_s_s, 0, F_string_ascii_s_s_length); + const f_string_static_t f_string_ascii_t_s = macro_f_string_static_t_initialize(F_string_ascii_t_s, 0, F_string_ascii_t_s_length); + const f_string_static_t f_string_ascii_u_s = macro_f_string_static_t_initialize(F_string_ascii_u_s, 0, F_string_ascii_u_s_length); + const f_string_static_t f_string_ascii_v_s = macro_f_string_static_t_initialize(F_string_ascii_v_s, 0, F_string_ascii_v_s_length); + const f_string_static_t f_string_ascii_w_s = macro_f_string_static_t_initialize(F_string_ascii_w_s, 0, F_string_ascii_w_s_length); + const f_string_static_t f_string_ascii_x_s = macro_f_string_static_t_initialize(F_string_ascii_x_s, 0, F_string_ascii_x_s_length); + const f_string_static_t f_string_ascii_y_s = macro_f_string_static_t_initialize(F_string_ascii_y_s, 0, F_string_ascii_y_s_length); + const f_string_static_t f_string_ascii_z_s = macro_f_string_static_t_initialize(F_string_ascii_z_s, 0, F_string_ascii_z_s_length); + + const f_string_static_t f_string_ascii_A_s = macro_f_string_static_t_initialize(F_string_ascii_A_s, 0, F_string_ascii_A_s_length); + const f_string_static_t f_string_ascii_B_s = macro_f_string_static_t_initialize(F_string_ascii_B_s, 0, F_string_ascii_B_s_length); + const f_string_static_t f_string_ascii_C_s = macro_f_string_static_t_initialize(F_string_ascii_C_s, 0, F_string_ascii_C_s_length); + const f_string_static_t f_string_ascii_D_s = macro_f_string_static_t_initialize(F_string_ascii_D_s, 0, F_string_ascii_D_s_length); + const f_string_static_t f_string_ascii_E_s = macro_f_string_static_t_initialize(F_string_ascii_E_s, 0, F_string_ascii_E_s_length); + const f_string_static_t f_string_ascii_F_s = macro_f_string_static_t_initialize(F_string_ascii_F_s, 0, F_string_ascii_F_s_length); + const f_string_static_t f_string_ascii_G_s = macro_f_string_static_t_initialize(F_string_ascii_G_s, 0, F_string_ascii_G_s_length); + const f_string_static_t f_string_ascii_H_s = macro_f_string_static_t_initialize(F_string_ascii_H_s, 0, F_string_ascii_H_s_length); + const f_string_static_t f_string_ascii_I_s = macro_f_string_static_t_initialize(F_string_ascii_I_s, 0, F_string_ascii_I_s_length); + const f_string_static_t f_string_ascii_J_s = macro_f_string_static_t_initialize(F_string_ascii_J_s, 0, F_string_ascii_J_s_length); + const f_string_static_t f_string_ascii_K_s = macro_f_string_static_t_initialize(F_string_ascii_K_s, 0, F_string_ascii_K_s_length); + const f_string_static_t f_string_ascii_L_s = macro_f_string_static_t_initialize(F_string_ascii_L_s, 0, F_string_ascii_L_s_length); + const f_string_static_t f_string_ascii_M_s = macro_f_string_static_t_initialize(F_string_ascii_M_s, 0, F_string_ascii_M_s_length); + const f_string_static_t f_string_ascii_N_s = macro_f_string_static_t_initialize(F_string_ascii_N_s, 0, F_string_ascii_N_s_length); + const f_string_static_t f_string_ascii_O_s = macro_f_string_static_t_initialize(F_string_ascii_O_s, 0, F_string_ascii_O_s_length); + const f_string_static_t f_string_ascii_P_s = macro_f_string_static_t_initialize(F_string_ascii_P_s, 0, F_string_ascii_P_s_length); + const f_string_static_t f_string_ascii_Q_s = macro_f_string_static_t_initialize(F_string_ascii_Q_s, 0, F_string_ascii_Q_s_length); + const f_string_static_t f_string_ascii_R_s = macro_f_string_static_t_initialize(F_string_ascii_R_s, 0, F_string_ascii_R_s_length); + const f_string_static_t f_string_ascii_S_s = macro_f_string_static_t_initialize(F_string_ascii_S_s, 0, F_string_ascii_S_s_length); + const f_string_static_t f_string_ascii_T_s = macro_f_string_static_t_initialize(F_string_ascii_T_s, 0, F_string_ascii_T_s_length); + const f_string_static_t f_string_ascii_U_s = macro_f_string_static_t_initialize(F_string_ascii_U_s, 0, F_string_ascii_U_s_length); + const f_string_static_t f_string_ascii_V_s = macro_f_string_static_t_initialize(F_string_ascii_V_s, 0, F_string_ascii_V_s_length); + const f_string_static_t f_string_ascii_W_s = macro_f_string_static_t_initialize(F_string_ascii_W_s, 0, F_string_ascii_W_s_length); + const f_string_static_t f_string_ascii_X_s = macro_f_string_static_t_initialize(F_string_ascii_X_s, 0, F_string_ascii_X_s_length); + const f_string_static_t f_string_ascii_Y_s = macro_f_string_static_t_initialize(F_string_ascii_Y_s, 0, F_string_ascii_Y_s_length); + const f_string_static_t f_string_ascii_Z_s = macro_f_string_static_t_initialize(F_string_ascii_Z_s, 0, F_string_ascii_Z_s_length); + + const f_string_static_t f_string_ascii_ampersand_s = macro_f_string_static_t_initialize(F_string_ascii_ampersand_s, 0, F_string_ascii_ampersand_s_length); + const f_string_static_t f_string_ascii_asterisk_s = macro_f_string_static_t_initialize(F_string_ascii_asterisk_s, 0, F_string_ascii_asterisk_s_length); + const f_string_static_t f_string_ascii_brace_close_s = macro_f_string_static_t_initialize(F_string_ascii_brace_close_s, 0, F_string_ascii_brace_close_s_length); + const f_string_static_t f_string_ascii_brace_open_s = macro_f_string_static_t_initialize(F_string_ascii_brace_open_s, 0, F_string_ascii_brace_open_s_length); + const f_string_static_t f_string_ascii_bracket_close_s = macro_f_string_static_t_initialize(F_string_ascii_bracket_close_s, 0, F_string_ascii_bracket_close_s_length); + const f_string_static_t f_string_ascii_bracket_open_s = macro_f_string_static_t_initialize(F_string_ascii_bracket_open_s, 0, F_string_ascii_bracket_open_s_length); + const f_string_static_t f_string_ascii_caret_s = macro_f_string_static_t_initialize(F_string_ascii_caret_s, 0, F_string_ascii_caret_s_length); + const f_string_static_t f_string_ascii_comma_s = macro_f_string_static_t_initialize(F_string_ascii_comma_s, 0, F_string_ascii_comma_s_length); + const f_string_static_t f_string_ascii_colon_s = macro_f_string_static_t_initialize(F_string_ascii_colon_s, 0, F_string_ascii_colon_s_length); + const f_string_static_t f_string_ascii_colon_semi_s = macro_f_string_static_t_initialize(F_string_ascii_colon_semi_s, 0, F_string_ascii_colon_semi_s_length); + const f_string_static_t f_string_ascii_dollar_s = macro_f_string_static_t_initialize(F_string_ascii_dollar_s, 0, F_string_ascii_dollar_s_length); + const f_string_static_t f_string_ascii_equal_s = macro_f_string_static_t_initialize(F_string_ascii_equal_s, 0, F_string_ascii_equal_s_length); + const f_string_static_t f_string_ascii_exclamation_s = macro_f_string_static_t_initialize(F_string_ascii_exclamation_s, 0, F_string_ascii_exclamation_s_length); + const f_string_static_t f_string_ascii_grave_s = macro_f_string_static_t_initialize(F_string_ascii_grave_s, 0, F_string_ascii_grave_s_length); + const f_string_static_t f_string_ascii_mark_question_s = macro_f_string_static_t_initialize(F_string_ascii_mark_question_s, 0, F_string_ascii_mark_question_s_length); + const f_string_static_t f_string_ascii_minus_s = macro_f_string_static_t_initialize(F_string_ascii_minus_s, 0, F_string_ascii_minus_s_length); + const f_string_static_t f_string_ascii_parenthesis_open_s = macro_f_string_static_t_initialize(F_string_ascii_parenthesis_open_s, 0, F_string_ascii_parenthesis_open_s_length); + const f_string_static_t f_string_ascii_parenthesis_close_s = macro_f_string_static_t_initialize(F_string_ascii_parenthesis_close_s, 0, F_string_ascii_parenthesis_close_s_length); + const f_string_static_t f_string_ascii_percent_s = macro_f_string_static_t_initialize(F_string_ascii_percent_s, 0, F_string_ascii_percent_s_length); + const f_string_static_t f_string_ascii_period_s = macro_f_string_static_t_initialize(F_string_ascii_period_s, 0, F_string_ascii_period_s_length); + const f_string_static_t f_string_ascii_pipe_s = macro_f_string_static_t_initialize(F_string_ascii_pipe_s, 0, F_string_ascii_pipe_s_length); + const f_string_static_t f_string_ascii_plus_s = macro_f_string_static_t_initialize(F_string_ascii_plus_s, 0, F_string_ascii_plus_s_length); + const f_string_static_t f_string_ascii_pound_s = macro_f_string_static_t_initialize(F_string_ascii_pound_s, 0, F_string_ascii_pound_s_length); + const f_string_static_t f_string_ascii_quote_double_s = macro_f_string_static_t_initialize(F_string_ascii_quote_double_s, 0, F_string_ascii_quote_double_s_length); + const f_string_static_t f_string_ascii_quote_single_s = macro_f_string_static_t_initialize(F_string_ascii_quote_single_s, 0, F_string_ascii_quote_single_s_length); + const f_string_static_t f_string_ascii_sign_at_s = macro_f_string_static_t_initialize(F_string_ascii_sign_at_s, 0, F_string_ascii_sign_at_s_length); + const f_string_static_t f_string_ascii_sign_greater_than_s = macro_f_string_static_t_initialize(F_string_ascii_sign_greater_than_s, 0, F_string_ascii_sign_greater_than_s_length); + const f_string_static_t f_string_ascii_sign_less_than_s = macro_f_string_static_t_initialize(F_string_ascii_sign_less_than_s, 0, F_string_ascii_sign_less_than_s_length); + const f_string_static_t f_string_ascii_slash_forward_s = macro_f_string_static_t_initialize(F_string_ascii_slash_forward_s, 0, F_string_ascii_slash_forward_s_length); + const f_string_static_t f_string_ascii_slash_backward_s = macro_f_string_static_t_initialize(F_string_ascii_slash_backward_s, 0, F_string_ascii_slash_backward_s_length); + const f_string_static_t f_string_ascii_tilde_s = macro_f_string_static_t_initialize(F_string_ascii_tilde_s, 0, F_string_ascii_tilde_s_length); + const f_string_static_t f_string_ascii_underscore_s = macro_f_string_static_t_initialize(F_string_ascii_underscore_s, 0, F_string_ascii_underscore_s_length); + + const f_string_static_t f_string_ascii_acknowledge_s = macro_f_string_static_t_initialize(F_string_ascii_acknowledge_s, 0, F_string_ascii_acknowledge_s_length); + const f_string_static_t f_string_ascii_acknowledge_negative_s = macro_f_string_static_t_initialize(F_string_ascii_acknowledge_negative_s, 0, F_string_ascii_acknowledge_negative_s_length); + const f_string_static_t f_string_ascii_bell_s = macro_f_string_static_t_initialize(F_string_ascii_bell_s, 0, F_string_ascii_bell_s_length); + const f_string_static_t f_string_ascii_cancel_s = macro_f_string_static_t_initialize(F_string_ascii_cancel_s, 0, F_string_ascii_cancel_s_length); + const f_string_static_t f_string_ascii_data_link_escape_s = macro_f_string_static_t_initialize(F_string_ascii_data_link_escape_s, 0, F_string_ascii_data_link_escape_s_length); + const f_string_static_t f_string_ascii_device_control_one_s = macro_f_string_static_t_initialize(F_string_ascii_device_control_one_s, 0, F_string_ascii_device_control_one_s_length); + const f_string_static_t f_string_ascii_device_control_two_s = macro_f_string_static_t_initialize(F_string_ascii_device_control_two_s, 0, F_string_ascii_device_control_two_s_length); + const f_string_static_t f_string_ascii_device_control_three_s = macro_f_string_static_t_initialize(F_string_ascii_device_control_three_s, 0, F_string_ascii_device_control_three_s_length); + const f_string_static_t f_string_ascii_device_control_four_s = macro_f_string_static_t_initialize(F_string_ascii_device_control_four_s, 0, F_string_ascii_device_control_four_s_length); + const f_string_static_t f_string_ascii_enquiry_s = macro_f_string_static_t_initialize(F_string_ascii_enquiry_s, 0, F_string_ascii_enquiry_s_length); + const f_string_static_t f_string_ascii_escape_s = macro_f_string_static_t_initialize(F_string_ascii_escape_s, 0, F_string_ascii_escape_s_length); + const f_string_static_t f_string_ascii_feed_form_s = macro_f_string_static_t_initialize(F_string_ascii_feed_form_s, 0, F_string_ascii_feed_form_s_length); + const f_string_static_t f_string_ascii_feed_line_s = macro_f_string_static_t_initialize(F_string_ascii_feed_line_s, 0, F_string_ascii_feed_line_s_length); + const f_string_static_t f_string_ascii_header_start_s = macro_f_string_static_t_initialize(F_string_ascii_header_start_s, 0, F_string_ascii_header_start_s_length); + const f_string_static_t f_string_ascii_medium_stop_s = macro_f_string_static_t_initialize(F_string_ascii_medium_stop_s, 0, F_string_ascii_medium_stop_s_length); + const f_string_static_t f_string_ascii_null_s = macro_f_string_static_t_initialize(F_string_ascii_null_s, 0, F_string_ascii_null_s_length); + const f_string_static_t f_string_ascii_return_carriage_s = macro_f_string_static_t_initialize(F_string_ascii_return_carriage_s, 0, F_string_ascii_return_carriage_s_length); + const f_string_static_t f_string_ascii_separator_file_s = macro_f_string_static_t_initialize(F_string_ascii_separator_file_s, 0, F_string_ascii_separator_file_s_length); + const f_string_static_t f_string_ascii_separator_group_s = macro_f_string_static_t_initialize(F_string_ascii_separator_group_s, 0, F_string_ascii_separator_group_s_length); + const f_string_static_t f_string_ascii_separator_record_s = macro_f_string_static_t_initialize(F_string_ascii_separator_record_s, 0, F_string_ascii_separator_record_s_length); + const f_string_static_t f_string_ascii_separator_unit_s = macro_f_string_static_t_initialize(F_string_ascii_separator_unit_s, 0, F_string_ascii_separator_unit_s_length); + const f_string_static_t f_string_ascii_shift_in_s = macro_f_string_static_t_initialize(F_string_ascii_shift_in_s, 0, F_string_ascii_shift_in_s_length); + const f_string_static_t f_string_ascii_shift_out_s = macro_f_string_static_t_initialize(F_string_ascii_shift_out_s, 0, F_string_ascii_shift_out_s_length); + const f_string_static_t f_string_ascii_space_s = macro_f_string_static_t_initialize(F_string_ascii_space_s, 0, F_string_ascii_space_s_length); + const f_string_static_t f_string_ascii_space_back_s = macro_f_string_static_t_initialize(F_string_ascii_space_back_s, 0, F_string_ascii_space_back_s_length); + const f_string_static_t f_string_ascii_substitute_s = macro_f_string_static_t_initialize(F_string_ascii_substitute_s, 0, F_string_ascii_substitute_s_length); + const f_string_static_t f_string_ascii_synchronous_idle_s = macro_f_string_static_t_initialize(F_string_ascii_synchronous_idle_s, 0, F_string_ascii_synchronous_idle_s_length); + const f_string_static_t f_string_ascii_tab_horizontal_s = macro_f_string_static_t_initialize(F_string_ascii_tab_horizontal_s, 0, F_string_ascii_tab_horizontal_s_length); + const f_string_static_t f_string_ascii_tab_vertical_s = macro_f_string_static_t_initialize(F_string_ascii_tab_vertical_s, 0, F_string_ascii_tab_vertical_s_length); + const f_string_static_t f_string_ascii_text_start_s = macro_f_string_static_t_initialize(F_string_ascii_text_start_s, 0, F_string_ascii_text_start_s_length); + const f_string_static_t f_string_ascii_text_stop_s = macro_f_string_static_t_initialize(F_string_ascii_text_stop_s, 0, F_string_ascii_text_stop_s_length); + const f_string_static_t f_string_ascii_transmission_stop_s = macro_f_string_static_t_initialize(F_string_ascii_transmission_stop_s, 0, F_string_ascii_transmission_stop_s_length); + const f_string_static_t f_string_ascii_transmission_block_end_s = macro_f_string_static_t_initialize(F_string_ascii_transmission_block_end_s, 0, F_string_ascii_transmission_block_end_s_length); #endif // _di_string_ascii_s_ #ifndef _di_f_string_dynamic_adjust_ diff --git a/level_0/f_string/c/string_dynamic.h b/level_0/f_string/c/string_dynamic.h index d0543dc..1f9c4ab 100644 --- a/level_0/f_string/c/string_dynamic.h +++ b/level_0/f_string/c/string_dynamic.h @@ -24,8 +24,8 @@ extern "C" { * * The f_string_static_t type should never be directly allocated or deallocated. * - * A special macro_f_string_static_t_initialize() is provided for the special purpose of easily initialize a static string with an identical used and size. - * A special macro_f_string_static_t_initialize2() is provided for the special purpose of easily initialize a static string. + * A special macro_f_string_static_t_initialize2() is provided for the special purpose of easily initialize a static string with an identical used and size. + * A special macro_f_string_static_t_initialize() is provided for the special purpose of easily initialize a static string. * * string: The string. * size: Total amount of space available. @@ -46,8 +46,8 @@ extern "C" { string_static.size = 0; \ string_static.used = 0; - #define macro_f_string_static_t_initialize(string, length) { string, length, length } - #define macro_f_string_static_t_initialize2(string, size, used) { string, size, used } + #define macro_f_string_static_t_initialize(string, size, used) { string, size, used } + #define macro_f_string_static_t_initialize2(string, length) { string, length, length } #endif // _di_f_string_static_t_ /** diff --git a/level_0/f_utf/c/utf.h b/level_0/f_utf/c/utf.h index 1148f36..a550bd5 100644 --- a/level_0/f_utf/c/utf.h +++ b/level_0/f_utf/c/utf.h @@ -47,7 +47,7 @@ #include #include -// fll-0 utf includes +// FLL-0 utf includes. #include #include #include diff --git a/level_1/fl_control_group/c/control_group.c b/level_1/fl_control_group/c/control_group.c index 156b168..7995358 100644 --- a/level_1/fl_control_group/c/control_group.c +++ b/level_1/fl_control_group/c/control_group.c @@ -23,38 +23,37 @@ extern "C" { f_file_t file = macro_f_file_t_initialize2(0, -1, F_file_flag_write_only_d); f_status_t status = F_none; - f_array_length_t length = 0; + f_string_static_t path = f_string_static_t_initialize; for (f_array_length_t i = 0; i < control_group.groups.used; ++i) { if (!control_group.groups.array[i].used) continue; - length = control_group.path.used + control_group.groups.array[i].used + F_control_group_path_system_suffix_s_length; + path.used = control_group.path.used + control_group.groups.array[i].used + F_control_group_path_system_suffix_s_length; - char path[length + 1]; + char path_string[path.used + 1]; + path.string = path_string; if (control_group.path.used) { - memcpy(path, control_group.path.string, control_group.path.used); + memcpy(path.string, control_group.path.string, control_group.path.used); } - memcpy(path + control_group.path.used, control_group.groups.array[i].string, control_group.groups.array[i].used); - memcpy(path + control_group.path.used + F_control_group_path_system_default_s_length, F_control_group_path_system_suffix_s, F_control_group_path_system_suffix_s_length); + memcpy(path.string + control_group.path.used, control_group.groups.array[i].string, control_group.groups.array[i].used); + memcpy(path.string + control_group.path.used + F_control_group_path_system_default_s_length, F_control_group_path_system_suffix_s, F_control_group_path_system_suffix_s_length); - path[length] = 0; + path.string[path.used] = 0; - status = f_file_stream_open(path, 0, &file); + status = f_file_stream_open(path, f_string_empty_s, &file); if (F_status_is_error(status)) break; fprintf(file.stream, "%d", id); fflush(file.stream); - f_file_stream_close(F_true, &file); + status = f_file_stream_close(F_true, &file); if (F_status_is_error(status)) break; } // for - if (F_status_is_error(status)) { - return status; - } + if (F_status_is_error(status)) return status; return F_none; } diff --git a/level_1/fl_directory/c/directory-common.c b/level_1/fl_directory/c/directory-common.c new file mode 100644 index 0000000..2f595c4 --- /dev/null +++ b/level_1/fl_directory/c/directory-common.c @@ -0,0 +1,10 @@ +#include "directory.h" +#include "private-directory.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_1/fl_directory/c/directory-common.h b/level_1/fl_directory/c/directory-common.h new file mode 100644 index 0000000..5113087 --- /dev/null +++ b/level_1/fl_directory/c/directory-common.h @@ -0,0 +1,68 @@ +/** + * FLL - Level 1 + * + * Project: Directory + * API Version: 0.5 + * Licenses: lgpl-2.1-or-later + * + * Defines common data to be used for/by project directory. + * + * This is auto-included by utf.h and should not need to be explicitly included. + */ +#ifndef _FL_directory_common_h +#define _FL_directory_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * An association of a path and a status code. + * + * The allocation macros apply to the path. + * + * depth_max: + * The max recursion depth. + * size_block: + * The default number of chunks to read at a time with each chunk being 1-byte. + * Must be greater than 0. + * exclusive: + * If TRUE, will fail when file already exists. + * If FALSE, will not fail if file already exists (existing file will be replaced). + * output: + * Set to -1 to not print on successful operation. + * Set to a valid file descriptor to print to on successful operation. + * This is passed to the verbose function if that function pointer is not -1. + * verbose: + * Set to 0 to not print on successful operation. + * Set to address of a function to be called for printing such that: + * - The first parameter represents the output file type. + * - The second parameter represents the source string. + * - The third parameter represents the destination string. + * failures: + * A list of paths and their respective status codes for clone failures. + * If 0, then this and statuses are ignored. + */ +#ifndef _di_fl_directory_recurse_t_ + #define FL_directory_recurse_depth_max_d 65535 + + typedef struct { + f_number_unsigned_t depth_max; + f_number_unsigned_t size_block; + + bool exclusive; + f_file_t output; + + void (*verbose)(const f_file_t, const f_string_t, const f_string_t); + + f_directory_statuss_t *failures; + } fl_directory_recurse_t; + + #define fl_directory_recurse_t_initialize { FL_directory_recurse_depth_max_d, F_file_default_read_size_d, F_false, macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), 0, 0 } +#endif // _di_fl_directory_recurse_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _FL_directory_common_h diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index b27c9f0..2adc4df 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -6,12 +6,12 @@ extern "C" { #endif #ifndef _di_fl_directory_create_ - f_status_t fl_directory_create(const f_string_t path, const f_array_length_t length, const mode_t mode) { + f_status_t fl_directory_create(const f_string_static_t path, const mode_t mode) { #ifndef _di_level_1_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); + if (!path.string) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!length) { + if (!path.used) { return F_data_not; } @@ -25,14 +25,17 @@ extern "C" { { f_array_length_t at_tree = 0; f_array_length_t at_path = 0; + f_string_static_t tree = f_string_static_t_initialize; - char tree[length]; + char tree_string[path.used]; + tree.string = tree_string; + tree.used = path.used; - for (; path[at_path]; ++at_path) { + for (; path.string[at_path]; ++at_path) { - if (at_path && path[at_path] == f_path_separator_s.string[0]) { - memcpy(tree, path + at_tree, at_path - at_tree); - tree[at_path] = 0; + if (at_path && path.string[at_path] == f_path_separator_s.string[0]) { + memcpy(tree.string, path.string + at_tree, at_path - at_tree); + tree.string[at_path] = 0; status = f_directory_exists(tree); if (F_status_is_error(status)) return status; @@ -52,12 +55,16 @@ extern "C" { #endif // _di_fl_directory_create_ #ifndef _di_fl_directory_clone_ - f_status_t fl_directory_clone(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const bool role, const fl_directory_recurse_t recurse) { + f_status_t fl_directory_clone(const f_string_static_t source, const f_string_static_t destination, const bool role, const fl_directory_recurse_t recurse) { #ifndef _di_level_1_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); + if (!source.string) return F_status_set_error(F_parameter); + if (!destination.string) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ + if (!source.used || !destination.used) { + return F_data_not; + } + f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; @@ -91,38 +98,37 @@ extern "C" { if (F_status_is_error(status)) return status; } - f_string_static_t static_source = { source, source_length, source_length }; - f_string_static_t static_destination = { destination, destination_length, destination_length }; - - // do not allow null termination or trailing path separators in the string's length calculation. { - f_array_length_t i = source_length; + f_string_static_t static_source = source; + f_string_static_t static_destination = destination; + f_array_length_t i = 0; + // Do not allow null termination or trailing path separators in the string's length calculation. for (; i > 0; --i, --static_source.used) { - if (!source[i - 1]) continue; - if (source[i - 1] == f_path_separator_s.string[0]) continue; + if (!source.string[i - 1]) continue; + if (source.string[i - 1] == f_path_separator_s.string[0]) continue; break; } // for - i = destination_length; + i = destination.used; for (; i > 0; --i, --static_destination.used) { - if (!destination[i - 1]) continue; - if (destination[i - 1] == f_path_separator_s.string[0]) continue; + if (!destination.string[i - 1]) continue; + if (destination.string[i - 1] == f_path_separator_s.string[0]) continue; break; } // for - } - if (recurse.depth_max) { - status = private_fl_directory_clone(static_source, static_destination, role, recurse, 1); + if (recurse.depth_max) { + status = private_fl_directory_clone(static_source, static_destination, role, recurse, 1); + } } if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, source, destination); + recurse.verbose(recurse.output, source.string, destination.string); } return status; @@ -130,12 +136,16 @@ extern "C" { #endif // _di_fl_directory_clone_ #ifndef _di_fl_directory_clone_content_ - f_status_t fl_directory_clone_content(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const bool role, const fl_directory_recurse_t recurse) { + f_status_t fl_directory_clone_content(const f_string_static_t source, const f_string_static_t destination, const bool role, const fl_directory_recurse_t recurse) { #ifndef _di_level_1_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); + if (!source.string) return F_status_set_error(F_parameter); + if (!destination.string) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ + if (!source.used || !destination.used) { + return F_data_not; + } + f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; @@ -145,27 +155,27 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_false) return F_status_set_error(F_directory); - f_string_static_t static_source = { source, source_length, source_length }; - f_string_static_t static_destination = { destination, destination_length, destination_length }; + f_string_static_t static_source = macro_f_string_static_t_initialize2(source.string, source.used); + f_string_static_t static_destination = macro_f_string_static_t_initialize2(destination.string, destination.used); - // do not allow null termination or trailing path separators in the string's length calculation. + // Do not allow null termination or trailing path separators in the string's length calculation. { - f_array_length_t i = source_length; + f_array_length_t i = source.used; for (; i > 0; --i, --static_source.used) { - if (!source[i - 1]) continue; - if (source[i - 1] == f_path_separator_s.string[0]) continue; + if (!source.string[i - 1]) continue; + if (source.string[i - 1] == f_path_separator_s.string[0]) continue; break; } // for - i = destination_length; + i = destination.used; for (; i > 0; --i, --static_destination.used) { - if (!destination[i - 1]) continue; - if (destination[i - 1] == f_path_separator_s.string[0]) continue; + if (!destination.string[i - 1]) continue; + if (destination.string[i - 1] == f_path_separator_s.string[0]) continue; break; } // for @@ -178,7 +188,7 @@ extern "C" { status = private_fl_directory_clone(static_source, static_destination, role, recurse, 1); if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, source, destination); + recurse.verbose(recurse.output, source.string, destination.string); } return status; @@ -186,12 +196,16 @@ extern "C" { #endif // _di_fl_directory_clone_content_ #ifndef _di_fl_directory_copy_ - f_status_t fl_directory_copy(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const f_mode_t mode, const fl_directory_recurse_t recurse) { + f_status_t fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const fl_directory_recurse_t recurse) { #ifndef _di_level_1_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); + if (!source.string) return F_status_set_error(F_parameter); + if (!destination.string) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ + if (!source.used || !destination.used) { + return F_data_not; + } + f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; @@ -213,27 +227,27 @@ extern "C" { if (F_status_is_error(status)) return status; } - f_string_static_t static_source = { source, source_length, source_length }; - f_string_static_t static_destination = { destination, destination_length, destination_length }; + f_string_static_t static_source = macro_f_string_static_t_initialize2(source.string, source.used); + f_string_static_t static_destination = macro_f_string_static_t_initialize2(destination.string, destination.used); - // do not allow null termination or trailing path separators in the string's length calculation. + // Do not allow null termination or trailing path separators in the string's length calculation. { - f_array_length_t i = source_length; + f_array_length_t i = source.used; for (; i > 0; --i, --static_source.used) { - if (!source[i - 1]) continue; - if (source[i - 1] == f_path_separator_s.string[0]) continue; + if (!source.string[i - 1]) continue; + if (source.string[i - 1] == f_path_separator_s.string[0]) continue; break; } // for - i = destination_length; + i = destination.used; for (; i > 0; --i, --static_destination.used) { - if (!destination[i - 1]) continue; - if (destination[i - 1] == f_path_separator_s.string[0]) continue; + if (!destination.string[i - 1]) continue; + if (destination.string[i - 1] == f_path_separator_s.string[0]) continue; break; } // for @@ -244,7 +258,7 @@ extern "C" { } if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, source, destination); + recurse.verbose(recurse.output, source.string, destination.string); } return status; @@ -252,12 +266,16 @@ extern "C" { #endif // _di_fl_directory_copy_ #ifndef _di_fl_directory_copy_content_ - f_status_t fl_directory_copy_content(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const f_mode_t mode, const fl_directory_recurse_t recurse) { + f_status_t fl_directory_copy_content(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const fl_directory_recurse_t recurse) { #ifndef _di_level_1_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); + if (!source.string) return F_status_set_error(F_parameter); + if (!destination.string) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ + if (!source.used || !destination.used) { + return F_data_not; + } + f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; @@ -267,27 +285,27 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_false) return F_status_set_error(F_directory); - f_string_static_t static_source = { source, source_length, source_length }; - f_string_static_t static_destination = { destination, destination_length, destination_length }; + f_string_static_t static_source = macro_f_string_static_t_initialize2(source.string, source.used); + f_string_static_t static_destination = macro_f_string_static_t_initialize2(destination.string, destination.used); - // do not allow null termination or trailing path separators in the string's length calculation. + // Do not allow null termination or trailing path separators in the string's length calculation. { - f_array_length_t i = source_length; + f_array_length_t i = source.used; for (; i > 0; --i, --static_source.used) { - if (!source[i - 1]) continue; - if (source[i - 1] == f_path_separator_s.string[0]) continue; + if (!source.string[i - 1]) continue; + if (source.string[i - 1] == f_path_separator_s.string[0]) continue; break; } // for - i = destination_length; + i = destination.used; for (; i > 0; --i, --static_destination.used) { - if (!destination[i - 1]) continue; - if (destination[i - 1] == f_path_separator_s.string[0]) continue; + if (!destination.string[i - 1]) continue; + if (destination.string[i - 1] == f_path_separator_s.string[0]) continue; break; } // for @@ -298,7 +316,7 @@ extern "C" { } if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, source, destination); + recurse.verbose(recurse.output, source.string, destination.string); } return status; @@ -306,12 +324,16 @@ extern "C" { #endif // _di_fl_directory_copy_content_ #ifndef _di_fl_directory_list_ - f_status_t fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) { + f_status_t fl_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) { #ifndef _di_level_1_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); + if (!path.string) return F_status_set_error(F_parameter); if (!listing) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_fl_directory_list(path, filter, sort, dereference, listing); } #endif // _di_fl_directory_list_ @@ -319,7 +341,7 @@ extern "C" { #ifndef _di_fl_directory_path_pop_ f_status_t fl_directory_path_pop(f_string_static_t *path) { #ifndef _di_level_1_parameter_checking_ - if (path->used > path->size) return F_status_set_error(F_parameter); + if (!path->string) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (!path->used) { @@ -377,6 +399,7 @@ extern "C" { if (path->string[j] != f_path_separator_s.string[0]) { i = j + 1; + break; } } // for @@ -384,39 +407,24 @@ extern "C" { } // for path->used = 0; + return F_none; } #endif // _di_fl_directory_path_pop_ #ifndef _di_fl_directory_path_push_ - f_status_t fl_directory_path_push(const f_string_t source, f_array_length_t length, f_string_dynamic_t *destination) { + f_status_t fl_directory_path_push(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (destination->used > destination->size) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) { - return F_data_not; - } - - return private_fl_directory_path_push(source, length, destination); - } -#endif // _di_fl_directory_path_push_ - -#ifndef _di_fl_directory_path_push_dynamic_ - f_status_t fl_directory_path_push_dynamic(const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used > source.size) return F_status_set_error(F_parameter); - if (destination->used > destination->size) return F_status_set_error(F_parameter); + if (!source.string) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (!source.used) { return F_data_not; } - return private_fl_directory_path_push(source.string, source.used, destination); + return private_fl_directory_path_push(source, destination); } -#endif // _di_fl_directory_path_push_dynamic_ +#endif // _di_fl_directory_path_push_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index 25d77b7..6001911 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -20,7 +20,7 @@ #include #include -// work-around for out-dated systems. +// Work-around for systems that require __USE_XOPEN_EXTENDED defined to properly include ftw.h. #ifndef __USE_XOPEN_EXTENDED #define __USE_XOPEN_EXTENDED #include @@ -40,56 +40,14 @@ #include #include +// FLL-1 directory includes. +#include + #ifdef __cplusplus extern "C" { #endif /** - * An association of a path and a status code. - * - * The allocation macros apply to the path. - * - * depth_max: - * The max recursion depth. - * size_block: - * The default number of chunks to read at a time with each chunk being 1-byte. - * Must be greater than 0. - * exclusive: - * If TRUE, will fail when file already exists. - * If FALSE, will not fail if file already exists (existing file will be replaced). - * output: - * Set to -1 to not print on successful operation. - * Set to a valid file descriptor to print to on successful operation. - * This is passed to the verbose function if that function pointer is not -1. - * verbose: - * Set to 0 to not print on successful operation. - * Set to address of a function to be called for printing such that: - * - The first parameter represents the output file type. - * - The second parameter represents the source string. - * - The third parameter represents the destination string. - * failures: - * A list of paths and their respective status codes for clone failures. - * If 0, then this and statuses are ignored. - */ -#ifndef _di_fl_directory_recurse_t_ - #define FL_directory_recurse_depth_max_d 65535 - - typedef struct { - f_number_unsigned_t depth_max; - f_number_unsigned_t size_block; - - bool exclusive; - f_file_t output; - - void (*verbose)(const f_file_t, const f_string_t, const f_string_t); - - f_directory_statuss_t *failures; - } fl_directory_recurse_t; - - #define fl_directory_recurse_t_initialize { FL_directory_recurse_depth_max_d, F_file_default_read_size_d, F_false, macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), 0, 0 } -#endif // _di_fl_directory_recurse_t_ - -/** * Create all directories at the given path. * * The paths must not contain NULL except for the terminating NULL. @@ -97,15 +55,13 @@ extern "C" { * * @param path * The file path to the directory. - * @param length - * The length of the path string. * @param mode * The directory mode to use when creating. * This is applied to all created directories. * * @return * F_none on success. - * F_data_not on success, but there was no string to process (length is 0). + * F_data_not if path.used is 0. * F_directory_found on success, but the directory already exists. * * F_access_denied (with error bit) on access denied. @@ -126,7 +82,7 @@ extern "C" { * @see f_directory_create() */ #ifndef _di_fl_directory_create_ - extern f_status_t fl_directory_create(const f_string_t path, const f_array_length_t length, const mode_t mode); + extern f_status_t fl_directory_create(const f_string_static_t path, const mode_t mode); #endif // _di_fl_directory_create_ /** @@ -145,10 +101,6 @@ extern "C" { * @param destination * The destination file path. * Must be NULL terminated. - * @param source_length - * The length of the source path. - * @param destination_length - * The length of the destination path. * @param role * If TRUE, will copy the owner and group ids. * If FALSE, will not copy the owner and group ids. @@ -158,6 +110,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if source.used or destination.used is 0. * * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * @@ -170,7 +123,7 @@ extern "C" { * @see f_file_clone() */ #ifndef _di_fl_directory_clone_ - extern f_status_t fl_directory_clone(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const bool role, const fl_directory_recurse_t recurse); + extern f_status_t fl_directory_clone(const f_string_static_t source, const f_string_static_t destination, const bool role, const fl_directory_recurse_t recurse); #endif // _di_fl_directory_clone_ /** @@ -191,10 +144,6 @@ extern "C" { * @param destination * The destination file path. * Must be NULL terminated. - * @param source_length - * The length of the source path. - * @param destination_length - * The length of the destination path. * @param role * If TRUE, will copy the owner and group ids. * If FALSE, will not copy the owner and group ids. @@ -204,6 +153,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if source.used or destination.used is 0. * * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * @@ -212,7 +162,7 @@ extern "C" { * @see f_file_clone() */ #ifndef _di_fl_directory_clone_content_ - extern f_status_t fl_directory_clone_content(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const bool role, const fl_directory_recurse_t recurse); + extern f_status_t fl_directory_clone_content(const f_string_static_t source, const f_string_static_t destination, const bool role, const fl_directory_recurse_t recurse); #endif // _di_fl_directory_clone_content_ /** @@ -231,10 +181,6 @@ extern "C" { * @param destination * The destination file path. * Must be NULL terminated. - * @param source_length - * The length of the source path. - * @param destination_length - * The length of the destination path. * @param mode * The directory modes. * @param recurse @@ -242,6 +188,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if source.used or destination.used is 0. * * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * @@ -254,7 +201,7 @@ extern "C" { * @see f_file_copy() */ #ifndef _di_fl_directory_copy_ - extern f_status_t fl_directory_copy(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const f_mode_t mode, const fl_directory_recurse_t recurse); + extern f_status_t fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const fl_directory_recurse_t recurse); #endif // _di_fl_directory_copy_ /** @@ -275,10 +222,6 @@ extern "C" { * @param destination * The destination file path. * Must be NULL terminated. - * @param source_length - * The length of the source path. - * @param destination_length - * The length of the destination path. * @param mode * The directory modes. * @param recurse @@ -286,6 +229,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if source.used or destination.used is 0. * * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * @@ -294,7 +238,7 @@ extern "C" { * @see f_file_copy() */ #ifndef _di_fl_directory_copy_content_ - extern f_status_t fl_directory_copy_content(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const f_mode_t mode, const fl_directory_recurse_t recurse); + extern f_status_t fl_directory_copy_content(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const fl_directory_recurse_t recurse); #endif // _di_fl_directory_copy_content_ /** @@ -319,7 +263,8 @@ extern "C" { * * @return * F_none on success. - * F_data_not if directory is empty. + * F_data_not if source.used or destination.used is 0. + * F_directory_empty if directory is empty. * * F_directory_descriptor (with error bit) on directory file descriptor error. * F_directory_open (with error bit) on directory open error. @@ -333,14 +278,18 @@ extern "C" { * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * * Errors (with error bit) from: f_file_stat_at(). + * Errors (with error bit) from: f_string_dynamics_increase_by(). * * @see alphasort() * @see opendir() * @see scandir() * @see versionsort() + * + * @see f_file_stat_at() + * @see f_string_dynamics_increase_by() */ #ifndef _di_fl_directory_list_ - extern f_status_t fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing); + extern f_status_t fl_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing); #endif // _di_fl_directory_list_ /** @@ -376,9 +325,6 @@ extern "C" { * @param source * The path to append onto the destination. * This need not be NULL terminated. - * @param length - * The length of the string. - * Must not exceed length of source. * @param destination * The destination path to push the path part onto. * Any terminating NULLs at the end of the destination string are removed before appending. @@ -386,7 +332,7 @@ extern "C" { * * @return * F_none on success. - * F_data_not if length is 0. + * F_data_not if source.used is 0. * * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. @@ -394,36 +340,9 @@ extern "C" { * Errors (with error bit) from: f_utf_is_control(). */ #ifndef _di_fl_directory_path_push_ - extern f_status_t fl_directory_path_push(const f_string_t source, f_array_length_t length, f_string_dynamic_t *destination); + extern f_status_t fl_directory_path_push(const f_string_static_t source, f_string_dynamic_t *destination); #endif // _di_fl_directory_path_push_ -/** - * Append a dynamic path string onto the destination path. - * - * This ensures that there is a leading and trailing '/' from source. - * This ignores control characters. - * - * @param source - * The path to append onto the destination. - * This need not be NULL terminated. - * @param destination - * The destination path to push the path part onto. - * Any terminating NULLs at the end of the destination string are removed before appending. - * This will only be NULL terminated if destination string is already NULL terminated. - * - * @return - * F_none on success. - * F_data_not if source.used is 0. - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. - * - * Errors (with error bit) from: f_utf_is_control(). - */ -#ifndef _di_fl_directory_path_push_dynamic_ - extern f_status_t fl_directory_path_push_dynamic(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_directory_path_push_dynamic_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index ca61a29..211edb2 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -11,10 +11,11 @@ extern "C" { f_status_t status = F_none; f_directory_listing_t listing = f_directory_listing_t_initialize; - status = private_fl_directory_list(source.string, 0, 0, F_false, &listing); + status = private_fl_directory_list(source, 0, 0, F_false, &listing); if (F_status_is_error(status)) { macro_f_directory_listing_t_delete_simple(listing); + return status; } @@ -75,11 +76,12 @@ extern "C" { source_sub.string = path_source_sub; destination_sub.string = path_destination_sub; - status = f_directory_exists(source_sub.string); + status = f_directory_exists(source_sub); if (F_status_is_error(status)) break; if (status == F_false) { status = F_status_set_error(F_directory); + break; } @@ -88,28 +90,29 @@ extern "C" { memset(&source_stat, 0, sizeof(struct stat)); - status = f_file_stat(source_sub.string, F_false, &source_stat); + status = f_file_stat(source_sub, F_false, &source_stat); if (F_status_is_error(status)) break; - status = f_directory_exists(destination_sub.string); + status = f_directory_exists(destination_sub); if (F_status_is_error(status)) break; if (status == F_true) { if (recurse.exclusive) { status = F_status_set_error(F_directory_found); + break; } - status = f_file_mode_set(destination_sub.string, source_stat.st_mode); + status = f_file_mode_set(destination_sub, source_stat.st_mode); if (F_status_is_error(status)) break; } else { - status = f_directory_create(destination_sub.string, source_stat.st_mode); + status = f_directory_create(destination_sub, source_stat.st_mode); if (F_status_is_error(status)) break; } if (role) { - status = f_file_role_change(destination_sub.string, source_stat.st_uid, source_stat.st_gid, F_true); + status = f_file_role_change(destination_sub, source_stat.st_uid, source_stat.st_gid, F_true); if (F_status_is_error(status)) break; } } @@ -124,7 +127,6 @@ extern "C" { } // for f_string_dynamics_resize(0, &listing.directory); - if (F_status_is_error(status)) return status; if (recurse.failures && failures_used < recurse.failures->used) { @@ -138,18 +140,27 @@ extern "C" { #if !defined(_di_fl_directory_clone_file_) f_status_t private_fl_directory_clone_file(const f_string_static_t file, const f_string_static_t source, const f_string_static_t destination, const bool role, const fl_directory_recurse_t recurse) { - char path_source[source.used + file.used + 2]; - char path_destination[destination.used + file.used + 2]; + f_string_static_t path_source = f_string_static_t_initialize; + f_string_static_t path_destination = f_string_static_t_initialize; + + path_source.used = source.used + file.used + 2; + path_destination.used = destination.used + file.used + 2; - memcpy(path_source, source.string, source.used); - memcpy(path_source + source.used + 1, file.string, file.used); - path_source[source.used] = f_path_separator_s.string[0]; - path_source[source.used + file.used + 1] = 0; + char path_source_string[path_source.used]; + char path_destination_string[path_destination.used]; - memcpy(path_destination, destination.string, destination.used); - memcpy(path_destination + destination.used + 1, file.string, file.used); - path_destination[destination.used] = f_path_separator_s.string[0]; - path_destination[destination.used + file.used + 1] = 0; + path_source.string = path_source_string; + path_destination.string = path_destination_string; + + memcpy(path_source_string, source.string, source.used); + memcpy(path_source_string + source.used + 1, file.string, file.used); + path_source_string[source.used] = f_path_separator_s.string[0]; + path_source_string[source.used + file.used + 1] = 0; + + memcpy(path_destination_string, destination.string, destination.used); + memcpy(path_destination_string + destination.used + 1, file.string, file.used); + path_destination_string[destination.used] = f_path_separator_s.string[0]; + path_destination_string[destination.used + file.used + 1] = 0; f_status_t status = f_file_clone(path_source, path_destination, role, recurse.size_block, recurse.exclusive); @@ -173,7 +184,7 @@ extern "C" { memset(&source_stat, 0, sizeof(struct stat)); - status = f_file_stat(source.string, F_false, &source_stat); + status = f_file_stat(source, F_false, &source_stat); if (F_status_is_error(status)) { if (status == F_status_set_error(F_string_too_large)) { size = F_string_t_size_d - 1; @@ -185,7 +196,7 @@ extern "C" { macro_f_directory_status_t_resize(status, failure, size + 1); if (F_status_is_error(status)) return status; - memcpy(failure.path.string, path_source, size); + memcpy(failure.path.string, path_source.string, size); failure.path.string[size] = 0; } else { @@ -199,21 +210,20 @@ extern "C" { macro_f_directory_status_t_resize(status, failure, size + 1); if (F_status_is_error(status)) return status; - memcpy(failure.path.string, path_destination, size); + memcpy(failure.path.string, path_destination.string, size); failure.path.string[size] = 0; } recurse.failures->array[recurse.failures->used].path.string = failure.path.string; recurse.failures->array[recurse.failures->used].path.used = size; recurse.failures->array[recurse.failures->used].path.size = size + 1; - recurse.failures->array[recurse.failures->used].status = status_failure; - ++recurse.failures->used; + recurse.failures->array[recurse.failures->used++].status = status_failure; return F_failure; } if ((!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, path_source, path_destination); + recurse.verbose(recurse.output, path_source.string, path_destination.string); } return F_none; @@ -226,7 +236,7 @@ extern "C" { f_status_t status = F_none; f_directory_listing_t listing = f_directory_listing_t_initialize; - status = private_fl_directory_list(source.string, 0, 0, F_false, &listing); + status = private_fl_directory_list(source, 0, 0, F_false, &listing); if (F_status_is_error(status)) { macro_f_directory_listing_t_delete_simple(listing); @@ -291,28 +301,30 @@ extern "C" { source_sub.string = path_source_sub; destination_sub.string = path_destination_sub; - status = f_directory_exists(source_sub.string); + status = f_directory_exists(source_sub); if (F_status_is_error(status)) break; if (status == F_false) { status = F_status_set_error(F_directory); + break; } - status = f_directory_exists(destination_sub.string); + status = f_directory_exists(destination_sub); if (F_status_is_error(status)) break; if (status == F_true) { if (recurse.exclusive) { status = F_status_set_error(F_directory_found); + break; } - status = f_file_mode_set(destination_sub.string, mode.directory); + status = f_file_mode_set(destination_sub, mode.directory); if (F_status_is_error(status)) break; } else { - status = f_directory_create(destination_sub.string, mode.directory); + status = f_directory_create(destination_sub, mode.directory); if (F_status_is_error(status)) break; } @@ -339,18 +351,28 @@ extern "C" { #if !defined(_di_fl_directory_copy_file_) f_status_t private_fl_directory_copy_file(const f_string_static_t file, const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const fl_directory_recurse_t recurse) { - char path_source[source.used + file.used + 2]; - char path_destination[destination.used + file.used + 2]; - memcpy(path_source, source.string, source.used); - memcpy(path_source + source.used + 1, file.string, file.used); - path_source[source.used] = f_path_separator_s.string[0]; - path_source[source.used + file.used + 1] = 0; + f_string_static_t path_source = f_string_static_t_initialize; + f_string_static_t path_destination = f_string_static_t_initialize; + + path_source.used = source.used + file.used + 2; + path_destination.used = destination.used + file.used + 2; - memcpy(path_destination, destination.string, destination.used); - memcpy(path_destination + destination.used + 1, file.string, file.used); - path_destination[destination.used] = f_path_separator_s.string[0]; - path_destination[destination.used + file.used + 1] = 0; + char path_source_string[path_source.used]; + char path_destination_string[path_destination.used]; + + path_source.string = path_source_string; + path_destination.string = path_destination_string; + + memcpy(path_source_string, source.string, source.used); + memcpy(path_source_string + source.used + 1, file.string, file.used); + path_source_string[source.used] = f_path_separator_s.string[0]; + path_source_string[source.used + file.used + 1] = 0; + + memcpy(path_destination_string, destination.string, destination.used); + memcpy(path_destination_string + destination.used + 1, file.string, file.used); + path_destination_string[destination.used] = f_path_separator_s.string[0]; + path_destination_string[destination.used + file.used + 1] = 0; f_status_t status = f_file_copy(path_source, path_destination, mode, recurse.size_block, recurse.exclusive); @@ -376,7 +398,7 @@ extern "C" { memset(&source_stat, 0, sizeof(struct stat)); - status = f_file_stat(source.string, F_false, &source_stat); + status = f_file_stat(source, F_false, &source_stat); if (F_status_is_error(status)) { if (status == F_status_set_error(F_string_too_large)) { @@ -389,7 +411,7 @@ extern "C" { macro_f_directory_status_t_resize(status, failure, size + 1); if (F_status_is_error(status)) return status; - memcpy(failure.path.string, path_source, size); + memcpy(failure.path.string, path_source.string, size); failure.path.string[size] = 0; } else { @@ -403,21 +425,20 @@ extern "C" { macro_f_directory_status_t_resize(status, failure, size + 1); if (F_status_is_error(status)) return status; - memcpy(failure.path.string, path_destination, size); + memcpy(failure.path.string, path_destination.string, size); failure.path.string[size] = 0; } recurse.failures->array[recurse.failures->used].path.string = failure.path.string; recurse.failures->array[recurse.failures->used].path.used = size; recurse.failures->array[recurse.failures->used].path.size = size + 1; - recurse.failures->array[recurse.failures->used].status = status_failure; - ++recurse.failures->used; + recurse.failures->array[recurse.failures->used++].status = status_failure; return F_failure; } if ((!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, path_source, path_destination); + recurse.verbose(recurse.output, path_source.string, path_destination.string); } return F_none; @@ -425,37 +446,23 @@ extern "C" { #endif // !defined(_di_fl_directory_copy_file_) #if !defined(_di_fl_directory_list_) - f_status_t private_fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) { + f_status_t private_fl_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) { struct dirent **entity = 0; f_array_length_t size = 0; f_status_t status = F_none; - DIR *parent = opendir(path); + DIR *parent = opendir(path.string); if (!parent) { - if (errno == ENOMEM) { - return F_status_set_error(F_memory_not); - } - else if (errno == ENOMEM) { - return F_status_set_error(F_memory_not); - } - else if (errno == EMFILE) { - return F_status_set_error(F_file_descriptor_max); - } - else if (errno == ENFILE) { - return F_status_set_error(F_file_open_max); - } - else if (errno == ENOTDIR) { - return F_status_set_error(F_directory); - } - else if (errno == ENOENT) { - return F_status_set_error(F_directory_found_not); - } - else if (errno == EACCES) { - return F_status_set_error(F_access_denied); - } + if (errno == ENOMEM) return F_status_set_error(F_memory_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_not); + if (errno == EMFILE) return F_status_set_error(F_file_descriptor_max); + if (errno == ENFILE) return F_status_set_error(F_file_open_max); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOENT) return F_status_set_error(F_directory_found_not); + if (errno == EACCES) return F_status_set_error(F_access_denied); return F_status_set_error(F_directory_open); } @@ -465,29 +472,23 @@ extern "C" { if (parent_fd < 0) { closedir(parent); - if (errno == EINVAL) { - return F_status_set_error(F_directory_stream); - } - else if (errno == ENOTSUP) { - return F_status_set_error(F_directory_supported_not); - } + if (errno == EINVAL) return F_status_set_error(F_directory_stream); + if (errno == ENOTSUP) return F_status_set_error(F_directory_supported_not); return F_status_set_error(F_directory_descriptor); } - const size_t length = scandir(path, &entity, filter, sort); + const size_t length = scandir(path.string, &entity, filter, sort); if (length == -1) { closedir(parent); - if (errno == ENOMEM) { - return F_status_set_error(F_memory_not); - } - else { - return F_status_set_error(F_failure); - } + if (errno == ENOMEM) return F_status_set_error(F_memory_not); + + return F_status_set_error(F_failure); } + f_string_static_t name_directory = f_string_static_t_initialize; f_string_dynamics_t *names = 0; f_array_length_t total = 0; struct stat file_stat; @@ -496,10 +497,11 @@ extern "C" { for (; i < length; ++i) { - size = strnlen(entity[i]->d_name, F_directory_name_max_d); + name_directory.string = entity[i]->d_name; + name_directory.used = strnlen(name_directory.string, F_directory_name_max_d); // There is no reason to include "." and ".." in the directory listing. - if (!strncmp(entity[i]->d_name, "..", 3) || !strncmp(entity[i]->d_name, ".", 2)) { + if (!strncmp(name_directory.string, "..", 3) || !strncmp(name_directory.string, ".", 2)) { f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]); continue; @@ -507,7 +509,7 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); - status = f_file_stat_at(parent_fd, entity[i]->d_name, dereference ? 0 : AT_SYMLINK_NOFOLLOW, &file_stat); + status = f_file_stat_at(parent_fd, name_directory, dereference ? 0 : AT_SYMLINK_NOFOLLOW, &file_stat); if (F_status_is_error(status)) break; mode = macro_f_file_type_get(file_stat.st_mode); @@ -538,35 +540,17 @@ extern "C" { } if (names->used == names->size) { - macro_f_string_dynamics_t_resize(status, (*names), names->size + F_directory_default_allocation_step_d); + status = f_string_dynamics_increase_by(F_directory_default_allocation_step_d, names); if (F_status_is_error(status)) break; } - macro_f_string_dynamic_t_clear(names->array[names->used]) - macro_f_string_dynamic_t_resize(status, names->array[names->used], size); - if (F_status_is_error(status)) break; - - if (names->array[names->used].used > 0 && names->array[names->used].string[names->array[names->used].used - 1] != 0) { - if (names->array[names->used].used == F_string_t_size_d) { - status = F_status_set_error(F_string_too_large); - break; - } - - total = names->array[names->used].used + 1; - if (total > names->array[names->used].size) { - f_status_t status = F_none; + names->array[names->used].used = 0; - macro_f_string_dynamics_t_resize(status, (*names), total); - if (F_status_is_error(status)) break; - } - - names->array[names->used].string[names->array[names->used].used] = 0; - names->array[names->used].used = total; - } + status = f_string_dynamic_increase_by(name_directory.used, &names->array[names->used]); + if (F_status_is_error(status)) break; - memcpy(names->array[names->used].string, entity[i]->d_name, size); - names->array[names->used].used = size; - ++names->used; + memcpy(names->array[names->used].string, name_directory.string, name_directory.used); + names->array[names->used++].used = name_directory.used; f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]); } // for @@ -580,14 +564,14 @@ extern "C" { f_memory_resize(1, 0, sizeof(struct dirent *), (void **) & entity); if (F_status_is_error(status)) return status; - if (!length) return F_data_not; + if (!length) return F_directory_empty; return F_none; } #endif // !defined(_di_fl_directory_list_) #if !defined(_di_fl_directory_path_push_) || !defined(_di_fl_directory_path_push_dynamic_) - f_status_t private_fl_directory_path_push(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) { + f_status_t private_fl_directory_path_push(const f_string_static_t source, f_string_dynamic_t *destination) { bool terminated_null = F_false; bool separator_prepend = F_false; @@ -595,7 +579,7 @@ extern "C" { f_array_length_t total = 0; f_array_length_t start = 0; - f_array_length_t length_truncated = length; + f_array_length_t length_truncated = source.used; f_status_t status = F_none; { @@ -663,10 +647,11 @@ extern "C" { } } - for (i = length - 1; i > 0; --i) { - if (!source[i]) continue; + for (i = source.used - 1; i > 0; --i) { + + if (!source.string[i]) continue; - status = f_utf_is_control(source + i, length - i); + status = f_utf_is_control(source.string + i, source.used - i); if (status == F_true) continue; if (F_status_is_error(status)) { @@ -675,7 +660,7 @@ extern "C" { return status; } - if (source[i] == f_path_separator_s.string[0]) { + if (source.string[i] == f_path_separator_s.string[0]) { if (!separator_prepend && destination->used > 0) { --destination->used; } @@ -683,9 +668,9 @@ extern "C" { if (i - 1 > 0) { for (j = i - 1; j > 0; --j) { - if (!source[j]) continue; + if (!source.string[j]) continue; - status = f_utf_is_control(source + j, length - j); + status = f_utf_is_control(source.string + j, source.used - j); if (status == F_true) continue; if (F_status_is_error(status)) { @@ -694,7 +679,7 @@ extern "C" { return status; } - if (source[j] == f_path_separator_s.string[0]) { + if (source.string[j] == f_path_separator_s.string[0]) { length_truncated = j + 1; } else { @@ -711,16 +696,16 @@ extern "C" { break; } // for - if (!i && source[0] != f_path_separator_s.string[0]) { + if (!i && source.string[0] != f_path_separator_s.string[0]) { separator_append = F_true; ++total; } for (i = 0; i < length_truncated; ++i) { - if (!source[i]) continue; + if (!source.string[i]) continue; - status = f_utf_is_control(source + i, length - i); + status = f_utf_is_control(source.string + i, source.used - i); if (status == F_true) continue; if (F_status_is_error(status)) { @@ -731,13 +716,13 @@ extern "C" { start = i; - if (source[0] == f_path_separator_s.string[0]) { + if (source.string[0] == f_path_separator_s.string[0]) { if (i + 1 < length_truncated) { for (j = i + 1; j < length_truncated; ++j) { - if (!source[j]) continue; + if (!source.string[j]) continue; - status = f_utf_is_control(source + j, length - j); + status = f_utf_is_control(source.string + j, source.used - j); if (status == F_true) continue; if (F_status_is_error(status)) { @@ -746,7 +731,7 @@ extern "C" { return status; } - if (source[j] == f_path_separator_s.string[0]) { + if (source.string[j] == f_path_separator_s.string[0]) { start = j; } else { @@ -772,13 +757,12 @@ extern "C" { } if (separator_prepend) { - destination->string[destination->used] = f_path_separator_s.string[0]; - ++destination->used; + destination->string[destination->used++] = f_path_separator_s.string[0]; --total; } if (length_truncated - start > 0) { - memcpy(destination->string + destination->used, source + start, length_truncated - start); + memcpy(destination->string + destination->used, source.string + start, length_truncated - start); } destination->used += total; diff --git a/level_1/fl_directory/c/private-directory.h b/level_1/fl_directory/c/private-directory.h index 2f4c354..3fe1e50 100644 --- a/level_1/fl_directory/c/private-directory.h +++ b/level_1/fl_directory/c/private-directory.h @@ -172,11 +172,14 @@ extern "C" { * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * * Errors (with error bit) from: f_file_stat_at(). + * Errors (with error bit) from: f_string_dynamics_increase_by(). * + * @see f_file_stat_at() + * @see f_string_dynamics_increase_by() * @see fl_directory_list() */ #if !defined(_di_fl_directory_list_) - extern f_status_t private_fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) F_attribute_visibility_internal_d; + extern f_status_t private_fl_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) F_attribute_visibility_internal_d; #endif // !defined(_di_fl_directory_list_) /** @@ -187,9 +190,6 @@ extern "C" { * @param source * The path to append onto the destination. * This need not be NULL terminated. - * @param length - * The length of the string. - * Must not exceed length of source. * @param destination * The destination path to push the path part onto. * Any terminating NULLs at the end of the destination string are removed before appending. @@ -208,7 +208,7 @@ extern "C" { * @see fl_directory_path_push_dynamic() */ #if !defined(_di_fl_directory_path_push_) || !defined(_di_fl_directory_path_push_dynamic_) - extern f_status_t private_fl_directory_path_push(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) F_attribute_visibility_internal_d; + extern f_status_t private_fl_directory_path_push(const f_string_static_t source, f_string_dynamic_t *destination) F_attribute_visibility_internal_d; #endif // !defined(_di_fl_directory_path_push_) || !defined(_di_fl_directory_path_push_dynamic_) #ifdef __cplusplus diff --git a/level_1/fl_directory/data/build/settings b/level_1/fl_directory/data/build/settings index 20c6185..9b05218 100644 --- a/level_1/fl_directory/data/build/settings +++ b/level_1/fl_directory/data/build/settings @@ -30,7 +30,7 @@ build_sources_library_static build_sources_program build_sources_program_shared build_sources_program_static -build_sources_headers directory.h +build_sources_headers directory.h directory-common.h build_sources_headers_shared build_sources_headers_static build_sources_script diff --git a/level_1/fl_environment/c/environment.c b/level_1/fl_environment/c/environment.c index 702b5d9..fccd562 100644 --- a/level_1/fl_environment/c/environment.c +++ b/level_1/fl_environment/c/environment.c @@ -5,13 +5,12 @@ extern "C" { #endif #ifndef _di_fl_environment_load_name_ - f_status_t fl_environment_load_name(const f_string_t name, const f_array_length_t length, f_string_maps_t *environment) { + f_status_t fl_environment_load_name(const f_string_static_t name, f_string_maps_t *environment) { #ifndef _di_level_2_parameter_checking_ - if (!name) return F_status_set_error(F_parameter); if (!environment) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (!length) { + if (!name.used) { return F_data_not; } @@ -21,20 +20,12 @@ extern "C" { environment->array[environment->used].name.used = 0; environment->array[environment->used].value.used = 0; - const f_string_static_t name_string = macro_f_string_static_t_initialize(name, length); - - status = f_string_dynamic_append_nulless(name_string, &environment->array[environment->used].name); + status = f_string_dynamic_append_nulless(name, &environment->array[environment->used].name); if (F_status_is_error(status)) return status; - status = f_environment_get_dynamic(name_string, &environment->array[environment->used].value); - - if (F_status_is_error(status)) { - environment->array[environment->used].name.used = 0; - - return status; - } + status = f_environment_get(name, &environment->array[environment->used].value); - if (status == F_data_not || status == F_exist_not) { + if (F_status_is_error(status) || status == F_data_not || status == F_exist_not) { environment->array[environment->used].name.used = 0; return status; @@ -47,7 +38,7 @@ extern "C" { #endif // _di_fl_environment_load_name_ #ifndef _di_fl_environment_load_names_ - f_status_t fl_environment_load_names(const f_string_dynamics_t names, f_string_maps_t *environment) { + f_status_t fl_environment_load_names(const f_string_statics_t names, f_string_maps_t *environment) { #ifndef _di_level_2_parameter_checking_ if (!environment) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -67,7 +58,7 @@ extern "C" { status = f_string_dynamic_append_nulless(names.array[i], &environment->array[environment->used].name); if (F_status_is_error(status)) return status; - status = f_environment_get_dynamic(names.array[i], &environment->array[environment->used].value); + status = f_environment_get(names.array[i], &environment->array[environment->used].value); if (F_status_is_error(status)) { environment->array[environment->used].name.used = 0; @@ -89,87 +80,9 @@ extern "C" { #endif // _di_fl_environment_load_names_ #ifndef _di_fl_environment_path_explode_ - f_status_t fl_environment_path_explode(const f_string_t path, f_string_dynamics_t *paths) { - #ifndef _di_level_0_parameter_checking_ - if (!paths) return F_status_set_error(F_parameter); - if (paths->used > paths->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - f_status_t status = F_none; - const f_array_length_t length = strnlen(path, PATH_MAX); - - if (!length) { - - // When PATH is "", this is actually a valid search path for PWD. - // Append an equivalent representation of PWD (string used length is 0). - macro_f_memory_structure_increment(status, (*paths), 1, F_memory_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large); - if (F_status_is_error(status)) return status; - - macro_f_string_dynamic_t_clear(paths->array[paths->used]); - ++paths->used; - - return F_none; - } - - f_array_length_t i = length; - f_array_length_t first = 0; - f_array_length_t total = 0; - - for (i = 0; i <= length; ++i) { - - if (i == length || path[i] == f_path_separator_variable_s.string[0]) { - macro_f_memory_structure_increment(status, (*paths), 1, F_memory_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large); - if (F_status_is_error(status)) return status; - - if (!i) { - macro_f_string_dynamic_t_clear(paths->array[paths->used]); - ++paths->used; - - first = 1; - continue; - } - - f_string_dynamic_t part = f_string_dynamic_t_initialize; - - total = i - first; - - if (total > 0) { - if (path[i - 1] == f_path_separator_s.string[0]) { - macro_f_string_dynamic_t_clear(part) - macro_f_string_dynamic_t_resize(status, part, total) - if (F_status_is_error(status)) return status; - - part.used = total; - } - else { - macro_f_string_dynamic_t_resize(status, part, (total + 1)) - if (F_status_is_error(status)) return status; - - part.string[total] = f_path_separator_s.string[0]; - part.used = total + 1; - } - - memcpy(part.string, path + first, total); - } - - paths->array[paths->used].string = part.string; - paths->array[paths->used].used = part.used; - paths->array[paths->used++].size = part.size; - - first = i + 1; - } - } // for - - return F_none; - } -#endif // _di_fl_environment_path_explode_ - -#ifndef _di_fl_environment_path_explode_dynamic_ - f_status_t fl_environment_path_explode_dynamic(const f_string_static_t path, f_string_dynamics_t *paths) { + f_status_t fl_environment_path_explode(const f_string_static_t path, f_string_dynamics_t *paths) { #ifndef _di_level_0_parameter_checking_ - if (path.used > path.size) return F_status_set_error(F_parameter); if (!paths) return F_status_set_error(F_parameter); - if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ f_status_t status = F_none; @@ -178,175 +91,72 @@ extern "C" { // When PATH is "", this is actually a valid search path for PWD. // Therefore append an equivalent representation of PWD (string used length is 0). - macro_f_memory_structure_increment(status, (*paths), 1, F_memory_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large); + status = f_string_dynamics_increase(F_memory_default_allocation_small_d, paths); if (F_status_is_error(status)) return status; - macro_f_string_dynamic_t_clear(paths->array[paths->used]); - ++paths->used; + paths->array[paths->used++].used = 0; return F_none; } f_array_length_t i = 0; f_array_length_t j = 0; + f_array_length_t k = 0; f_array_length_t first = 0; f_array_length_t total = 0; - f_string_dynamic_t part = f_string_dynamic_t_initialize; - - for (i = 0; i <= path.used; ++i) { + for (; i <= path.used; ++i) { if (i == path.used || path.string[i] == f_path_separator_variable_s.string[0]) { - macro_f_memory_structure_increment(status, (*paths), 1, F_memory_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large); + status = f_string_dynamics_increase(F_memory_default_allocation_small_d, paths); if (F_status_is_error(status)) return status; if (!i) { - macro_f_string_dynamic_t_clear(paths->array[paths->used]); - ++paths->used; + paths->array[paths->used++].used = 0; first = 1; + continue; } total = i - first; + paths->array[paths->used].used = 0; - if (total > 0) { - macro_f_string_dynamic_t_clear(part) - macro_f_string_dynamic_t_resize(status, part, total) - if (F_status_is_error(status)) return status; + if (total) { + char buffer[total]; - for (j = 0; j < total; ++j) { + for (j = 0, k = 0; j < total; ++j) { if (!path.string[first + j]) continue; - part.string[part.used] = path.string[first + j]; - ++part.used; + buffer[k++] = path.string[first + j]; } // for - if (part.string[part.used - 1] != f_path_separator_s.string[0]) { - macro_f_string_dynamic_t_resize(status, part, (total + 1)) - if (F_status_is_error(status)) return status; - - part.string[part.used] = f_path_separator_s.string[0]; - ++part.used; - } - } - - paths->array[paths->used].string = part.string; - paths->array[paths->used].used = part.used; - paths->array[paths->used++].size = part.size; + buffer[k++] = f_path_separator_s.string[0]; - first = i + 1; - } - } // for - - return F_none; - } -#endif // _di_fl_environment_path_explode_dynamic_ - -#ifndef _di_fl_environment_path_explode_reverse_ - f_status_t fl_environment_path_explode_reverse(const f_string_t path, f_string_dynamics_t *paths) { - #ifndef _di_level_0_parameter_checking_ - if (!paths) return F_status_set_error(F_parameter); - if (paths->used > paths->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - f_status_t status = F_none; - const f_array_length_t length = strnlen(path, PATH_MAX); - - if (!length) { - - // When PATH is "", this is actually a valid search path for PWD. - // Therefore append an equivalent representation of PWD (string used length is 0). - macro_f_memory_structure_increment(status, (*paths), 1, F_memory_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large); - if (F_status_is_error(status)) return status; - - paths->array[paths->used].string = 0; - paths->array[paths->used].used = 0; - paths->array[paths->used++].size = 0; - - return F_none; - } - - f_array_length_t i = length; - f_array_length_t j = length; - f_array_length_t last = length; - f_array_length_t total = 0; - - f_string_dynamic_t part = f_string_dynamic_t_initialize; - - // @fixme i is unsgned, it will never be less than 0! - for (; i > 0; --i, --j) { - - if (!j || path[j] == f_path_separator_variable_s.string[0]) { - macro_f_memory_structure_increment(status, (*paths), 1, F_memory_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large); - if (F_status_is_error(status)) return status; - - if (path[j] == f_path_separator_variable_s.string[0]) { - total = last - i; - - if (total > 0) { - if (path[j + total] == f_path_separator_s.string[0]) { - macro_f_string_dynamic_t_clear(part) - macro_f_string_dynamic_t_resize(status, part, total) - if (F_status_is_error(status)) return status; - - part.used = total; - } - else { - macro_f_string_dynamic_t_resize(status, part, (total + 1)) - if (F_status_is_error(status)) return status; - - part.string[total] = f_path_separator_s.string[0]; - part.used = total + 1; - } + status = f_string_dynamic_increase_by(k, &paths->array[paths->used]); + if (F_status_is_error(status)) return status; - memcpy(part.string, path + i, total); - } + memcpy(paths->array[paths->used].string, buffer, k); - last = j; + paths->array[paths->used++].used = k; } - else if (!j) { - - // when j = 0, the total is actually the entire length to max. - total = last - j; - - if (total > 0) { - if (path[last - 1] == f_path_separator_s.string[0]) { - macro_f_string_dynamic_t_clear(part) - macro_f_string_dynamic_t_resize(status, part, total) - if (F_status_is_error(status)) return status; - - part.used = total; - } - else { - macro_f_string_dynamic_t_resize(status, part, (total + 1)) - if (F_status_is_error(status)) return status; - - part.used = total + 1; - part.string[total] = f_path_separator_s.string[0]; - } - - memcpy(part.string, path, total); - } + else { + ++paths->used; } - paths->array[paths->used].string = part.string; - paths->array[paths->used].used = part.used; - paths->array[paths->used++].size = part.size; + first = i + 1; } } // for return F_none; } -#endif // _di_fl_environment_path_explode_reverse_ +#endif // _di_fl_environment_path_explode_ -#ifndef _di_fl_environment_path_explode_reverse_dynamic_ - f_status_t fl_environment_path_explode_reverse_dynamic(const f_string_static_t path, f_string_dynamics_t *paths) { +#ifndef _di_fl_environment_path_explode_reverse_ + f_status_t fl_environment_path_explode_reverse(const f_string_static_t path, f_string_dynamics_t *paths) { #ifndef _di_level_0_parameter_checking_ - if (path.used > path.size) return F_status_set_error(F_parameter); if (!paths) return F_status_set_error(F_parameter); - if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ f_status_t status = F_none; @@ -355,91 +165,68 @@ extern "C" { // When PATH is "", this is actually a valid search path for PWD. // Therefore append an equivalent representation of PWD (string used length is 0). - macro_f_memory_structure_increment(status, (*paths), 1, F_memory_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large); + status = f_string_dynamics_increase(F_memory_default_allocation_small_d, paths); if (F_status_is_error(status)) return status; - macro_f_string_dynamic_t_clear(paths->array[paths->used]); - ++paths->used; + paths->array[paths->used++].used = 0; return F_none; } - f_array_length_t i = path.used; - f_array_length_t j = path.used; + f_array_length_t i = 0; + f_array_length_t j = 0; f_array_length_t k = 0; + f_array_length_t r = path.used; f_array_length_t last = path.used; f_array_length_t total = 0; - f_string_dynamic_t part = f_string_dynamic_t_initialize; + for (; i <= path.used; ++i, --r) { - // @fixme i is unsgned, it will never be less than 0! - for (; i > 0; --i, --j) { - - if (!j || path.string[j] == f_path_separator_variable_s.string[0]) { - macro_f_memory_structure_increment(status, (*paths), 1, F_memory_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large); + if (i == path.used || path.string[r] == f_path_separator_variable_s.string[0]) { + status = f_string_dynamics_increase(F_memory_default_allocation_small_d, paths); if (F_status_is_error(status)) return status; - if (path.string[j] == f_path_separator_variable_s.string[0]) { - total = last - i; + if (!i) { + paths->array[paths->used++].used = 0; - if (total > 0) { - macro_f_string_dynamic_t_clear(part) - macro_f_string_dynamic_t_resize(status, part, total) - if (F_status_is_error(status)) return status; + last = r - 1; - for (k = 0; k < total; ++k) { + continue; + } - if (!path.string[i + k]) continue; + total = last - r; + paths->array[paths->used].used = 0; - part.string[part.used] = path.string[i + k]; - ++part.used; - } // for + if (total) { + char buffer[total]; - if (part.string[part.used - 1] != f_path_separator_s.string[0]) { - macro_f_string_dynamic_t_resize(status, part, (total + 1)) - if (F_status_is_error(status)) return status; + for (j = 0, k = 0; j < total; ++j) { - part.string[part.used] = f_path_separator_s.string[0]; - ++part.used; - } - } + if (!path.string[r + j + 1]) continue; - last = j; - } - else if (!j) { + buffer[k++] = path.string[r + j + 1]; + } // for - // when j = 0, the total is actually the entire length to max. - total = last - j; + buffer[k++] = f_path_separator_s.string[0]; - macro_f_string_dynamic_t_clear(part) - macro_f_string_dynamic_t_resize(status, part, total) + status = f_string_dynamic_increase_by(k, &paths->array[paths->used]); if (F_status_is_error(status)) return status; - for (k = 0; k < total; ++k) { - if (!path.string[i + k]) continue; - - part.string[part.used] = path.string[i + k]; - ++part.used; - } // for - - if (part.string[part.used - 1] != f_path_separator_s.string[0]) { - macro_f_string_dynamic_t_resize(status, part, (total + 1)) - if (F_status_is_error(status)) return status; + memcpy(paths->array[paths->used].string, buffer, k); - part.string[part.used - 1] = f_path_separator_s.string[0]; - ++part.used; - } + paths->array[paths->used++].used = k; + } + else { + ++paths->used; } - paths->array[paths->used].string = part.string; - paths->array[paths->used].used = part.used; - paths->array[paths->used++].size = part.size; + last = r - 1; } } // for return F_none; } -#endif // _di_fl_environment_path_explode_reverse_dynamic_ +#endif // _di_fl_environment_path_explode_reverse_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_environment/c/environment.h b/level_1/fl_environment/c/environment.h index 834de9c..039b1a5 100644 --- a/level_1/fl_environment/c/environment.h +++ b/level_1/fl_environment/c/environment.h @@ -35,26 +35,24 @@ extern "C" { * * @param name * A string representing the environment variable name. - * @param length - * The length of the environment variable name string. * @param environment * An array of maps generated from the loaded environment variable names. * * @return * F_none on success. - * F_data_not if name length is 0. + * F_data_not if names.used is 0. * F_exist_not if name does not exist. * - * Errors (with error bit) from: f_environment_get_dynamic(). + * Errors (with error bit) from: f_environment_get(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). * Errors (with error bit) from: f_string_maps_increase_by(). * - * @see f_environment_get_dynamic() + * @see f_environment_get() * @see f_string_dynamic_append_nulless() * @see f_string_maps_increase_by() */ #ifndef _di_fl_environment_load_name_ - extern f_status_t fl_environment_load_name(const f_string_t name, const f_array_length_t length, f_string_maps_t *environment); + extern f_status_t fl_environment_load_name(const f_string_static_t name, f_string_maps_t *environment); #endif // _di_fl_environment_load_name_ /** @@ -75,16 +73,16 @@ extern "C" { * F_none on success. * F_data_not if names.used is 0. * - * Errors (with error bit) from: f_environment_get_dynamic(). + * Errors (with error bit) from: f_environment_get(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). * Errors (with error bit) from: f_string_maps_increase_by(). * - * @see f_environment_get_dynamic() + * @see f_environment_get() * @see f_string_dynamic_append_nulless() * @see f_string_maps_increase_by() */ #ifndef _di_fl_environment_load_names_ - extern f_status_t fl_environment_load_names(const f_string_dynamics_t names, f_string_maps_t *environment); + extern f_status_t fl_environment_load_names(const f_string_statics_t names, f_string_maps_t *environment); #endif // _di_fl_environment_load_names_ /** @@ -93,30 +91,6 @@ extern "C" { * @param path * The string to process that is expected to follow the traditional Linux standard PATH environment variable. * Each seperate path is separated by a single ':'. - * Must not contain NULLs except for the terminating NULL. - * Must be NULL terminated. - * @param paths - * All of the strings exploded from PATH. - * Each exploded path, when not empty, is guaranteed to have a trailing '/'. - * Each exploded path is not NULL terminated. - * - * @return - * F_none on success. - * - * F_array_too_large (with error bit) if paths array is too large for further addressing. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_environment_path_explode_ - extern f_status_t fl_environment_path_explode(const f_string_t path, f_string_dynamics_t *paths); -#endif // _di_fl_environment_path_explode_ - -/** - * Separate a given PATH-style string into multiple separate paths. - * - * @param path - * The string to process that is expected to follow the traditional Linux standard PATH environment variable. - * Each seperate path is separated by a single ':'. * Need not be NULL terminated. * NULLs are ignored and are not copied into the exploded paths. * @param paths @@ -130,36 +104,16 @@ extern "C" { * F_array_too_large (with error bit) if paths array is too large for further addressing. * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_environment_path_explode_dynamic_ - extern f_status_t fl_environment_path_explode_dynamic(const f_string_static_t path, f_string_dynamics_t *paths); -#endif // _di_fl_environment_path_explode_dynamic_ - -/** - * Separate a given PATH-style string into multiple separate paths. - * - * The paths are created in reverse order. - * - * @param path - * The string to process that is expected to follow the traditional Linux standard PATH environment variable. - * Each seperate path is separated by a single ':'. - * Must not contain NULLs except for the terminating NULL. - * Must be NULL terminated. - * @param paths - * All of the strings exploded from PATH. - * Each exploded path, when not empty, is guaranteed to have a trailing '/'. - * Each exploded path is not NULL terminated. * - * @return - * F_none on success. + * Errors (with error bit) from: f_string_dynamics_increase(). + * Errors (with error bit) from: f_string_dynamics_increase_by(). * - * F_array_too_large (with error bit) if paths array is too large for further addressing. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. + * @see f_string_dynamics_increase() + * @see f_string_dynamics_increase_by() */ -#ifndef _di_fl_environment_path_explode_reverse_ - extern f_status_t fl_environment_path_explode_reverse(const f_string_t path, f_string_dynamics_t *paths); -#endif // _di_fl_environment_path_explode_reverse_ +#ifndef _di_fl_environment_path_explode_ + extern f_status_t fl_environment_path_explode(const f_string_static_t path, f_string_dynamics_t *paths); +#endif // _di_fl_environment_path_explode_ /** * Separate a given PATH-style string into multiple separate paths. @@ -182,10 +136,16 @@ extern "C" { * F_array_too_large (with error bit) if paths array is too large for further addressing. * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_string_dynamics_increase(). + * Errors (with error bit) from: f_string_dynamics_increase_by(). + * + * @see f_string_dynamics_increase() + * @see f_string_dynamics_increase_by() */ -#ifndef _di_fl_environment_path_explode_reverse_dynamic_ - extern f_status_t fl_environment_path_explode_reverse_dynamic(const f_string_static_t path, f_string_dynamics_t *paths); -#endif // _di_fl_environment_path_explode_reverse_dynamic_ +#ifndef _di_fl_environment_path_explode_reverse_ + extern f_status_t fl_environment_path_explode_reverse(const f_string_static_t path, f_string_dynamics_t *paths); +#endif // _di_fl_environment_path_explode_reverse_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_print/c/print-common.c b/level_1/fl_print/c/print-common.c index 3a7a5f2..1cc329b 100644 --- a/level_1/fl_print/c/print-common.c +++ b/level_1/fl_print/c/print-common.c @@ -6,9 +6,9 @@ extern "C" { #endif #ifndef _di_fl_print_t_ - const f_string_static_t fl_print_debug_s = macro_f_string_static_t_initialize2(FL_print_debug_s, 0, FL_print_debug_s_length); - const f_string_static_t fl_print_error_s = macro_f_string_static_t_initialize2(FL_print_error_s, 0, FL_print_error_s_length); - const f_string_static_t fl_print_warning_s = macro_f_string_static_t_initialize2(FL_print_warning_s, 0, FL_print_warning_s_length); + const f_string_static_t fl_print_debug_s = macro_f_string_static_t_initialize(FL_print_debug_s, 0, FL_print_debug_s_length); + const f_string_static_t fl_print_error_s = macro_f_string_static_t_initialize(FL_print_error_s, 0, FL_print_error_s_length); + const f_string_static_t fl_print_warning_s = macro_f_string_static_t_initialize(FL_print_warning_s, 0, FL_print_warning_s_length); #endif // _di_fl_print_t_ #ifdef __cplusplus diff --git a/level_2/fll_control_group/c/control_group.c b/level_2/fll_control_group/c/control_group.c index 8a5c052..65e1baa 100644 --- a/level_2/fll_control_group/c/control_group.c +++ b/level_2/fll_control_group/c/control_group.c @@ -9,7 +9,7 @@ extern "C" { f_status_t status = F_none; if (control_group.path.used) { - status = f_directory_exists(control_group.path.string); + status = f_directory_exists(control_group.path); if (F_status_is_error(status)) return status; if (status == F_false) { @@ -17,30 +17,29 @@ extern "C" { } } - f_array_length_t length = 0; + f_string_static_t path = f_string_static_t_initialize; for (f_array_length_t i = 0; i < control_group.groups.used; ++i) { if (!control_group.groups.array[i].used) continue; - length = control_group.path.used + control_group.groups.array[i].used; + path.used = control_group.path.used + control_group.groups.array[i].used; - char path[length + 1]; + char path_string[path.used + 1]; + path.string = path_string; if (control_group.path.used) { - memcpy(path, control_group.path.string, control_group.path.used); + memcpy(path.string, control_group.path.string, control_group.path.used); } - memcpy(path + control_group.path.used, control_group.groups.array[i].string, control_group.groups.array[i].used); - path[length] = 0; + memcpy(path.string + control_group.path.used, control_group.groups.array[i].string, control_group.groups.array[i].used); + path.string[path.used] = 0; - status = fl_directory_create(path, length, F_file_mode_all_rwx_d); + status = fl_directory_create(path, F_file_mode_all_rwx_d); if (F_status_is_error(status)) break; } // for - if (F_status_is_error(status)) { - return status; - } + if (F_status_is_error(status)) return status; return F_none; } diff --git a/level_2/fll_error/c/error-common.c b/level_2/fll_error/c/error-common.c index 5504b0a..14735df 100644 --- a/level_2/fll_error/c/error-common.c +++ b/level_2/fll_error/c/error-common.c @@ -6,10 +6,11 @@ extern "C" { #endif #ifndef _di_fll_error_file_type_ - const f_string_static_t fll_error_file_type_directory_s = macro_f_string_static_t_initialize2(FLL_error_file_type_directory_s, 0, FLL_error_file_type_directory_s_length); - const f_string_static_t fll_error_file_type_file_s = macro_f_string_static_t_initialize2(FLL_error_file_type_file_s, 0, FLL_error_file_type_file_s_length); - const f_string_static_t fll_error_file_type_path_s = macro_f_string_static_t_initialize2(FLL_error_file_type_path_s, 0, FLL_error_file_type_path_s_length); - const f_string_static_t fll_error_file_type_pipe_s = macro_f_string_static_t_initialize2(FLL_error_file_type_pipe_s, 0, FLL_error_file_type_pipe_s_length); + const f_string_static_t fll_error_file_type_directory_s = macro_f_string_static_t_initialize(FLL_error_file_type_directory_s, 0, FLL_error_file_type_directory_s_length); + const f_string_static_t fll_error_file_type_file_s = macro_f_string_static_t_initialize(FLL_error_file_type_file_s, 0, FLL_error_file_type_file_s_length); + const f_string_static_t fll_error_file_type_path_s = macro_f_string_static_t_initialize(FLL_error_file_type_path_s, 0, FLL_error_file_type_path_s_length); + const f_string_static_t fll_error_file_type_pipe_s = macro_f_string_static_t_initialize(FLL_error_file_type_pipe_s, 0, FLL_error_file_type_pipe_s_length); + const f_string_static_t fll_error_file_type_socket_s = macro_f_string_static_t_initialize(FLL_error_file_type_socket_s, 0, FLL_error_file_type_socket_s_length); #endif // _di_fll_error_file_type_ #ifdef __cplusplus diff --git a/level_2/fll_error/c/error-common.h b/level_2/fll_error/c/error-common.h index 8a7ce20..048135d 100644 --- a/level_2/fll_error/c/error-common.h +++ b/level_2/fll_error/c/error-common.h @@ -24,6 +24,7 @@ extern "C" { * - directory: Directory error. * - path: Path error. * - pipe: Pipe error. + * - socket: Socket error. */ #ifndef _di_fll_error_file_type_ enum { @@ -31,22 +32,26 @@ extern "C" { fll_error_file_type_directory_e, fll_error_file_type_path_e, fll_error_file_type_pipe_e, + fll_error_file_type_socket_e, }; #define FLL_error_file_type_directory_s "directory" #define FLL_error_file_type_file_s "file" #define FLL_error_file_type_path_s "path" #define FLL_error_file_type_pipe_s "pipe" + #define FLL_error_file_type_socket_s "socket" #define FLL_error_file_type_directory_s_length 9 #define FLL_error_file_type_file_s_length 4 #define FLL_error_file_type_path_s_length 4 #define FLL_error_file_type_pipe_s_length 4 + #define FLL_error_file_type_socket_s_length 6 extern const f_string_static_t fll_error_file_type_directory_s; extern const f_string_static_t fll_error_file_type_file_s; extern const f_string_static_t fll_error_file_type_path_s; extern const f_string_static_t fll_error_file_type_pipe_s; + extern const f_string_static_t fll_error_file_type_socket_s; #endif // _di_fll_error_file_type_ #ifdef __cplusplus diff --git a/level_2/fll_error/c/error.c b/level_2/fll_error/c/error.c index bf9f697..96d8344 100644 --- a/level_2/fll_error/c/error.c +++ b/level_2/fll_error/c/error.c @@ -13,26 +13,29 @@ extern "C" { #endif // _di_fll_error_print_ #ifndef _di_fll_error_file_print_ - f_status_t fll_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type) { + f_status_t fll_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { - const char *type_name = FLL_error_file_type_file_s; + f_string_static_t type_name = fll_error_file_type_file_s; if (type == fll_error_file_type_directory_e) { - type_name = FLL_error_file_type_directory_s; + type_name = fll_error_file_type_directory_s; } else if (type == fll_error_file_type_path_e) { - type_name = FLL_error_file_type_path_s; + type_name = fll_error_file_type_path_s; } else if (type == fll_error_file_type_pipe_e) { - type_name = FLL_error_file_type_pipe_s; + type_name = fll_error_file_type_pipe_s; + } + else if (type == fll_error_file_type_socket_e) { + type_name = fll_error_file_type_socket_s; } if (status == F_access_denied) { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QAccess denied while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QAccess denied while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -45,8 +48,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QCurrent user is not allowed to use the given group while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QCurrent user is not allowed to use the given group while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -59,8 +62,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QCurrent user is not allowed to use the given owner while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QCurrent user is not allowed to use the given owner while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -73,8 +76,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QInvalid directory while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QInvalid directory while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -87,8 +90,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', not empty.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -101,8 +104,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QFailed to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QFailed to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -115,8 +118,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', failed to close.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -129,8 +132,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', is closed.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -143,8 +146,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QFile descriptor error while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QFile descriptor error while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -157,8 +160,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QMax file descriptors reached while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QMax file descriptors reached while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -171,8 +174,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QInvalid file descriptor while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QInvalid file descriptor while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -185,9 +188,9 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); - fl_print_format("%[', %s is empty.%]%q", print.to.stream, print.context, type_name, print.context, f_string_eol_s); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%[', %Q is empty.%]%q", print.to.stream, print.context, type_name, print.context, f_string_eol_s); funlockfile(print.to.stream); } @@ -199,8 +202,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', flush failed.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -213,8 +216,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', found.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -227,8 +230,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', could not find.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -241,8 +244,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', already open.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -255,8 +258,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QMax open files reached while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QMax open files reached while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -269,8 +272,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QOverflow while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QOverflow while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -283,8 +286,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', purge failed.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -297,8 +300,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QRead failed while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QRead failed while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -311,8 +314,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QSeek failed while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QSeek failed while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -325,8 +328,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QStat failed while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QStat failed while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -339,8 +342,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QSynchronize failed while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QSynchronize failed while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -353,8 +356,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QFailed to %S %S, the path '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QFailed to %Q %Q, the path '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[' is an unknown file type.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -367,8 +370,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUTF failure while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUTF failure while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -381,8 +384,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QInvalid UTF while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QInvalid UTF while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -395,8 +398,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnderflow while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QUnderflow while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -409,8 +412,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QFailed to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QFailed to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[', write failure.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -423,8 +426,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QLoop while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QLoop while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -437,8 +440,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QInvalid %S name '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QInvalid %Q name '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -451,8 +454,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QNumber overflow while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QNumber overflow while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -465,8 +468,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QNumber underflow while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QNumber underflow while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -483,8 +486,8 @@ extern "C" { private_fll_error_print_function(print, function); - fl_print_format(" for the %S '%]", print.to.stream, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format(" for the %Q '%]", print.to.stream, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -497,8 +500,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QProhibited by system while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QProhibited by system while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -511,9 +514,9 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); - fl_print_format("%[', %S is read only.%]%q", print.to.stream, print.context, type_name, print.context, f_string_eol_s); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%[', %Q is read only.%]%q", print.to.stream, print.context, type_name, print.context, f_string_eol_s); funlockfile(print.to.stream); } @@ -525,9 +528,9 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QUnable to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); - fl_print_format("%[', %S is write only.%]%q", print.to.stream, print.context, type_name, print.context, f_string_eol_s); + fl_print_format("%q%[%QUnable to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%[', %Q is write only.%]%q", print.to.stream, print.context, type_name, print.context, f_string_eol_s); funlockfile(print.to.stream); } @@ -540,8 +543,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QInvalid or missing directory in path while trying to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QInvalid or missing directory in path while trying to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -554,8 +557,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QFailed to %S %S, the path '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QFailed to %Q %Q, the path '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[' is a directory.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -569,8 +572,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QFailed to %S %S, the path '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QFailed to %Q %Q, the path '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[' is a file.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -585,8 +588,8 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QFailed to %S %S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%q%[%QFailed to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); fl_print_format("%[' due to an invalid directory in the path.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -599,9 +602,9 @@ extern "C" { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); - fl_print_format("%q%[%QFailed to %S %S, the path '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, name, print.notable); - fl_print_format("%[' is a %s.%]%q", print.to.stream, print.context, status == F_file_type_pipe ? "pipe" : "socket", print.context, f_string_eol_s); + fl_print_format("%q%[%QFailed to %Q %Q, the path '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context); + fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable); + fl_print_format("%[' is a %Q.%]%q", print.to.stream, print.context, status == F_file_type_pipe ? fll_error_file_type_pipe_s : fll_error_file_type_socket_s, print.context, f_string_eol_s); funlockfile(print.to.stream); } @@ -615,14 +618,14 @@ extern "C" { #endif // _di_fll_error_file_print_ #ifndef _di_fll_error_parameter_integer_print_ - f_status_t fll_error_parameter_integer_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument) { + f_status_t fll_error_parameter_integer_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_static_t parameter, const f_string_static_t argument) { if (status == F_data_not) { if (print.verbosity != f_console_verbosity_quiet_e) { flockfile(print.to.stream); fl_print_format("%q%[%QThe argument for the parameter '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, parameter, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, parameter, print.notable); fl_print_format("%[' must not be an empty string.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -636,9 +639,9 @@ extern "C" { flockfile(print.to.stream); fl_print_format("%q%[%QThe argument '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, argument, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, argument, print.notable); fl_print_format("%[' is not a valid number for the parameter '%]", print.to.stream, print.context, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, parameter, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, parameter, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -652,9 +655,9 @@ extern "C" { flockfile(print.to.stream); fl_print_format("%q%[%QThe argument '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, argument, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, argument, print.notable); fl_print_format("%[' is negative, which is not allowed for the parameter '%]", print.to.stream, print.context, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, parameter, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, parameter, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -668,9 +671,9 @@ extern "C" { flockfile(print.to.stream); fl_print_format("%q%[%QThe argument '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, argument, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, argument, print.notable); fl_print_format("%[' is too large for the parameter '%]", print.to.stream, print.context, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, parameter, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, parameter, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -684,9 +687,9 @@ extern "C" { flockfile(print.to.stream); fl_print_format("%q%[%QThe argument '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, argument, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, argument, print.notable); fl_print_format("%[' is positive, which is not allowed for the parameter '%]", print.to.stream, print.context, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, parameter, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, parameter, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); @@ -700,9 +703,9 @@ extern "C" { flockfile(print.to.stream); fl_print_format("%q%[%QThe argument '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, argument, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, argument, print.notable); fl_print_format("%[' is too small for the parameter '%]", print.to.stream, print.context, print.context); - fl_print_format("%[%S%]", print.to.stream, print.notable, parameter, print.notable); + fl_print_format("%[%Q%]", print.to.stream, print.notable, parameter, print.notable); fl_print_format("%['.%]%q", print.to.stream, print.context, print.context, f_string_eol_s); funlockfile(print.to.stream); diff --git a/level_2/fll_error/c/error.h b/level_2/fll_error/c/error.h index c3426d9..5f74d51 100644 --- a/level_2/fll_error/c/error.h +++ b/level_2/fll_error/c/error.h @@ -81,7 +81,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_fll_error_file_print_ - extern f_status_t fll_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type); + extern f_status_t fll_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); #endif // _di_fll_error_file_print_ /** @@ -107,7 +107,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_fll_error_parameter_integer_print_ - extern f_status_t fll_error_parameter_integer_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument); + extern f_status_t fll_error_parameter_integer_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_static_t parameter, const f_string_static_t argument); #endif // _di_fll_error_parameter_integer_print_ #ifdef __cplusplus diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 3e5c713..9eac775 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -6,12 +6,12 @@ extern "C" { #endif #ifndef _di_fll_execute_arguments_add_ - f_status_t fll_execute_arguments_add(const f_string_t source, const f_array_length_t length, f_string_dynamics_t *arguments) { + f_status_t fll_execute_arguments_add(const f_string_static_t source, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (!arguments) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - const f_status_t status = private_fll_execute_arguments_add(source, length, arguments); + const f_status_t status = private_fll_execute_arguments_add(source, arguments); if (F_status_is_error(status)) return status; return F_none; @@ -19,12 +19,12 @@ extern "C" { #endif // _di_fll_execute_arguments_add_ #ifndef _di_fll_execute_arguments_add_parameter_ - f_status_t fll_execute_arguments_add_parameter(const f_string_t prefix, const f_array_length_t prefix_length, const f_string_t name, const f_array_length_t name_length, const f_string_t value, const f_array_length_t value_length, f_string_dynamics_t *arguments) { + f_status_t fll_execute_arguments_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (!arguments) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - const f_status_t status = private_fll_execute_arguments_add_parameter(prefix, prefix_length, name, name_length, value, value_length, arguments); + const f_status_t status = private_fll_execute_arguments_add_parameter(prefix, name, value, arguments); if (F_status_is_error(status)) return status; return F_none; @@ -32,7 +32,7 @@ extern "C" { #endif // _di_fll_execute_arguments_add_parameter_ #ifndef _di_fll_execute_arguments_add_parameter_set_ - f_status_t fll_execute_arguments_add_parameter_set(const f_string_t prefix[], const f_array_length_t prefix_length[], const f_string_t name[], const f_array_length_t name_length[], const f_string_t value[], const f_array_length_t value_length[], const f_array_length_t size, f_string_dynamics_t *arguments) { + f_status_t fll_execute_arguments_add_parameter_set(const f_string_static_t prefix[], const f_string_static_t name[], const f_string_static_t value[], const f_array_length_t size, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (!arguments) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -41,7 +41,7 @@ extern "C" { for (f_array_length_t i = 0; i < size; ++i) { - status = private_fll_execute_arguments_add_parameter(prefix[i], prefix_length[i], name[i], name_length[i], value[i], value_length[i], arguments); + status = private_fll_execute_arguments_add_parameter(prefix[i], name[i], value[i], arguments); if (F_status_is_error(status)) return status; } // for @@ -50,7 +50,7 @@ extern "C" { #endif // _di_fll_execute_arguments_add_parameter_set_ #ifndef _di_fll_execute_arguments_add_set_ - f_status_t fll_execute_arguments_add_set(const f_string_t source[], const f_array_length_t length[], const f_array_length_t size, f_string_dynamics_t *arguments) { + f_status_t fll_execute_arguments_add_set(const f_string_static_t source[], const f_array_length_t size, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (!arguments) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -59,7 +59,7 @@ extern "C" { for (f_array_length_t i = 0; i < size; ++i) { - status = private_fll_execute_arguments_add(source[i], length[i], arguments); + status = private_fll_execute_arguments_add(source[i], arguments); if (F_status_is_error(status)) return status; } // for @@ -67,84 +67,30 @@ extern "C" { } #endif // _di_fll_execute_arguments_add_set_ -#ifndef _di_fll_execute_arguments_dynamic_add_ - f_status_t fll_execute_arguments_dynamic_add(const f_string_static_t source, f_string_dynamics_t *arguments) { - #ifndef _di_level_2_parameter_checking_ - if (!arguments) return F_status_set_error(F_parameter); - #endif // _di_level_2_parameter_checking_ - - const f_status_t status = private_fll_execute_arguments_add(source.string, source.used, arguments); - if (F_status_is_error(status)) return status; - - return F_none; - } -#endif // _di_fll_execute_arguments_dynamic_add_ - -#ifndef _di_fll_execute_arguments_dynamic_add_parameter_ - f_status_t fll_execute_arguments_dynamic_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments) { - #ifndef _di_level_2_parameter_checking_ - if (!arguments) return F_status_set_error(F_parameter); - #endif // _di_level_2_parameter_checking_ - - const f_status_t status = private_fll_execute_arguments_add_parameter(prefix.string, prefix.used, name.string, name.used, value.string, value.used, arguments); - if (F_status_is_error(status)) return status; - - return F_none; - } -#endif // _di_fll_execute_arguments_dynamic_add_parameter_ - -#ifndef _di_fll_execute_arguments_dynamic_add_parameter_set_ - f_status_t fll_execute_arguments_dynamic_add_parameter_set(const f_string_static_t prefix[], const f_string_static_t name[], const f_string_static_t value[], const f_array_length_t size, f_string_dynamics_t *arguments) { - #ifndef _di_level_2_parameter_checking_ - if (!arguments) return F_status_set_error(F_parameter); - #endif // _di_level_2_parameter_checking_ - - f_status_t status = F_none; - - for (f_array_length_t i = 0; i < size; ++i) { - - status = private_fll_execute_arguments_add_parameter(prefix[i].string, prefix[i].used, name[i].string, name[i].used, value[i].string, value[i].used, arguments); - if (F_status_is_error(status)) return status; - } // for - - return status; - } -#endif // _di_fll_execute_arguments_dynamic_add_parameter_set_ - -#ifndef _di_fll_execute_arguments_dynamic_add_set_ - f_status_t fll_execute_arguments_dynamic_add_set(const f_string_static_t source[], const f_array_length_t size, f_string_dynamics_t *arguments) { - #ifndef _di_level_2_parameter_checking_ - if (!arguments) return F_status_set_error(F_parameter); - #endif // _di_level_2_parameter_checking_ - - f_status_t status = F_none; - - for (f_array_length_t i = 0; i < size; ++i) { - - status = private_fll_execute_arguments_add(source[i].string, source[i].used, arguments); - if (F_status_is_error(status)) return status; - } // for - - return status; - } -#endif // _di_fll_execute_arguments_dynamic_add_set_ - #ifndef _di_fll_execute_into_ - f_status_t fll_execute_into(const f_string_t program, const f_string_statics_t arguments, const uint8_t option, const f_string_maps_t *environment, int *result) { + f_status_t fll_execute_into(const f_string_static_t program, const f_string_statics_t arguments, const uint8_t option, const f_string_maps_t *environment, int *result) { #ifndef _di_level_2_parameter_checking_ - if (!program && !arguments.used) return F_status_set_error(F_parameter); + if (!program.used && !arguments.used) return F_status_set_error(F_parameter); if (!result) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - // create a string array that is compatible with execv() calls. + // Create a string array that is compatible with execv() calls. f_string_t fixed_arguments[arguments.used + 2]; + f_string_static_t program_name = f_string_static_t_initialize; - const f_string_t last_slash = strrchr(program ? program : arguments.array[0].string, f_path_separator_s.string[0]); - const f_array_length_t size_name = last_slash ? strnlen(last_slash + 1, F_path_length_max_d) : strnlen(program ? program : arguments.array[0].string, F_path_length_max_d); + const f_string_t last_slash = strrchr(program.used ? program.string : arguments.array[0].string, f_path_separator_s.string[0]); - char program_name[size_name + 1]; + if (last_slash) { + program_name.used = strnlen(last_slash + 1, F_path_length_max_d); + } + else { + program_name.used = program.used ? program.used : arguments.array[0].used; + } - private_fll_execute_path_arguments_fixate(program ? program : arguments.array[0].string, arguments, last_slash, !program, size_name, program_name, fixed_arguments); + char program_name_string[program_name.used + 1]; + program_name.string = program_name_string; + + private_fll_execute_path_arguments_fixate(program.used ? program : arguments.array[0], arguments, last_slash, !program.used, program_name, fixed_arguments); int code = 0; @@ -152,7 +98,7 @@ extern "C" { setsid(); } - // full path is explicitly requested. + // Full path is explicitly requested. if (option & FL_execute_parameter_option_path_d) { f_string_dynamic_t path = f_string_dynamic_t_initialize; f_string_dynamics_t paths = f_string_dynamics_t_initialize; @@ -161,30 +107,28 @@ extern "C" { f_status_t status = F_none; if (last_slash) { - status = f_file_exists(program ? program : arguments.array[0].string); + status = f_file_exists(program.used ? program : arguments.array[0]); if (status != F_true) { - f_string_dynamics_resize(0, &paths); - return F_status_set_error(F_file_found_not); } - path.string = program ? program : arguments.array[0].string; - path.used = strnlen(program ? program : arguments.array[0].string, F_path_length_max_d); + path.string = program.used ? program.string : arguments.array[0].string; + path.used = program.used ? program.used : arguments.array[0].used; found = &path; } else { - status = f_environment_get(f_path_environment_s.string, &path); + status = f_environment_get(f_path_environment_s, &path); if (F_status_is_error(status)) { - // Do not consider PATH is not available (or valid?) to be an error. + // Do not consider PATH is not available (or not valid?) to be an error. if (F_status_set_fine(status) == F_valid_not || F_status_set_fine(status) == F_failure) { status = F_none; } } else { - status = fl_environment_path_explode_dynamic(path, &paths); + status = fl_environment_path_explode(path, &paths); } f_string_dynamic_resize(0, &path); @@ -195,16 +139,17 @@ extern "C" { return status; } + // Search each individual path in PATH until a match is found. for (f_array_length_t i = 0; i < paths.used; ++i) { - status = f_string_append(program_name, size_name, &paths.array[i]); + status = f_string_dynamic_append(program_name, &paths.array[i]); if (F_status_is_error_not(status)) { status = f_string_dynamic_terminate_after(&paths.array[i]); } if (F_status_is_error_not(status)) { - status = f_file_exists(paths.array[i].string); + status = f_file_exists(paths.array[i]); if (status == F_true) { found = &paths.array[i]; @@ -215,7 +160,7 @@ extern "C" { if (F_status_is_error(status)) { status = F_status_set_fine(status); - // don't consider bad/non-accessible paths an error, just ignore them. + // Don't consider bad/non-accessible paths an error, just ignore them. if (status == F_name) { continue; } @@ -255,7 +200,7 @@ extern "C" { clearenv(); for (f_array_length_t i = 0; i < environment->used; ++i) { - f_environment_set_dynamic(environment->array[i].name, environment->array[i].value, F_true); + f_environment_set(environment->array[i].name, environment->array[i].value, F_true); } // for } @@ -266,14 +211,19 @@ extern "C" { clearenv(); for (f_array_length_t i = 0; i < environment->used; ++i) { - f_environment_set_dynamic(environment->array[i].name, environment->array[i].value, F_true); + f_environment_set(environment->array[i].name, environment->array[i].value, F_true); } // for } - code = last_slash ? execv(program ? program : arguments.array[0].string, fixed_arguments) : execvp(program ? program : arguments.array[0].string, fixed_arguments); + if (last_slash) { + code = execv(program.used ? program.string : arguments.array[0].string, fixed_arguments); + } + else { + code = execvp(program.used ? program.string : arguments.array[0].string, fixed_arguments); + } } - // generally this does not return, but in some cases (such as with scripts) this does return so handle the results. + // Generally this does not return, but in some cases (such as with scripts) this does return so handle the results. if (code < 0) { if (errno == EACCES) code = F_execute_access; else if (errno == E2BIG) code = F_execute_too_large; @@ -318,23 +268,32 @@ extern "C" { #endif // _di_fll_execute_into_ #ifndef _di_fll_execute_program_ - f_status_t fll_execute_program(const f_string_t program, const f_string_statics_t arguments, fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) { + f_status_t fll_execute_program(const f_string_static_t program, const f_string_statics_t arguments, fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) { #ifndef _di_level_2_parameter_checking_ - if (!program && !arguments.used) return F_status_set_error(F_parameter); + if (!program.used && !arguments.used) return F_status_set_error(F_parameter); if (!result) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - // create a string array that is compatible with execv() calls. + // Create a string array that is compatible with execv() calls. f_string_t fixed_arguments[arguments.used + 2]; - const f_string_t last_slash = strrchr(program ? program : arguments.array[0].string, f_path_separator_s.string[0]); - const f_array_length_t size_name = last_slash ? strnlen(last_slash + 1, F_path_length_max_d) : strnlen(program ? program : arguments.array[0].string, F_path_length_max_d); + f_string_static_t program_name = f_string_static_t_initialize; - char program_name[size_name + 1]; + const f_string_t last_slash = strrchr(program.used ? program.string : arguments.array[0].string, f_path_separator_s.string[0]); - private_fll_execute_path_arguments_fixate(program ? program : arguments.array[0].string, arguments, last_slash, !program, size_name, program_name, fixed_arguments); + if (last_slash) { + program_name.used = strnlen(last_slash + 1, F_path_length_max_d); + } + else { + program_name.used = program.used ? program.used : arguments.array[0].used; + } - // determine full path when the environment is to be cleared or full path is explicitly requested. + char program_name_string[program_name.used + 1]; + program_name.string = program_name_string; + + private_fll_execute_path_arguments_fixate(program.used ? program : arguments.array[0], arguments, last_slash, !program.used, program_name, fixed_arguments); + + // Determine full path when the environment is to be cleared or full path is explicitly requested. if (parameter && parameter->environment || parameter && (parameter->option & FL_execute_parameter_option_path_d)) { f_string_dynamic_t path = f_string_dynamic_t_initialize; f_string_dynamics_t paths = f_string_dynamics_t_initialize; @@ -343,7 +302,7 @@ extern "C" { f_status_t status = F_none; if (last_slash) { - status = f_file_exists(program ? program : arguments.array[0].string); + status = f_file_exists(program.used ? program : arguments.array[0]); if (status != F_true) { f_string_dynamics_resize(0, &paths); @@ -351,22 +310,22 @@ extern "C" { return F_status_set_error(F_file_found_not); } - path.string = program ? program : arguments.array[0].string; - path.used = strnlen(program ? program : arguments.array[0].string, F_path_length_max_d); + path.string = program.used ? program.string : arguments.array[0].string; + path.used = program.used ? program.used : arguments.array[0].used; found = &path; } else { - status = f_environment_get(f_path_environment_s.string, &path); + status = f_environment_get(f_path_environment_s, &path); if (F_status_is_error(status)) { - // Do not consider PATH is not available (or valid?) to be an error. + // Do not consider PATH is not available (or not valid?) to be an error. if (F_status_set_fine(status) == F_valid_not || F_status_set_fine(status) == F_failure) { status = F_none; } } else { - status = fl_environment_path_explode_dynamic(path, &paths); + status = fl_environment_path_explode(path, &paths); } f_string_dynamic_resize(0, &path); @@ -377,16 +336,17 @@ extern "C" { return status; } + // Search each individual path in PATH until a match is found. for (f_array_length_t i = 0; i < paths.used; ++i) { - status = f_string_append(program_name, size_name, &paths.array[i]); + status = f_string_dynamic_append(program_name, &paths.array[i]); if (F_status_is_error_not(status)) { status = f_string_dynamic_terminate_after(&paths.array[i]); } if (F_status_is_error_not(status)) { - status = f_file_exists(paths.array[i].string); + status = f_file_exists(paths.array[i]); if (status == F_true) { found = &paths.array[i]; @@ -397,7 +357,7 @@ extern "C" { if (F_status_is_error(status)) { status = F_status_set_fine(status); - // don't consider bad/non-accessible paths an error, just ignore them. + // Don't consider bad/non-accessible paths an error, just ignore them. if (status == F_name) { continue; } @@ -431,22 +391,25 @@ extern "C" { f_string_dynamics_resize(0, &paths); + program_name.string = program_path; + program_name.used = found->used; + if (parameter && (parameter->option & FL_execute_parameter_option_path_d)) { fixed_arguments[0] = program_path; } if (parameter && parameter->data) { - return private_fll_execute_fork_data(F_true, program_path, fixed_arguments, parameter, as, result); + return private_fll_execute_fork_data(F_true, program_name, fixed_arguments, parameter, as, result); } - return private_fll_execute_fork(F_true, program_path, fixed_arguments, parameter, as, result); + return private_fll_execute_fork(F_true, program_name, fixed_arguments, parameter, as, result); } if (parameter && parameter->data) { - return private_fll_execute_fork_data(last_slash, program ? program : arguments.array[0].string, fixed_arguments, parameter, as, result); + return private_fll_execute_fork_data(last_slash, program.used ? program : arguments.array[0], fixed_arguments, parameter, as, result); } - return private_fll_execute_fork(last_slash, program ? program : arguments.array[0].string, fixed_arguments, parameter, as, result); + return private_fll_execute_fork(last_slash, program.used ? program : arguments.array[0], fixed_arguments, parameter, as, result); } #endif // _di_fll_execute_program_ diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index a191049..058593e 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -58,33 +58,29 @@ extern "C" { /** * Add an argument to the execution arguments array. * - * This guarantees that an end of string exists at the end of the copied string. + * This guarantees that a NULL exists at the end of the string (after the source.used length). * This does not check for NULL characters anywhere else in the string. * * @param source * The string to add to the arguments array. - * @param length - * Length of string to prepend. * @param arguments * The array of string arguments intended to pass to the execute functions. * * @return * F_none on success. * - * Errors (with error bit) from: macro_f_string_dynamics_t_resize(). - * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see macro_f_string_dynamics_t_resize() - * @see f_string_append() + * @see f_string_dynamic_append() * @see f_string_dynamic_resize() - * @see f_string_dynamic_terminate() + * @see f_string_dynamic_terminate_after() * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_add_ - extern f_status_t fll_execute_arguments_add(const f_string_t source, const f_array_length_t length, f_string_dynamics_t *arguments); + extern f_status_t fll_execute_arguments_add(const f_string_static_t source, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_add_ /** @@ -101,16 +97,10 @@ extern "C" { * * @param prefix * The string prepend to the name. - * @param prefix_length - * Length of prefix to prepend. * @param name * The string to add to the arguments array. - * @param name_length - * Length of name to prepend. * @param value * The string to add to the arguments array. - * @param value_length - * Length of value to prepend. * @param arguments * The array of string arguments intended to pass to the execute functions. * @@ -128,7 +118,7 @@ extern "C" { * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_add_parameter_ - extern f_status_t fll_execute_arguments_add_parameter(const f_string_t prefix, const f_array_length_t prefix_length, const f_string_t name, const f_array_length_t name_length, const f_string_t value, const f_array_length_t value_length, f_string_dynamics_t *arguments); + extern f_status_t fll_execute_arguments_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_add_parameter_ /** @@ -147,16 +137,10 @@ extern "C" { * * @param prefix * An array of the strings prepend to the name. - * @param prefix_length - * Length of prefix to prepend. * @param name * An array of the strings to add to the arguments array. - * @param name_length - * Length of name to prepend. * @param value * An array of the strings to add to the arguments array. - * @param value_length - * Length of value to prepend. * @param size * The array size of prefix, prefix_length, name, name_length, value, and value_length (all of which must be of the same array size). * @param arguments @@ -176,7 +160,7 @@ extern "C" { * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_add_parameter_set_ - extern f_status_t fll_execute_arguments_add_parameter_set(const f_string_t prefix[], const f_array_length_t prefix_length[], const f_string_t name[], const f_array_length_t name_length[], const f_string_t value[], const f_array_length_t value_length[], const f_array_length_t size, f_string_dynamics_t *arguments); + extern f_status_t fll_execute_arguments_add_parameter_set(const f_string_static_t prefix[], const f_string_static_t name[], const f_string_static_t value[], const f_array_length_t size, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_add_parameter_set_ /** @@ -187,8 +171,6 @@ extern "C" { * * @param source * An array of strings to add to the arguments array. - * @param length - * An array of lengths of each string to prepend. * @param size * The array size of source and length (all of which must be of the same array size). * @param arguments @@ -208,146 +190,10 @@ extern "C" { * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_add_set_ - extern f_status_t fll_execute_arguments_add_set(const f_string_t source[], const f_array_length_t length[], const f_array_length_t size, f_string_dynamics_t *arguments); + extern f_status_t fll_execute_arguments_add_set(const f_string_static_t source[], const f_array_length_t size, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_add_set_ /** - * Add an argument to the execution arguments array. - * - * This guarantees that an end of string exists at the end of the copied string. - * This does not check for NULL characters anywhere else in the string. - * - * @param source - * The string to add to the arguments array. - * @param arguments - * The array of string arguments intended to pass to the execute functions. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_terminate(). - * Errors (with error bit) from: f_string_dynamics_increase(). - * - * @see f_string_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamic_terminate() - * @see f_string_dynamics_increase() - */ -#ifndef _di_fll_execute_arguments_dynamic_add_ - extern f_status_t fll_execute_arguments_dynamic_add(const f_string_static_t source, f_string_dynamics_t *arguments); -#endif // _di_fll_execute_arguments_dynamic_add_ - -/** - * Add parameters as arguments to the execution arguments array. - * - * This is intended to simplify adding arguments that have prefixes and values such as those common in console parameters. - * For example, a pefix of '--', a name of 'do', and a value of 'something' would result in two arguments added: - * '--do' and 'something'. - * - * The arguments are only appended if the length of name and value are not 0. - * - * This guarantees that an end of string exists at the end of each argument. - * This does not check for NULL characters anywhere else in the string. - * - * @param prefix - * The string prepend to the name. - * @param name - * The string to add to the arguments array. - * @param value - * The string to add to the arguments array. - * @param arguments - * The array of string arguments intended to pass to the execute functions. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_terminate(). - * Errors (with error bit) from: f_string_dynamics_increase(). - * - * @see f_string_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamic_terminate() - * @see f_string_dynamics_increase() - */ -#ifndef _di_fll_execute_arguments_dynamic_add_parameter_ - extern f_status_t fll_execute_arguments_dynamic_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments); -#endif // _di_fll_execute_arguments_dynamic_add_parameter_ - -/** - * Add set of parameters as arguments to the execution arguments array. - * - * This is intended to simplify adding arguments that have prefixes and values such as those common in console parameters. - * For example, a pefix of '--', a name of 'do', and a value of 'something' would result in two arguments added: - * '--do' and 'something'. - * - * The arguments are only appended if the length of name and value are not 0. - * - * This guarantees that an end of string exists at the end of each argument. - * This does not check for NULL characters anywhere else in the string. - * - * @param prefix - * The string prepend to the name. - * @param name - * The string to add to the arguments array. - * @param value - * The string prepend to the name. - * @param size - * The array size of buffer. - * @param arguments - * The array of string arguments intended to pass to the execute functions. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_terminate(). - * Errors (with error bit) from: f_string_dynamics_increase(). - * - * @see f_string_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamic_terminate() - * @see f_string_dynamics_increase() - */ -#ifndef _di_fll_execute_arguments_dynamic_add_parameter_set_ - extern f_status_t fll_execute_arguments_dynamic_add_parameter_set(const f_string_static_t prefix[], const f_string_static_t name[], const f_string_static_t value[], const f_array_length_t size, f_string_dynamics_t *arguments); -#endif // _di_fll_execute_arguments_dynamic_add_parameter_set_ - -/** - * Add a set of arguments to the execution arguments array. - * - * This guarantees that an end of string exists at the end of the copied string. - * This does not check for NULL characters anywhere else in the string. - * - * @param source - * An array of strings to add to the arguments array. - * @param size - * The array size of buffer. - * @param arguments - * The array of string arguments intended to pass to the execute functions. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_terminate(). - * Errors (with error bit) from: f_string_dynamics_increase(). - * - * @see f_string_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamic_terminate() - * @see f_string_dynamics_increase() - */ -#ifndef _di_fll_execute_arguments_dynamic_add_set_ - extern f_status_t fll_execute_arguments_dynamic_add_set(const f_string_static_t source[], const f_array_length_t size, f_string_dynamics_t *arguments); -#endif // _di_fll_execute_arguments_dynamic_add_set_ - -/** * Execute a program given by program name found in the PATH environment (such as "bash") or program path (such as "/bin/bash"). * * The program will be executed directly and not via a child process. @@ -382,14 +228,24 @@ extern "C" { * * F_failure (with error bit) on execution failure. * + * Errors (with error bit) from: f_environment_get(). + * Errors (with error bit) from: f_string_dynamic_append(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). + * Errors (with error bit) from: fl_environment_path_explode(). + * * @see execv() * @see execvp() * @see exit() * @see memcpy() * @see strnlen() + * + * @see f_environment_get() + * @see f_string_dynamic_append() + * @see f_string_dynamic_terminate_after() + * @see fl_environment_path_explode() */ #ifndef _di_fll_execute_into_ - extern f_status_t fll_execute_into(const f_string_t program, const f_string_statics_t arguments, const uint8_t option, const f_string_maps_t *environment, int *result); + extern f_status_t fll_execute_into(const f_string_static_t program, const f_string_statics_t arguments, const uint8_t option, const f_string_maps_t *environment, int *result); #endif // _di_fll_execute_into_ /** @@ -463,13 +319,13 @@ extern "C" { * Errors (with error bit) from: f_environment_get(). * Errors (with error bit) from: f_file_exists(). * Errors (with error bit) from: f_limit_process(). - * Errors (with error bit) from: macro_f_string_dynamics_t_delete(). * Errors (with error bit) from: f_signal_mask(). - * Errors (with error bit) from: f_thread_signal_mask(). - * Errors (with error bit) from: fl_environment_path_explode_dynamic(). * Errors (with error bit) from: f_string_append(). * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_dynamics_resize(). + * Errors (with error bit) from: f_thread_signal_mask(). + * Errors (with error bit) from: fl_environment_path_explode(). * * @see close() * @see clearenv() @@ -496,14 +352,15 @@ extern "C" { * @see f_file_exists() * @see f_limit_process() * @see f_signal_mask() - * @see f_string_append() - * @see f_string_dynamic_terminate() + * @see f_string_dynamic_append() + * @see f_string_dynamic_terminate_after() + * @see f_string_dynamics_resize() * @see f_thread_signal_mask() * @see fl_control_group_apply() - * @see fl_environment_path_explode_dynamic() + * @see fl_environment_path_explode() */ #ifndef _di_fll_execute_program_ - extern f_status_t fll_execute_program(const f_string_t program, const f_string_statics_t arguments, fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result); + extern f_status_t fll_execute_program(const f_string_static_t program, const f_string_statics_t arguments, fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result); #endif // _di_fll_execute_program_ #ifdef __cplusplus diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index ece9a5d..28bf35d 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -5,115 +5,73 @@ extern "C" { #endif -#if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) - f_status_t private_fll_execute_arguments_add(const f_string_t source, const f_array_length_t length, f_string_dynamics_t *arguments) { +#if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) + f_status_t private_fll_execute_arguments_add(const f_string_static_t source, f_string_dynamics_t *arguments) { f_status_t status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments); if (F_status_is_error(status)) return status; - f_string_dynamic_t argument = f_string_dynamic_t_initialize; + arguments->array[arguments->used].used = 0; - if (length) { - status = f_string_append(source, length, &argument); + status = f_string_dynamic_increase_by(source.used + 1, &arguments->array[arguments->used]); + if (F_status_is_error(status)) return status; - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &argument); + status = f_string_dynamic_append(source, &arguments->array[arguments->used]); - return status; - } + if (F_status_is_error_not(status)) { + status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]); } - status = f_string_dynamic_terminate(&argument); - - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &argument); - - return status; - } + if (F_status_is_error(status)) return status; - arguments->array[arguments->used].string = argument.string; - arguments->array[arguments->used].used = argument.used; - arguments->array[arguments->used++].size = argument.size; + ++arguments->used; return F_none; } -#endif // !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) +#endif // !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) -#if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) - f_status_t private_fll_execute_arguments_add_parameter(const f_string_t prefix, const f_array_length_t prefix_length, const f_string_t name, const f_array_length_t name_length, const f_string_t value, const f_array_length_t value_length, f_string_dynamics_t *arguments) { +#if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) + f_status_t private_fll_execute_arguments_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments) { f_status_t status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments); if (F_status_is_error(status)) return status; - f_string_dynamic_t argument = f_string_dynamic_t_initialize; - - if (prefix_length) { - status = f_string_append(prefix, prefix_length, &argument); - - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &argument); - - return status; - } - } - - if (name_length) { - status = f_string_append(name, name_length, &argument); + arguments->array[arguments->used].used = 0; - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &argument); - - return status; - } - } - - status = f_string_dynamic_terminate(&argument); + status = f_string_dynamic_increase_by(prefix.used + name.used + 1, &arguments->array[arguments->used]); + if (F_status_is_error(status)) return status; - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &argument); + status = f_string_dynamic_append(prefix, &arguments->array[arguments->used]); - return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_terminate(&arguments->array[arguments->used]); } - arguments->array[arguments->used].string = argument.string; - arguments->array[arguments->used].used = argument.used; - arguments->array[arguments->used++].size = argument.size; - - macro_f_string_dynamic_t_clear(argument); + if (F_status_is_error(status)) return status; - if (value_length) { - status = f_string_append(value, value_length, &argument); + ++arguments->used; - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &argument); + status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments); + if (F_status_is_error(status)) return status; - return status; - } - } + arguments->array[arguments->used].used = 0; - status = f_string_dynamic_terminate(&argument); + status = f_string_dynamic_increase_by(value.used + 1, &arguments->array[arguments->used]); + if (F_status_is_error(status)) return status; - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &argument); + status = f_string_dynamic_append(value, &arguments->array[arguments->used]); - return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_terminate(&arguments->array[arguments->used]); } - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments); - - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &argument); - - return status; - } + if (F_status_is_error(status)) return status; - arguments->array[arguments->used].string = argument.string; - arguments->array[arguments->used].used = argument.used; - arguments->array[arguments->used++].size = argument.size; + ++arguments->used; return F_none; } -#endif // !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) +#endif // !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) #if !defined(_di_fll_execute_program_) f_status_t private_fll_execute_as_child(const fl_execute_as_t as, fl_execute_parameter_t * const parameter, int *result) { @@ -127,6 +85,7 @@ extern "C" { } *result = F_execute_nice; + return F_status_set_error(F_nice); } } @@ -140,6 +99,7 @@ extern "C" { } *result = F_execute_capability; + return F_status_set_error(F_capability); } } @@ -152,6 +112,7 @@ extern "C" { } *result = F_execute_group; + return F_status_set_error(F_group); } } @@ -163,6 +124,7 @@ extern "C" { } *result = F_execute_group; + return F_status_set_error(F_group); } } @@ -174,6 +136,7 @@ extern "C" { } *result = F_execute_user; + return F_status_set_error(F_user); } } @@ -250,7 +213,7 @@ extern "C" { #endif // !defined(_di_fll_execute_program_) #if !defined(_di_fll_execute_program_) - f_status_t private_fll_execute_fork(const bool direct, const f_string_t program, const f_string_t fixed_arguments[], fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) { + f_status_t private_fll_execute_fork(const bool direct, const f_string_static_t program, const f_string_t fixed_arguments[], fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) { int descriptors[2] = { -1, -1 }; @@ -274,10 +237,10 @@ extern "C" { if (id_process) { if (as) { - // close the read pipe for the parent. + // Close the read pipe for the parent. close(descriptors[0]); - // have the parent perform all appropriate access controls and then send either '0' for no error or '1' for error to the child. + // Have the parent perform all appropriate access controls and then send either '0' for no error or '1' for error to the child. { char string_result[2] = { '0', 0 }; @@ -291,10 +254,10 @@ extern "C" { const f_status_t status = private_fll_execute_as_parent(*as, id_process, parameter, string_result); - // inform the child that it can now safely begin (or exit). + // Inform the child that it can now safely begin (or exit). f_file_write(file, buffer, 0); - // close the write pipe for the parent when finished writing. + // Close the write pipe for the parent when finished writing. close(descriptors[1]); if (F_status_is_error(status)) { @@ -316,7 +279,7 @@ extern "C" { // have the parent wait for the child process to finish. waitpid(id_process, (int *) result, parameter ? parameter->wait : 0); - // this must explicitly check for 0 (as opposed to checking (!result)). + // This must explicitly check for 0 (as opposed to checking (!result)). if (result != 0) { if (WIFEXITED(*((int *) result))) { return F_none; @@ -334,7 +297,7 @@ extern "C" { if (as) { - // close the write pipe for the child. + // Close the write pipe for the child. close(descriptors[1]); char string_response[2] = { 0, 0 }; @@ -385,20 +348,20 @@ extern "C" { clearenv(); for (f_array_length_t i = 0; i < parameter->environment->used; ++i) { - f_environment_set_dynamic(parameter->environment->array[i].name, parameter->environment->array[i].value, F_true); + f_environment_set(parameter->environment->array[i].name, parameter->environment->array[i].value, F_true); } // for } if (as) { - // close the write pipe for the child when done. + // Close the write pipe for the child when done. close(descriptors[0]); const f_status_t status = private_fll_execute_as_child(*as, parameter, (int *) result); if (F_status_is_error(status)) return status; } - int code = direct ? execv(program, fixed_arguments) : execvp(program, fixed_arguments); + int code = direct ? execv(program.string, fixed_arguments) : execvp(program.string, fixed_arguments); if (code == -1) { if (errno == EACCES) code = F_execute_access; @@ -440,7 +403,7 @@ extern "C" { #endif // !defined(_di_fll_execute_program_) #if !defined(_di_fll_execute_program_) - f_status_t private_fll_execute_fork_data(const bool direct, const f_string_t program, const f_string_t fixed_arguments[], fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) { + f_status_t private_fll_execute_fork_data(const bool direct, const f_string_static_t program, const f_string_t fixed_arguments[], fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) { int descriptors[2] = { -1, -1 }; @@ -459,7 +422,7 @@ extern "C" { if (id_process) { - // close the read pipe for the parent. + // Close the read pipe for the parent. close(descriptors[0]); { @@ -469,7 +432,7 @@ extern "C" { f_status_t status = F_none; - // have the parent perform all appropriate access controls and then send either '0' for no error or '1' for error to the child. + // Have the parent perform all appropriate access controls and then send either '0' for no error or '1' for error to the child. if (as) { f_string_static_t buffer = f_string_static_t_initialize; @@ -479,18 +442,18 @@ extern "C" { status = private_fll_execute_as_parent(*as, id_process, parameter, string_result); - // inform the child that it can now safely begin (or exit). + // Inform the child that it can now safely begin (or exit). if (F_status_is_error(f_file_write(file, buffer, 0))) { string_result[0] = '1'; } } - // write all data, if child doesn't read this could block until child closes the pipe. + // Write all data, if child doesn't read this could block until child closes the pipe. if (string_result[0] == '0') { f_file_write(file, *parameter->data, 0); } - // close the write pipe for the parent when finished writing. + // Close the write pipe for the parent when finished writing. close(descriptors[1]); if (F_status_is_error(status)) { @@ -508,10 +471,10 @@ extern "C" { return F_parent; } - // have the parent wait for the child process to finish. + // Have the parent wait for the child process to finish. waitpid(id_process, (int *) result, parameter->wait); - // this must explicitly check for 0 (as opposed to checking (!result)). + // This must explicitly check for 0 (as opposed to checking (!result)). if (result != 0) { if (WIFEXITED(*((int *) result))) { return F_none; @@ -527,10 +490,10 @@ extern "C" { setsid(); } - // close the write pipe for the child. + // Close the write pipe for the child. close(descriptors[1]); - // wait for parent to tell child to begin. + // Wait for parent to tell child to begin. if (as) { char string_response[2] = { 0, 0 }; @@ -580,7 +543,7 @@ extern "C" { clearenv(); for (f_array_length_t i = 0; i < parameter->environment->used; ++i) { - f_environment_set_dynamic(parameter->environment->array[i].name, parameter->environment->array[i].value, F_true); + f_environment_set(parameter->environment->array[i].name, parameter->environment->array[i].value, F_true); } // for } @@ -591,9 +554,9 @@ extern "C" { if (F_status_is_error(status)) return status; } - int code = direct ? execv(program, fixed_arguments) : execvp(program, fixed_arguments); + int code = direct ? execv(program.string, fixed_arguments) : execvp(program.string, fixed_arguments); - // close the write pipe for the child when done. + // Close the write pipe for the child when done. close(descriptors[0]); if (code < 0) { @@ -636,14 +599,15 @@ extern "C" { #endif // !defined(_di_fll_execute_program_) #if !defined(_di_fll_execute_program_) - void private_fll_execute_path_arguments_fixate(const f_string_t program_path, const f_string_statics_t arguments, const f_string_t last_slash, const bool fixated_is, const f_array_length_t name_size, char program_name[], f_string_t fixed_arguments[]) { + void private_fll_execute_path_arguments_fixate(const f_string_static_t program_path, const f_string_statics_t arguments, const f_string_t last_slash, const bool fixated_is, f_string_static_t program_name, f_string_t fixed_arguments[]) { - memset(program_name, 0, name_size + 1); + memset(program_name.string, 0, program_name.used + 1); memset(fixed_arguments, 0, sizeof(f_string_t) * (arguments.used + 2)); - memcpy(program_name, last_slash ? last_slash + 1 : program_path, name_size); - if (name_size) { - fixed_arguments[0] = program_name; + memcpy(program_name.string, last_slash ? last_slash + 1 : program_path.string, program_name.used); + + if (program_name.used) { + fixed_arguments[0] = program_name.string; } if (fixated_is) { diff --git a/level_2/fll_execute/c/private-execute.h b/level_2/fll_execute/c/private-execute.h index 8321eb6..844c238 100644 --- a/level_2/fll_execute/c/private-execute.h +++ b/level_2/fll_execute/c/private-execute.h @@ -22,31 +22,25 @@ extern "C" { * * @param source * The string to add to the arguments array. - * @param length - * Length of string to prepend. * @param arguments * The array of string arguments intended to pass to the execute functions. * * @return * F_none on success. * - * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see f_string_append() + * @see f_string_dynamic_increase_by() * @see f_string_dynamic_resize() - * @see f_string_dynamic_terminate() + * @see f_string_dynamic_terminate_after() * @see f_string_dynamics_increase() - * @see fll_execute_arguments_add() - * @see fll_execute_arguments_add_set() - * @see fll_execute_arguments_dynamic_add() - * @see fll_execute_arguments_dynamic_add_set() */ -#if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) - extern f_status_t private_fll_execute_arguments_add(const f_string_t source, const f_array_length_t length, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d; -#endif // !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) +#if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) + extern f_status_t private_fll_execute_arguments_add(const f_string_static_t source, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d; +#endif // !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) /** * Private implementation of fll_execute_arguments_add_parameter(). @@ -55,16 +49,10 @@ extern "C" { * * @param prefix * The string prepend to the name. - * @param prefix_length - * Length of prefix to prepend. * @param name * The string to add to the arguments array. - * @param name_length - * Length of name to prepend. * @param value * The string prepend to the name. - * @param value_length - * Length of value to prepend. * @param arguments * The array of string arguments intended to pass to the execute functions. * @@ -85,9 +73,9 @@ extern "C" { * @see fll_execute_arguments_dynamic_add_parameter() * @see fll_execute_arguments_dynamic_add_parameter_set() */ -#if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) - extern f_status_t private_fll_execute_arguments_add_parameter(const f_string_t prefix, const f_array_length_t prefix_length, const f_string_t name, const f_array_length_t name_length, const f_string_t value, const f_array_length_t value_length, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d; -#endif // !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) +#if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) + extern f_status_t private_fll_execute_arguments_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d; +#endif // !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) /** * Private function for perform the execute as operations. @@ -235,7 +223,7 @@ extern "C" { * @see pipe() * @see waitpid() * - * @see f_environment_set_dynamic() + * @see f_environment_set() * @see f_limit_process() * @see f_signal_mask() * @see f_thread_signal_mask() @@ -243,7 +231,7 @@ extern "C" { * @see fll_execute_program() */ #if !defined(_di_fll_execute_program_) - extern f_status_t private_fll_execute_fork(const bool direct, const f_string_t program, const f_string_t fixed_arguments[], fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) F_attribute_visibility_internal_d; + extern f_status_t private_fll_execute_fork(const bool direct, const f_string_static_t program, const f_string_t fixed_arguments[], fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) F_attribute_visibility_internal_d; #endif // !defined(_di_fll_execute_program_) /** @@ -311,14 +299,14 @@ extern "C" { * @see pipe() * @see waitpid() * - * @see f_environment_set_dynamic() + * @see f_environment_set() * @see f_limit_process() * @see f_signal_mask() * @see f_thread_signal_mask() * @see fll_execute_program() */ #if !defined(_di_fll_execute_program_) - extern f_status_t private_fll_execute_fork_data(const bool direct, const f_string_t program, const f_string_t fixed_arguments[], fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) F_attribute_visibility_internal_d; + extern f_status_t private_fll_execute_fork_data(const bool direct, const f_string_static_t program, const f_string_t fixed_arguments[], fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, void *result) F_attribute_visibility_internal_d; #endif // !defined(_di_fll_execute_program_) /** @@ -334,8 +322,6 @@ extern "C" { * @param fixated_is * If TRUE, then the program_path is already fixated in the fixed_arguments at index 0. * If FALSE, then the program_path needs to be fixated in the fixed_arguments at index 0. - * @param name_size - * The size of the program_path to copy. * @param program_name * The destination to copy the name to. * @param fixed_arguments @@ -347,7 +333,7 @@ extern "C" { * @see fll_execute_program() */ #if !defined(_di_fll_execute_program_) - extern void private_fll_execute_path_arguments_fixate(const f_string_t program_path, const f_string_statics_t arguments, const f_string_t last_slash, const bool fixated_is, const f_array_length_t name_size, char program_name[], f_string_t fixed_arguments[]) F_attribute_visibility_internal_d; + extern void private_fll_execute_path_arguments_fixate(const f_string_static_t program_path, const f_string_statics_t arguments, const f_string_t last_slash, const bool fixated_is, f_string_static_t program_name, f_string_t fixed_arguments[]) F_attribute_visibility_internal_d; #endif // !defined(_di_fll_execute_program_) #ifdef __cplusplus diff --git a/level_2/fll_file/c/file.c b/level_2/fll_file/c/file.c index aa4d416..b075cfd 100644 --- a/level_2/fll_file/c/file.c +++ b/level_2/fll_file/c/file.c @@ -6,27 +6,35 @@ extern "C" { #endif #ifndef _di_fll_file_mode_set_all_ - f_status_t fll_file_mode_set_all(const f_string_t path, const mode_t mode, const f_number_unsigned_t depth_max) { + f_status_t fll_file_mode_set_all(const f_string_static_t path, const mode_t mode, const f_number_unsigned_t depth_max) { #ifndef _di_level_2_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); + if (!path.string) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ + if (!path.used) { + return F_data_not; + } + return private_fll_file_mode_set_all(path, mode, depth_max, 0); } #endif // _di_fll_file_mode_set_all_ #ifndef _di_fll_file_move_ - f_status_t fll_file_move(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const fl_directory_recurse_t recurse) { + f_status_t fll_file_move(const f_string_static_t source, const f_string_static_t destination, const fl_directory_recurse_t recurse) { #ifndef _di_level_2_parameter_checking_ - if (!source) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); + if (!source.string) return F_status_set_error(F_parameter); + if (!destination.string) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ + if (!source.used || !destination.string) { + return F_data_not; + } + f_status_t status = f_file_rename(source, destination); if (F_status_set_fine(status) != F_mount) { if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, source, destination); + recurse.verbose(recurse.output, source.string, destination.string); } return status; @@ -43,13 +51,13 @@ extern "C" { } if (status == F_true) { - status = fl_directory_clone(source, destination, source_length, destination_length, F_true, recurse); + status = fl_directory_clone(source, destination, F_true, recurse); if (F_status_is_error(status)) return status; status = f_directory_remove(source, recurse.depth_max, F_false); if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, source, destination); + recurse.verbose(recurse.output, source.string, destination.string); } } else { @@ -59,7 +67,7 @@ extern "C" { status = f_file_remove(source); if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) { - recurse.verbose(recurse.output, source, destination); + recurse.verbose(recurse.output, source.string, destination.string); } } @@ -68,12 +76,16 @@ extern "C" { #endif // _di_fll_file_move_ #ifndef _di_fll_file_role_change_all_ - f_status_t fll_file_role_change_all(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max) { + f_status_t fll_file_role_change_all(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max) { #ifndef _di_level_2_parameter_checking_ - if (!path) return F_status_set_error(F_parameter); + if (!path.string) return F_status_set_error(F_parameter); if (uid == -1 && gid == -1) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ + if (!path.string) { + return F_data_not; + } + return private_fll_file_role_change_all(path, uid, gid, dereference, depth_max, 0); } #endif // _di_fll_file_role_change_all_ diff --git a/level_2/fll_file/c/file.h b/level_2/fll_file/c/file.h index 14f217e..305784b 100644 --- a/level_2/fll_file/c/file.h +++ b/level_2/fll_file/c/file.h @@ -47,6 +47,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not if path.used is 0. * * F_access_denied (with error bit) on access denied. * F_access_mode (with error bit) if the current user does not have access to assign the file mode. @@ -65,7 +66,7 @@ extern "C" { * Errors (with error bit) from: fl_directory_list(). */ #ifndef _di_fll_file_mode_set_all_ - extern f_status_t fll_file_mode_set_all(const f_string_t path, const mode_t mode, const f_number_unsigned_t depth_max); + extern f_status_t fll_file_mode_set_all(const f_string_static_t path, const mode_t mode, const f_number_unsigned_t depth_max); #endif // _di_fll_file_mode_set_all_ /** @@ -84,10 +85,6 @@ extern "C" { * The path to the file to copy from. * @param destination * The path to copy to. - * @param source_length - * The length of the source path. - * @param destination_length - * The length of the destination path. * @param recurse * The directory recurse data. * @@ -126,7 +123,7 @@ extern "C" { * @see fl_directory_clone() */ #ifndef _di_fll_file_move_ - extern f_status_t fll_file_move(const f_string_t source, const f_string_t destination, const f_array_length_t source_length, const f_array_length_t destination_length, const fl_directory_recurse_t recurse); + extern f_status_t fll_file_move(const f_string_static_t source, const f_string_static_t destination, const fl_directory_recurse_t recurse); #endif // _di_fll_file_move_ /** @@ -172,7 +169,7 @@ extern "C" { * Errors (with error bit) from: fl_directory_list(). */ #ifndef _di_fll_file_role_change_all_ - extern f_status_t fll_file_role_change_all(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max); + extern f_status_t fll_file_role_change_all(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max); #endif // _di_fll_file_role_change_all_ #ifdef __cplusplus diff --git a/level_2/fll_file/c/private-file.c b/level_2/fll_file/c/private-file.c index 98e85bf..e11231f 100644 --- a/level_2/fll_file/c/private-file.c +++ b/level_2/fll_file/c/private-file.c @@ -6,7 +6,8 @@ extern "C" { #endif #if !defined(_di_fll_file_mode_set_all_) - f_status_t private_fll_file_mode_set_all(const f_string_t path, const mode_t mode, const f_number_unsigned_t depth_max, const f_number_unsigned_t depth) { + f_status_t private_fll_file_mode_set_all(const f_string_static_t path, const mode_t mode, const f_number_unsigned_t depth_max, const f_number_unsigned_t depth) { + f_status_t status = F_none; status = f_directory_is(path); @@ -28,8 +29,6 @@ extern "C" { status = F_none; - const f_array_length_t path_length = strnlen(path, F_path_length_max_d); - { f_string_dynamics_t * const list[] = { &listing.block, @@ -43,20 +42,22 @@ extern "C" { uint8_t i = 0; f_array_length_t j = 0; + f_string_static_t path_sub = f_string_static_t_initialize; for (; i < 7; ++i) { for (j = 0; F_status_is_fine(status) && j < list[i]->used; ++j) { - const f_array_length_t length = path_length + list[i]->array[j].used + 1; + path_sub.used = path.used + list[i]->array[j].used + 1; - char path_sub[length + 1]; + char path_sub_string[path_sub.used + 1]; + path_sub.string = path_sub_string; - memcpy(path_sub, path, path_length); - memcpy(path_sub + path_length + 1, list[i]->array[j].string, list[i]->array[j].used); + memcpy(path_sub.string, path.string, path.used); + memcpy(path_sub.string + path.used + 1, list[i]->array[j].string, list[i]->array[j].used); - path_sub[path_length] = f_path_separator_s.string[0]; - path_sub[length] = 0; + path_sub.string[path.used] = f_path_separator_s.string[0]; + path_sub.string[path_sub.used] = 0; status = f_file_mode_set(path_sub, mode); } // for @@ -67,17 +68,20 @@ extern "C" { f_string_dynamics_resize(0, &listing.unknown); + f_string_static_t path_sub = f_string_static_t_initialize; + for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; ++i) { - const f_array_length_t length = path_length + listing.directory.array[i].used + 1; + path_sub.used = path.used + listing.directory.array[i].used + 1; - char path_sub[length + 1]; + char path_sub_string[path_sub.used + 1]; + path_sub.string = path_sub_string; - memcpy(path_sub, path, path_length); - memcpy(path_sub + path_length + 1, listing.directory.array[i].string, listing.directory.array[i].used); + memcpy(path_sub.string, path.string, path.used); + memcpy(path_sub.string + path.used + 1, listing.directory.array[i].string, listing.directory.array[i].used); - path_sub[path_length] = f_path_separator_s.string[0]; - path_sub[length] = 0; + path_sub.string[path.used] = f_path_separator_s.string[0]; + path_sub.string[path_sub.used] = 0; status = f_directory_exists(path_sub); if (F_status_is_error(status)) break; @@ -105,7 +109,7 @@ extern "C" { #endif // !defined(_di_fll_file_mode_set_all_) #if !defined(_di_fll_file_role_change_all_) - f_status_t private_fll_file_role_change_all(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max, const f_number_unsigned_t depth) { + f_status_t private_fll_file_role_change_all(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max, const f_number_unsigned_t depth) { f_status_t status = F_none; status = f_directory_is(path); @@ -127,8 +131,6 @@ extern "C" { status = F_none; - const f_array_length_t path_length = strnlen(path, F_path_length_max_d); - { f_string_dynamics_t * const list[] = { &listing.block, @@ -142,20 +144,22 @@ extern "C" { uint8_t i = 0; f_array_length_t j = 0; + f_string_static_t path_sub = f_string_static_t_initialize; for (; i < 7; ++i) { for (j = 0; F_status_is_fine(status) && j < list[i]->used; ++j) { - const f_array_length_t length = path_length + list[i]->array[j].used + 1; + path_sub.used = path.used + list[i]->array[j].used + 1; - char path_sub[length + 1]; + char path_sub_string[path_sub.used + 1]; + path_sub.string = path_sub_string; - memcpy(path_sub, path, path_length); - memcpy(path_sub + path_length + 1, list[i]->array[j].string, list[i]->array[j].used); + memcpy(path_sub.string, path.string, path.used); + memcpy(path_sub.string + path.used + 1, list[i]->array[j].string, list[i]->array[j].used); - path_sub[path_length] = f_path_separator_s.string[0]; - path_sub[length] = 0; + path_sub.string[path.used] = f_path_separator_s.string[0]; + path_sub.string[path_sub.used] = 0; status = f_file_role_change(path_sub, uid, gid, dereference); } // for @@ -164,32 +168,37 @@ extern "C" { } // for } - for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; ++i) { + { + f_string_static_t path_sub = f_string_static_t_initialize; - const f_array_length_t length = path_length + listing.directory.array[i].used + 1; + for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; ++i) { - char path_sub[length + 1]; + path_sub.used = path.used + listing.directory.array[i].used + 1; - memcpy(path_sub, path, path_length); - memcpy(path_sub + path_length + 1, listing.directory.array[i].string, listing.directory.array[i].used); + char path_sub_string[path_sub.used + 1]; + path_sub.string = path_sub_string; - path_sub[path_length] = f_path_separator_s.string[0]; - path_sub[length] = 0; + memcpy(path_sub.string, path.string, path.used); + memcpy(path_sub.string + path.used + 1, listing.directory.array[i].string, listing.directory.array[i].used); - status = f_directory_exists(path_sub); - if (F_status_is_error(status)) break; + path_sub.string[path.used] = f_path_separator_s.string[0]; + path_sub.string[path_sub.used] = 0; - if (status == F_false) { - status = F_status_set_error(F_directory); + status = f_directory_exists(path_sub); + if (F_status_is_error(status)) break; - break; - } + if (status == F_false) { + status = F_status_set_error(F_directory); - if (depth < depth_max) { - status = private_fll_file_role_change_all(path_sub, uid, gid, dereference, depth_max, depth + 1); - if (F_status_is_error(status)) break; - } - } // for + break; + } + + if (depth < depth_max) { + status = private_fll_file_role_change_all(path_sub, uid, gid, dereference, depth_max, depth + 1); + if (F_status_is_error(status)) break; + } + } // for + } f_string_dynamics_resize(0, &listing.directory); diff --git a/level_2/fll_file/c/private-file.h b/level_2/fll_file/c/private-file.h index 8cd056d..0a84958 100644 --- a/level_2/fll_file/c/private-file.h +++ b/level_2/fll_file/c/private-file.h @@ -46,7 +46,7 @@ extern "C" { * F_failure (with error bit) for any other error. */ #if !defined(_di_fll_file_mode_set_all_) - extern f_status_t private_fll_file_mode_set_all(const f_string_t path, const mode_t mode, const f_number_unsigned_t depth_max, const f_number_unsigned_t depth) F_attribute_visibility_internal_d; + extern f_status_t private_fll_file_mode_set_all(const f_string_static_t path, const mode_t mode, const f_number_unsigned_t depth_max, const f_number_unsigned_t depth) F_attribute_visibility_internal_d; #endif // !defined(_di_fll_file_mode_set_all_) /** @@ -86,7 +86,7 @@ extern "C" { * F_failure (with error bit) for any other error. */ #if !defined(_di_fll_file_role_change_all_) - extern f_status_t private_fll_file_role_change_all(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max, const f_number_unsigned_t depth) F_attribute_visibility_internal_d; + extern f_status_t private_fll_file_role_change_all(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max, const f_number_unsigned_t depth) F_attribute_visibility_internal_d; #endif // !defined(_di_fll_file_role_change_all_) #ifdef __cplusplus diff --git a/level_2/fll_fss_status_string/c/fss_status_string.c b/level_2/fll_fss_status_string/c/fss_status_string.c index 9176298..cbf6775 100644 --- a/level_2/fll_fss_status_string/c/fss_status_string.c +++ b/level_2/fll_fss_status_string/c/fss_status_string.c @@ -6,29 +6,29 @@ extern "C" { #ifndef _di_fll_fss_status_string_ #ifndef _di_fll_fss_status_error_ - const f_string_static_t fll_fss_status_format_s = macro_f_string_static_t_initialize2(FLL_fss_status_format_s, 0, FLL_fss_status_format_s_length); - const f_string_static_t fll_fss_status_format_eos_s = macro_f_string_static_t_initialize2(FLL_fss_status_format_eos_s, 0, FLL_fss_status_format_eos_s_length); + const f_string_static_t fll_fss_status_format_s = macro_f_string_static_t_initialize(FLL_fss_status_format_s, 0, FLL_fss_status_format_s_length); + const f_string_static_t fll_fss_status_format_eos_s = macro_f_string_static_t_initialize(FLL_fss_status_format_eos_s, 0, FLL_fss_status_format_eos_s_length); #endif // _di_fll_fss_status_error_ #ifndef _di_fll_fss_status_warning_ - const f_string_static_t fll_fss_status_accepted_invalid_s = macro_f_string_static_t_initialize2(FLL_fss_status_accepted_invalid_s, 0, FLL_fss_status_accepted_invalid_s_length); - const f_string_static_t fll_fss_status_accepted_invalid_eos_s = macro_f_string_static_t_initialize2(FLL_fss_status_accepted_invalid_eos_s, 0, FLL_fss_status_accepted_invalid_eos_s_length); + const f_string_static_t fll_fss_status_accepted_invalid_s = macro_f_string_static_t_initialize(FLL_fss_status_accepted_invalid_s, 0, FLL_fss_status_accepted_invalid_s_length); + const f_string_static_t fll_fss_status_accepted_invalid_eos_s = macro_f_string_static_t_initialize(FLL_fss_status_accepted_invalid_eos_s, 0, FLL_fss_status_accepted_invalid_eos_s_length); #endif // _di_fll_fss_status_warning_ #ifndef _di_fll_fss_status_success_ - const f_string_static_t fll_fss_status_found_object_s = macro_f_string_static_t_initialize2(FLL_fss_status_found_object_s, 0, FLL_fss_status_found_object_s_length); - const f_string_static_t fll_fss_status_found_content_s = macro_f_string_static_t_initialize2(FLL_fss_status_found_content_s, 0, FLL_fss_status_found_content_s_length); - const f_string_static_t fll_fss_status_found_object_not_s = macro_f_string_static_t_initialize2(FLL_fss_status_found_object_not_s, 0, FLL_fss_status_found_object_not_s_length); - const f_string_static_t fll_fss_status_found_content_not_s = macro_f_string_static_t_initialize2(FLL_fss_status_found_content_not_s, 0, FLL_fss_status_found_content_not_s_length); - const f_string_static_t fll_fss_status_found_object_content_not_s = macro_f_string_static_t_initialize2(FLL_fss_status_found_object_content_not_s, 0, FLL_fss_status_found_object_content_not_s_length); + const f_string_static_t fll_fss_status_found_object_s = macro_f_string_static_t_initialize(FLL_fss_status_found_object_s, 0, FLL_fss_status_found_object_s_length); + const f_string_static_t fll_fss_status_found_content_s = macro_f_string_static_t_initialize(FLL_fss_status_found_content_s, 0, FLL_fss_status_found_content_s_length); + const f_string_static_t fll_fss_status_found_object_not_s = macro_f_string_static_t_initialize(FLL_fss_status_found_object_not_s, 0, FLL_fss_status_found_object_not_s_length); + const f_string_static_t fll_fss_status_found_content_not_s = macro_f_string_static_t_initialize(FLL_fss_status_found_content_not_s, 0, FLL_fss_status_found_content_not_s_length); + const f_string_static_t fll_fss_status_found_object_content_not_s = macro_f_string_static_t_initialize(FLL_fss_status_found_object_content_not_s, 0, FLL_fss_status_found_object_content_not_s_length); #endif // _di_fll_fss_status_success_ #ifndef _di_fll_fss_status_codes_ - const f_string_static_t fll_fss_status_found_comment_s = macro_f_string_static_t_initialize2(FLL_fss_status_found_comment_s, 0, FLL_fss_status_found_comment_s_length); + const f_string_static_t fll_fss_status_found_comment_s = macro_f_string_static_t_initialize(FLL_fss_status_found_comment_s, 0, FLL_fss_status_found_comment_s_length); #endif // _di_fll_fss_status_codes_ - const f_string_static_t fll_fss_status_status_code_first_s = macro_f_string_static_t_initialize2(FLL_fss_status_status_code_first_s, 0, FLL_fss_status_status_code_first_s_length); - const f_string_static_t fll_fss_status_status_code_last_s = macro_f_string_static_t_initialize2(FLL_fss_status_status_code_last_s, 0, FLL_fss_status_status_code_last_s_length); + const f_string_static_t fll_fss_status_status_code_first_s = macro_f_string_static_t_initialize(FLL_fss_status_status_code_first_s, 0, FLL_fss_status_status_code_first_s_length); + const f_string_static_t fll_fss_status_status_code_last_s = macro_f_string_static_t_initialize(FLL_fss_status_status_code_last_s, 0, FLL_fss_status_status_code_last_s_length); #endif // _di_FLL_fss_status_string_ #ifndef _di_fll_fss_status_string_from_ diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index ff1d261..34a1ba8 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -69,7 +69,7 @@ extern "C" { #endif // _di_fll_program_print_version_ #ifndef _di_fll_program_parameter_process_ - f_status_t fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_array_lengths_t *remaining, f_color_context_t *context) { + f_status_t fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, const f_console_parameter_ids_t choices, const bool right, f_array_lengths_t *remaining, f_color_context_t *context) { f_status_t status = F_none; @@ -79,10 +79,10 @@ extern "C" { f_console_parameter_id_t decision = choices.id[2]; if (right) { - status = f_console_parameter_prioritize_right(parameters, choices, &decision); + status = f_console_parameter_prioritize_right(*parameters, choices, &decision); } else { - status = f_console_parameter_prioritize_left(parameters, choices, &decision); + status = f_console_parameter_prioritize_left(*parameters, choices, &decision); } if (F_status_is_error(status)) return status; diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index 77a3a2d..cda3f19 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -216,7 +216,7 @@ extern "C" { * @see f_color_load_context() */ #ifndef _di_fll_program_parameter_process_ - extern f_status_t fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_array_lengths_t *remaining, f_color_context_t *context); + extern f_status_t fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, const f_console_parameter_ids_t choices, const bool right, f_array_lengths_t *remaining, f_color_context_t *context); #endif // _di_fll_program_parameter_process_ /** diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 528bef9..9172aad 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -78,173 +78,175 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, byte_dump_total_parameters_d); + f_console_parameter_t parameters[] = byte_dump_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = byte_dump_total_parameters_d; - // Identify priority of color parameters. - { - f_console_parameter_id_t ids[3] = { byte_dump_parameter_no_color_e, byte_dump_parameter_light_e, byte_dump_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + // Identify priority of color parameters. + { + f_console_parameter_id_t ids[3] = { byte_dump_parameter_no_color_e, byte_dump_parameter_light_e, byte_dump_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - byte_dump_main_delete(main); + byte_dump_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { byte_dump_parameter_verbosity_quiet_e, byte_dump_parameter_verbosity_normal_e, byte_dump_parameter_verbosity_verbose_e, byte_dump_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { byte_dump_parameter_verbosity_quiet_e, byte_dump_parameter_verbosity_normal_e, byte_dump_parameter_verbosity_verbose_e, byte_dump_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - byte_dump_main_delete(main); + byte_dump_main_delete(main); - return status; - } + return status; + } - if (choice == byte_dump_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == byte_dump_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == byte_dump_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == byte_dump_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + if (choice == byte_dump_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == byte_dump_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == byte_dump_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == byte_dump_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; } + } - // Identify priority of mode parameters. - { - f_console_parameter_id_t ids[5] = { byte_dump_parameter_hexidecimal_e, byte_dump_parameter_duodecimal_e, byte_dump_parameter_octal_e, byte_dump_parameter_binary_e, byte_dump_parameter_decimal_e }; - f_console_parameter_id_t choice = byte_dump_parameter_hexidecimal_e; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 5); + // Identify priority of mode parameters. + { + f_console_parameter_id_t ids[5] = { byte_dump_parameter_hexidecimal_e, byte_dump_parameter_duodecimal_e, byte_dump_parameter_octal_e, byte_dump_parameter_binary_e, byte_dump_parameter_decimal_e }; + f_console_parameter_id_t choice = byte_dump_parameter_hexidecimal_e; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 5); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - byte_dump_main_delete(main); + byte_dump_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); + } - if (choice == byte_dump_parameter_hexidecimal_e) { - main->mode = byte_dump_mode_hexidecimal_e; - } - else if (choice == byte_dump_parameter_duodecimal_e) { - main->mode = byte_dump_mode_duodecimal_e; - } - else if (choice == byte_dump_parameter_octal_e) { - main->mode = byte_dump_mode_octal_e; - } - else if (choice == byte_dump_parameter_binary_e) { - main->mode = byte_dump_mode_binary_e; - } - else if (choice == byte_dump_parameter_decimal_e) { - main->mode = byte_dump_mode_decimal_e; - } + if (choice == byte_dump_parameter_hexidecimal_e) { + main->mode = byte_dump_mode_hexidecimal_e; + } + else if (choice == byte_dump_parameter_duodecimal_e) { + main->mode = byte_dump_mode_duodecimal_e; } + else if (choice == byte_dump_parameter_octal_e) { + main->mode = byte_dump_mode_octal_e; + } + else if (choice == byte_dump_parameter_binary_e) { + main->mode = byte_dump_mode_binary_e; + } + else if (choice == byte_dump_parameter_decimal_e) { + main->mode = byte_dump_mode_decimal_e; + } + } - // Identify priority of presentation parameters. - { - f_console_parameter_id_t ids[3] = { byte_dump_parameter_normal_e, byte_dump_parameter_simple_e, byte_dump_parameter_classic_e }; - f_console_parameter_id_t choice = byte_dump_parameter_normal_e; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + // Identify priority of presentation parameters. + { + f_console_parameter_id_t ids[3] = { byte_dump_parameter_normal_e, byte_dump_parameter_simple_e, byte_dump_parameter_classic_e }; + f_console_parameter_id_t choice = byte_dump_parameter_normal_e; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - byte_dump_main_delete(main); + byte_dump_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); + } - if (choice == byte_dump_parameter_normal_e) { - main->presentation = byte_dump_presentation_normal_e; - } - else if (choice == byte_dump_parameter_simple_e) { - main->presentation = byte_dump_presentation_simple_e; - } - else if (choice == byte_dump_parameter_classic_e) { - main->presentation = byte_dump_presentation_classic_e; - } + if (choice == byte_dump_parameter_normal_e) { + main->presentation = byte_dump_presentation_normal_e; + } + else if (choice == byte_dump_parameter_simple_e) { + main->presentation = byte_dump_presentation_simple_e; + } + else if (choice == byte_dump_parameter_classic_e) { + main->presentation = byte_dump_presentation_classic_e; } + } - // Identify priority of narrow and wide parameters. - { - f_console_parameter_id_t ids[2] = { byte_dump_parameter_narrow_e, byte_dump_parameter_wide_e }; - f_console_parameter_id_t choice = byte_dump_parameter_wide_e; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 2); + // Identify priority of narrow and wide parameters. + { + f_console_parameter_id_t ids[2] = { byte_dump_parameter_narrow_e, byte_dump_parameter_wide_e }; + f_console_parameter_id_t choice = byte_dump_parameter_wide_e; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 2); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - byte_dump_main_delete(main); + byte_dump_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); + } - if (choice == byte_dump_parameter_narrow_e) { - if (main->options & byte_dump_option_wide_d) { - main->options -= byte_dump_option_wide_d; - } - } - else if (choice == byte_dump_parameter_wide_e) { - main->options |= byte_dump_option_wide_d; + if (choice == byte_dump_parameter_narrow_e) { + if (main->options & byte_dump_option_wide_d) { + main->options -= byte_dump_option_wide_d; } } - - status = F_none; + else if (choice == byte_dump_parameter_wide_e) { + main->options |= byte_dump_option_wide_d; + } } - if (main->parameters[byte_dump_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[byte_dump_parameter_help_e].result == f_console_result_found_e) { byte_dump_print_help(main->output.to, main->context); byte_dump_main_delete(main); @@ -252,7 +254,7 @@ extern "C" { return F_none; } - if (main->parameters[byte_dump_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, byte_dump_program_version_s); byte_dump_main_delete(main); @@ -261,7 +263,7 @@ extern "C" { } if (main->remaining.used || main->process_pipe) { - if (main->parameters[byte_dump_parameter_width_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_width_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); @@ -275,13 +277,13 @@ extern "C" { return F_status_set_error(F_parameter); } - if (main->parameters[byte_dump_parameter_width_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[byte_dump_parameter_width_e].values.array[main->parameters[byte_dump_parameter_width_e].values.used - 1]; - const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[index])); + if (main->parameters.array[byte_dump_parameter_width_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[byte_dump_parameter_width_e].values.array[main->parameters.array[byte_dump_parameter_width_e].values.used - 1]; + const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used); f_number_unsigned_t number = 0; - status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &number); + status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number); if (F_status_is_error(status) || number < 1 || number >= 0xfb) { flockfile(main->error.to.stream); @@ -306,7 +308,7 @@ extern "C" { main->width = (uint8_t) number; } - if (main->parameters[byte_dump_parameter_first_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_first_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); @@ -320,13 +322,13 @@ extern "C" { return F_status_set_error(F_parameter); } - if (main->parameters[byte_dump_parameter_first_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[byte_dump_parameter_first_e].values.array[main->parameters[byte_dump_parameter_first_e].values.used - 1]; - const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[index])); + if (main->parameters.array[byte_dump_parameter_first_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[byte_dump_parameter_first_e].values.array[main->parameters.array[byte_dump_parameter_first_e].values.used - 1]; + const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used); f_number_unsigned_t number = 0; - status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &number); + status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number); if (F_status_is_error(status) || number > F_number_t_size_unsigned_d) { flockfile(main->error.to.stream); @@ -351,7 +353,7 @@ extern "C" { main->first = number; } - if (main->parameters[byte_dump_parameter_last_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_last_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); @@ -365,13 +367,13 @@ extern "C" { return F_status_set_error(F_parameter); } - if (main->parameters[byte_dump_parameter_last_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[byte_dump_parameter_last_e].values.array[main->parameters[byte_dump_parameter_last_e].values.used - 1]; - const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[index])); + if (main->parameters.array[byte_dump_parameter_last_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[byte_dump_parameter_last_e].values.array[main->parameters.array[byte_dump_parameter_last_e].values.used - 1]; + const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used); f_number_unsigned_t number = 0; - status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &number); + status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number); if (F_status_is_error(status) || number < 0 || number > F_number_t_size_unsigned_d) { flockfile(main->error.to.stream); @@ -396,7 +398,7 @@ extern "C" { main->last = number; } - if (main->parameters[byte_dump_parameter_first_e].result == f_console_result_additional_e && main->parameters[byte_dump_parameter_last_e].result == f_console_result_additional_e) { + if (main->parameters.array[byte_dump_parameter_first_e].result == f_console_result_additional_e && main->parameters.array[byte_dump_parameter_last_e].result == f_console_result_additional_e) { if (main->first > main->last) { flockfile(main->error.to.stream); @@ -448,7 +450,7 @@ extern "C" { funlockfile(main->output.to.stream); - status = byte_dump_file(main, 0, file); + status = byte_dump_file(main, f_string_empty_s, file); if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "byte_dump_file", F_true); @@ -467,7 +469,7 @@ extern "C" { for (f_array_length_t counter = 0; counter < main->remaining.used; ++counter) { - status = f_file_exists(arguments->argv[main->remaining.array[counter]]); + status = f_file_exists(argv[main->remaining.array[counter]]); if (status == F_false) { status = F_status_set_error(F_file_found_not); @@ -478,7 +480,7 @@ extern "C" { missing_files = status; } - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, arguments->argv[main->remaining.array[counter]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, argv[main->remaining.array[counter]], f_file_operation_open_s, fll_error_file_type_file_e); } } // for @@ -495,10 +497,10 @@ extern "C" { for (f_array_length_t counter = 0; counter < main->remaining.used; ++counter) { - status = f_file_stream_open(arguments->argv[main->remaining.array[counter]], 0, &file); + status = f_file_stream_open(argv[main->remaining.array[counter]], f_string_empty_s, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->remaining.array[counter]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, argv[main->remaining.array[counter]], f_file_operation_open_s, fll_error_file_type_file_e); byte_dump_main_delete(main); @@ -507,9 +509,8 @@ extern "C" { flockfile(main->output.to.stream); - f_print_dynamic(f_string_eol_s, main->output.to.stream); - fl_print_format("%[Byte Dump of: %]%[", main->output.to.stream, main->context.set.title, main->context.set.title, main->context.set.notable); - fl_print_format("%S%] %[(in ", main->output.to.stream, arguments->argv[main->remaining.array[counter]], main->context.set.notable, main->context.set.title); + fl_print_format("%q%[Byte Dump of: %]%[", main->output.to.stream, f_string_eol_s, main->context.set.title, main->context.set.title, main->context.set.notable); + fl_print_format("%Q%] %[(in ", main->output.to.stream, argv[main->remaining.array[counter]], main->context.set.notable, main->context.set.title); if (main->mode == byte_dump_mode_hexidecimal_e) { f_print_terminated("Hexidecimal", main->output.to.stream); @@ -531,7 +532,7 @@ extern "C" { funlockfile(main->output.to.stream); - status = byte_dump_file(main, arguments->argv[main->remaining.array[counter]], file); + status = byte_dump_file(main, argv[main->remaining.array[counter]], file); f_file_stream_close(F_true, &file); @@ -547,7 +548,7 @@ extern "C" { } else { if (main->error.verbosity != f_console_verbosity_quiet_e) { - fll_error_file_print(main->error, F_status_set_fine(status), "byte_dump_file", F_true, arguments->argv[main->remaining.array[counter]], "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "byte_dump_file", F_true, argv[main->remaining.array[counter]], f_file_operation_process_s, fll_error_file_type_file_e); } } @@ -562,7 +563,8 @@ extern "C" { } } else { - fll_print_format("%[%QYou failed to specify one or more filenames.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s); + fll_print_format("%q%[%QYou failed to specify one or more filenames.%]%q", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s); + status = F_status_set_error(F_parameter); } diff --git a/level_3/byte_dump/c/common.c b/level_3/byte_dump/c/common.c index bfd55cc..30466d4 100644 --- a/level_3/byte_dump/c/common.c +++ b/level_3/byte_dump/c/common.c @@ -6,70 +6,65 @@ extern "C" { #endif #ifndef _di_byte_dump_program_version_ - const f_string_static_t byte_dump_program_version_s = macro_f_string_static_t_initialize2(BYTE_DUMP_program_version_s, 0, BYTE_DUMP_program_version_s_length); + const f_string_static_t byte_dump_program_version_s = macro_f_string_static_t_initialize(BYTE_DUMP_program_version_s, 0, BYTE_DUMP_program_version_s_length); #endif // _di_byte_dump_program_version_ #ifndef _di_byte_dump_program_name_ - const f_string_static_t byte_dump_program_name_s = macro_f_string_static_t_initialize2(BYTE_DUMP_program_name_s, 0, BYTE_DUMP_program_name_s_length); - const f_string_static_t byte_dump_program_name_long_s = macro_f_string_static_t_initialize2(BYTE_DUMP_program_name_long_s, 0, BYTE_DUMP_program_name_long_s_length); + const f_string_static_t byte_dump_program_name_s = macro_f_string_static_t_initialize(BYTE_DUMP_program_name_s, 0, BYTE_DUMP_program_name_s_length); + const f_string_static_t byte_dump_program_name_long_s = macro_f_string_static_t_initialize(BYTE_DUMP_program_name_long_s, 0, BYTE_DUMP_program_name_long_s_length); #endif // _di_byte_dump_program_name_ #ifndef _di_byte_dump_program_help_parameters_ - const f_string_static_t byte_dump_program_help_parameters_s = macro_f_string_static_t_initialize2(BYTE_DUMP_program_help_parameters_s, 0, BYTE_DUMP_program_help_parameters_s_length); + const f_string_static_t byte_dump_program_help_parameters_s = macro_f_string_static_t_initialize(BYTE_DUMP_program_help_parameters_s, 0, BYTE_DUMP_program_help_parameters_s_length); #endif // _di_byte_dump_program_help_parameters_ #ifndef _di_byte_dump_defines_ - const f_string_static_t byte_dump_character_wall_s = macro_f_string_static_t_initialize2(BYTE_DUMP_character_wall_s, 0, BYTE_DUMP_character_wall_s_length); - const f_string_static_t byte_dump_character_placeholder_s = macro_f_string_static_t_initialize2(BYTE_DUMP_character_placeholder_s, 0, BYTE_DUMP_character_placeholder_s_length); - const f_string_static_t byte_dump_character_incomplete_s = macro_f_string_static_t_initialize2(BYTE_DUMP_character_incomplete_s, 0, BYTE_DUMP_character_incomplete_s_length); - const f_string_static_t byte_dump_character_unused_s = macro_f_string_static_t_initialize2(BYTE_DUMP_character_unused_s, 0, BYTE_DUMP_character_unused_s_length); - - const f_string_static_t byte_dump_short_binary_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_binary_s, 0, BYTE_DUMP_short_binary_s_length); - const f_string_static_t byte_dump_short_decimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_decimal_s, 0, BYTE_DUMP_short_decimal_s_length); - const f_string_static_t byte_dump_short_duodecimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_duodecimal_s, 0, BYTE_DUMP_short_duodecimal_s_length); - const f_string_static_t byte_dump_short_hexidecimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_hexidecimal_s, 0, BYTE_DUMP_short_hexidecimal_s_length); - const f_string_static_t byte_dump_short_octal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_octal_s, 0, BYTE_DUMP_short_octal_s_length); - const f_string_static_t byte_dump_short_unicode_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_unicode_s, 0, BYTE_DUMP_short_unicode_s_length); - - const f_string_static_t byte_dump_short_first_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_first_s, 0, BYTE_DUMP_short_first_s_length); - const f_string_static_t byte_dump_short_last_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_last_s, 0, BYTE_DUMP_short_last_s_length); - - const f_string_static_t byte_dump_short_narrow_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_narrow_s, 0, BYTE_DUMP_short_narrow_s_length); - const f_string_static_t byte_dump_short_placeholder_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_placeholder_s, 0, BYTE_DUMP_short_placeholder_s_length); - const f_string_static_t byte_dump_short_text_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_text_s, 0, BYTE_DUMP_short_text_s_length); - const f_string_static_t byte_dump_short_wide_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_wide_s, 0, BYTE_DUMP_short_wide_s_length); - const f_string_static_t byte_dump_short_width_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_width_s, 0, BYTE_DUMP_short_width_s_length); - - const f_string_static_t byte_dump_long_binary_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_binary_s, 0, BYTE_DUMP_long_binary_s_length); - const f_string_static_t byte_dump_long_decimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_decimal_s, 0, BYTE_DUMP_long_decimal_s_length); - const f_string_static_t byte_dump_long_duodecimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_duodecimal_s, 0, BYTE_DUMP_long_duodecimal_s_length); - const f_string_static_t byte_dump_long_hexidecimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_hexidecimal_s, 0, BYTE_DUMP_long_hexidecimal_s_length); - const f_string_static_t byte_dump_long_octal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_octal_s, 0, BYTE_DUMP_long_octal_s_length); - const f_string_static_t byte_dump_long_unicode_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_unicode_s, 0, BYTE_DUMP_long_unicode_s_length); - - const f_string_static_t byte_dump_long_first_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_first_s, 0, BYTE_DUMP_long_first_s_length); - const f_string_static_t byte_dump_long_last_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_last_s, 0, BYTE_DUMP_long_last_s_length); - - const f_string_static_t byte_dump_long_narrow_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_narrow_s, 0, BYTE_DUMP_long_narrow_s_length); - const f_string_static_t byte_dump_long_placeholder_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_placeholder_s, 0, BYTE_DUMP_long_placeholder_s_length); - const f_string_static_t byte_dump_long_text_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_text_s, 0, BYTE_DUMP_long_text_s_length); - const f_string_static_t byte_dump_long_wide_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_wide_s, 0, BYTE_DUMP_long_wide_s_length); - const f_string_static_t byte_dump_long_width_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_width_s, 0, BYTE_DUMP_long_width_s_length); - - const f_string_static_t byte_dump_long_normal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_normal_s, 0, BYTE_DUMP_long_normal_s_length); - const f_string_static_t byte_dump_long_simple_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_simple_s, 0, BYTE_DUMP_long_simple_s_length); - const f_string_static_t byte_dump_long_classic_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_classic_s, 0, BYTE_DUMP_long_classic_s_length); + const f_string_static_t byte_dump_character_wall_s = macro_f_string_static_t_initialize(BYTE_DUMP_character_wall_s, 0, BYTE_DUMP_character_wall_s_length); + const f_string_static_t byte_dump_character_placeholder_s = macro_f_string_static_t_initialize(BYTE_DUMP_character_placeholder_s, 0, BYTE_DUMP_character_placeholder_s_length); + const f_string_static_t byte_dump_character_incomplete_s = macro_f_string_static_t_initialize(BYTE_DUMP_character_incomplete_s, 0, BYTE_DUMP_character_incomplete_s_length); + const f_string_static_t byte_dump_character_unused_s = macro_f_string_static_t_initialize(BYTE_DUMP_character_unused_s, 0, BYTE_DUMP_character_unused_s_length); + + const f_string_static_t byte_dump_short_binary_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_binary_s, 0, BYTE_DUMP_short_binary_s_length); + const f_string_static_t byte_dump_short_decimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_decimal_s, 0, BYTE_DUMP_short_decimal_s_length); + const f_string_static_t byte_dump_short_duodecimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_duodecimal_s, 0, BYTE_DUMP_short_duodecimal_s_length); + const f_string_static_t byte_dump_short_hexidecimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_hexidecimal_s, 0, BYTE_DUMP_short_hexidecimal_s_length); + const f_string_static_t byte_dump_short_octal_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_octal_s, 0, BYTE_DUMP_short_octal_s_length); + const f_string_static_t byte_dump_short_unicode_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_unicode_s, 0, BYTE_DUMP_short_unicode_s_length); + + const f_string_static_t byte_dump_short_first_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_first_s, 0, BYTE_DUMP_short_first_s_length); + const f_string_static_t byte_dump_short_last_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_last_s, 0, BYTE_DUMP_short_last_s_length); + + const f_string_static_t byte_dump_short_narrow_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_narrow_s, 0, BYTE_DUMP_short_narrow_s_length); + const f_string_static_t byte_dump_short_placeholder_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_placeholder_s, 0, BYTE_DUMP_short_placeholder_s_length); + const f_string_static_t byte_dump_short_text_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_text_s, 0, BYTE_DUMP_short_text_s_length); + const f_string_static_t byte_dump_short_wide_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_wide_s, 0, BYTE_DUMP_short_wide_s_length); + const f_string_static_t byte_dump_short_width_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_width_s, 0, BYTE_DUMP_short_width_s_length); + + const f_string_static_t byte_dump_long_binary_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_binary_s, 0, BYTE_DUMP_long_binary_s_length); + const f_string_static_t byte_dump_long_decimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_decimal_s, 0, BYTE_DUMP_long_decimal_s_length); + const f_string_static_t byte_dump_long_duodecimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_duodecimal_s, 0, BYTE_DUMP_long_duodecimal_s_length); + const f_string_static_t byte_dump_long_hexidecimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_hexidecimal_s, 0, BYTE_DUMP_long_hexidecimal_s_length); + const f_string_static_t byte_dump_long_octal_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_octal_s, 0, BYTE_DUMP_long_octal_s_length); + const f_string_static_t byte_dump_long_unicode_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_unicode_s, 0, BYTE_DUMP_long_unicode_s_length); + + const f_string_static_t byte_dump_long_first_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_first_s, 0, BYTE_DUMP_long_first_s_length); + const f_string_static_t byte_dump_long_last_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_last_s, 0, BYTE_DUMP_long_last_s_length); + + const f_string_static_t byte_dump_long_narrow_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_narrow_s, 0, BYTE_DUMP_long_narrow_s_length); + const f_string_static_t byte_dump_long_placeholder_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_placeholder_s, 0, BYTE_DUMP_long_placeholder_s_length); + const f_string_static_t byte_dump_long_text_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_text_s, 0, BYTE_DUMP_long_text_s_length); + const f_string_static_t byte_dump_long_wide_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_wide_s, 0, BYTE_DUMP_long_wide_s_length); + const f_string_static_t byte_dump_long_width_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_width_s, 0, BYTE_DUMP_long_width_s_length); + + const f_string_static_t byte_dump_long_normal_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_normal_s, 0, BYTE_DUMP_long_normal_s_length); + const f_string_static_t byte_dump_long_simple_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_simple_s, 0, BYTE_DUMP_long_simple_s_length); + const f_string_static_t byte_dump_long_classic_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_classic_s, 0, BYTE_DUMP_long_classic_s_length); #endif // _di_byte_dump_defines_ #ifndef _di_byte_dump_main_delete_ f_status_t byte_dump_main_delete(byte_dump_main_t * const main) { - for (f_array_length_t i = 0; i < byte_dump_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/byte_dump/c/common.h b/level_3/byte_dump/c/common.h index 7b6224c..cbd9e46 100644 --- a/level_3/byte_dump/c/common.h +++ b/level_3/byte_dump/c/common.h @@ -290,7 +290,7 @@ extern "C" { #ifndef _di_byte_dump_main_t_ typedef struct { - f_console_parameter_t parameters[byte_dump_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -313,7 +313,7 @@ extern "C" { #define byte_dump_main_t_initialize \ { \ - byte_dump_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index cf2995f..f9476ca 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -7,7 +7,7 @@ extern "C" { #endif #ifndef _di_byte_dump_file_ - f_status_t byte_dump_file(byte_dump_main_t * const main, const f_string_t file_name, const f_file_t file) { + f_status_t byte_dump_file(byte_dump_main_t * const main, const f_string_static_t file_name, const f_file_t file) { f_status_t status = F_none; @@ -37,7 +37,7 @@ extern "C" { offset = main->first % main->width; // fseek() cannot be used on a PIPE, so read instead of seek. - if (file_name) { + if (file_name.used) { byte_get = fseek(file.stream, main->first, SEEK_SET); } else { @@ -204,7 +204,7 @@ extern "C" { while (cell.column < main->width) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { f_print_terminated(" ", main->output.to.stream); } else if (main->mode == byte_dump_mode_hexidecimal_e) { @@ -226,7 +226,7 @@ extern "C" { ++cell.column; if (cell.column < main->width) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { if (!(cell.column % 4)) { f_print_dynamic(f_string_space_s, main->output.to.stream); } @@ -259,7 +259,7 @@ extern "C" { } } // while - if (main->parameters[byte_dump_parameter_text_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_text_e].result == f_console_result_found_e) { byte_dump_print_text(main, characters, invalid, &previous, &offset); } else { @@ -278,7 +278,7 @@ extern "C" { flockfile(main->error.to.stream); fl_print_format("%[Invalid UTF-8 codes were detected for file '%]", main->error.to.stream, main->context.set.error, main->context.set.error); - fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, file_name ? file_name : "-", main->context.set.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, file_name.used ? file_name : f_string_ascii_minus_s, main->context.set.notable); fl_print_format("%['.%]%q%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s, f_string_eol_s); funlockfile(main->error.to.stream); @@ -289,7 +289,7 @@ extern "C" { flockfile(main->error.to.stream); fl_print_format("%[%Qread() failed for '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); - fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, file_name ? file_name : "-", main->context.set.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, file_name.used ? file_name : f_string_ascii_minus_s, main->context.set.notable); fl_print_format("%['.%]%q%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s, f_string_eol_s); funlockfile(main->error.to.stream); @@ -334,7 +334,7 @@ extern "C" { // Pad the buffer with spaces to hide any skipped bytes (skipped via --first). while (offset_to_print && cell->column < main->width) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { f_print_terminated(" ", main->output.to.stream); } else if (main->mode == byte_dump_mode_hexidecimal_e) { @@ -357,7 +357,7 @@ extern "C" { ++cell->column; if (cell->column < main->width) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { if (!(cell->column % 4)) { f_print_dynamic(f_string_space_s, main->output.to.stream); } @@ -393,7 +393,7 @@ extern "C" { } if (cell->column < main->width) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e && !invalid[character_current]) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e && !invalid[character_current]) { if (byte_current == 1) { uint32_t unicode = 0; @@ -439,7 +439,7 @@ extern "C" { } else { if (main->mode == byte_dump_mode_hexidecimal_e) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { f_print_terminated(" ", main->output.to.stream); } @@ -451,7 +451,7 @@ extern "C" { } } else if (main->mode == byte_dump_mode_duodecimal_e) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { f_print_terminated(" ", main->output.to.stream); } @@ -463,7 +463,7 @@ extern "C" { } } else if (main->mode == byte_dump_mode_octal_e) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { f_print_terminated(" ", main->output.to.stream); } @@ -483,7 +483,7 @@ extern "C" { } } else if (main->mode == byte_dump_mode_decimal_e) { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { f_print_terminated(" ", main->output.to.stream); } @@ -508,7 +508,7 @@ extern "C" { reset = F_true; - if (main->parameters[byte_dump_parameter_text_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_text_e].result == f_console_result_found_e) { byte_dump_print_text(main, characters, invalid, previous, offset); } else { @@ -528,7 +528,7 @@ extern "C" { } } else { - if (main->parameters[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) { if (!(cell->column % 4)) { f_print_dynamic(f_string_space_s, main->output.to.stream); } @@ -577,7 +577,7 @@ extern "C" { fl_print_format(" %[%q%] ", main->output.to.stream, main->context.set.notable, byte_dump_character_wall_s, main->context.set.notable); if (*offset) { - if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_classic_e].result == f_console_result_found_e) { while (*offset && at < main->width) { f_print_dynamic(f_string_ascii_period_s, main->output.to.stream); @@ -591,7 +591,7 @@ extern "C" { } // while } else { - if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { for (; *offset && at < main->width; --(*offset), ++at) { fl_print_format("%[%q%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning); @@ -623,13 +623,13 @@ extern "C" { } if (previous->bytes) { - if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { for (; at < previous->bytes && at < main->width; ++at) { if (previous->invalid) { fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error); } - else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) { + else if (main->parameters.array[byte_dump_parameter_classic_e].result == f_console_result_found_e) { f_print_dynamic(f_string_ascii_period_s, main->output.to.stream); } else { @@ -754,7 +754,7 @@ extern "C" { } } else if (f_utf_character_is_whitespace(characters.string[i]) == F_true) { - if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_classic_e].result == f_console_result_found_e) { f_print_dynamic(f_string_ascii_period_s, main->output.to.stream); } else { @@ -769,7 +769,7 @@ extern "C" { if (main->presentation == byte_dump_presentation_classic_e) { f_print_dynamic(f_string_ascii_period_s, main->output.to.stream); } - else if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { + else if (main->parameters.array[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { fl_print_format("%[%[%q%]%]", main->output.to.stream, main->context.set.notable, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning, main->context.set.notable); } else { @@ -877,11 +877,11 @@ extern "C" { // Print placeholders when using UTF-8 characters to simulate the spaces bytes used for the character. if (width_utf > 1 && at + 1 < main->width) { - if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { if (invalid[i]) { fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error); } - else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) { + else if (main->parameters.array[byte_dump_parameter_classic_e].result == f_console_result_found_e) { f_print_dynamic(f_string_ascii_period_s, main->output.to.stream); } else { @@ -899,11 +899,11 @@ extern "C" { ++at; if (width_utf > 2 && at + 1 < main->width) { - if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { if (invalid[i]) { fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error); } - else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) { + else if (main->parameters.array[byte_dump_parameter_classic_e].result == f_console_result_found_e) { f_print_dynamic(f_string_ascii_period_s, main->output.to.stream); } else { @@ -921,11 +921,11 @@ extern "C" { ++at; if (width_utf > 3 && at + 1 < main->width) { - if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { if (invalid[i]) { fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error); } - else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) { + else if (main->parameters.array[byte_dump_parameter_classic_e].result == f_console_result_found_e) { f_print_dynamic(f_string_ascii_period_s, main->output.to.stream); } else { @@ -947,13 +947,13 @@ extern "C" { } // for // Print placeholder for the remaining parts of the line. - if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { + if (main->parameters.array[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) { for (; at < main->width; ++at) { if (invalid[at]) { fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error); } - else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) { + else if (main->parameters.array[byte_dump_parameter_classic_e].result == f_console_result_found_e) { f_print_dynamic(f_string_ascii_period_s, main->output.to.stream); } else { diff --git a/level_3/byte_dump/c/private-byte_dump.h b/level_3/byte_dump/c/private-byte_dump.h index 3483c79..c0dc156 100644 --- a/level_3/byte_dump/c/private-byte_dump.h +++ b/level_3/byte_dump/c/private-byte_dump.h @@ -30,7 +30,7 @@ extern "C" { * F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal. */ #ifndef _di_byte_dump_file_ - extern f_status_t byte_dump_file(byte_dump_main_t * const main, const f_string_t file_name, const f_file_t file) F_attribute_visibility_internal_d; + extern f_status_t byte_dump_file(byte_dump_main_t * const main, const f_string_static_t file_name, const f_file_t file) F_attribute_visibility_internal_d; #endif // _di_byte_dump_file_ /** diff --git a/level_3/control/c/common.c b/level_3/control/c/common.c index 2f5a1a1..f2b5269 100644 --- a/level_3/control/c/common.c +++ b/level_3/control/c/common.c @@ -5,33 +5,28 @@ extern "C" { #endif #ifndef _di_control_program_version_ - const f_string_static_t control_program_version_s = macro_f_string_static_t_initialize2(CONTROL_program_version_s, 0, CONTROL_program_version_s_length); + const f_string_static_t control_program_version_s = macro_f_string_static_t_initialize(CONTROL_program_version_s, 0, CONTROL_program_version_s_length); #endif // _di_control_program_version_ #ifndef _di_control_program_name_ - const f_string_static_t control_program_name_s = macro_f_string_static_t_initialize2(CONTROL_program_name_s, 0, CONTROL_program_name_s_length); - const f_string_static_t control_program_name_long_s = macro_f_string_static_t_initialize2(CONTROL_program_name_long_s, 0, CONTROL_program_name_long_s_length); + const f_string_static_t control_program_name_s = macro_f_string_static_t_initialize(CONTROL_program_name_s, 0, CONTROL_program_name_s_length); + const f_string_static_t control_program_name_long_s = macro_f_string_static_t_initialize(CONTROL_program_name_long_s, 0, CONTROL_program_name_long_s_length); #endif // _di_control_program_name_ #ifndef _di_control_defines_ - const f_string_static_t control_short_name_s = macro_f_string_static_t_initialize2(CONTROL_short_name_s, 0, CONTROL_short_name_s_length); - const f_string_static_t control_short_settings_s = macro_f_string_static_t_initialize2(CONTROL_short_settings_s, 0, CONTROL_short_settings_s_length); - const f_string_static_t control_short_socket_s = macro_f_string_static_t_initialize2(CONTROL_short_socket_s, 0, CONTROL_short_socket_s_length); + const f_string_static_t control_short_name_s = macro_f_string_static_t_initialize(CONTROL_short_name_s, 0, CONTROL_short_name_s_length); + const f_string_static_t control_short_settings_s = macro_f_string_static_t_initialize(CONTROL_short_settings_s, 0, CONTROL_short_settings_s_length); + const f_string_static_t control_short_socket_s = macro_f_string_static_t_initialize(CONTROL_short_socket_s, 0, CONTROL_short_socket_s_length); - const f_string_static_t control_long_name_s = macro_f_string_static_t_initialize2(CONTROL_long_name_s, 0, CONTROL_long_name_s_length); - const f_string_static_t control_long_settings_s = macro_f_string_static_t_initialize2(CONTROL_long_settings_s, 0, CONTROL_long_settings_s_length); - const f_string_static_t control_long_socket_s = macro_f_string_static_t_initialize2(CONTROL_long_socket_s, 0, CONTROL_long_socket_s_length); + const f_string_static_t control_long_name_s = macro_f_string_static_t_initialize(CONTROL_long_name_s, 0, CONTROL_long_name_s_length); + const f_string_static_t control_long_settings_s = macro_f_string_static_t_initialize(CONTROL_long_settings_s, 0, CONTROL_long_settings_s_length); + const f_string_static_t control_long_socket_s = macro_f_string_static_t_initialize(CONTROL_long_socket_s, 0, CONTROL_long_socket_s_length); #endif // _di_control_defines_ #ifndef _di_control_main_delete_ f_status_t control_main_delete(control_main_t * const main) { - for (f_array_length_t i = 0; i < control_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/control/c/common.h b/level_3/control/c/common.h index 1c8e8b7..5bef205 100644 --- a/level_3/control/c/common.h +++ b/level_3/control/c/common.h @@ -37,7 +37,7 @@ extern "C" { #define CONTROL_program_version_s CONTROL_program_version_major_s F_string_ascii_period_s CONTROL_program_version_minor_s F_string_ascii_period_s CONTROL_program_version_micro_s CONTROL_program_version_nano_prefix_s CONTROL_program_version_nano_s - #define CONTROL_program_version_s_length CONTROL_program_version_major_s_length + F_string_ascii_period_s_length + CONTROL_program_version_minor_s_length + F_string_ascii_period_s_length + CONTROL_program_version_nano_prefix_s_length + CONTROL_program_version_nano_s_length + #define CONTROL_program_version_s_length CONTROL_program_version_major_s_length + F_string_ascii_period_s_length + CONTROL_program_version_minor_s_length + F_string_ascii_period_s_length + CONTROL_program_version_micro_s_length + CONTROL_program_version_nano_prefix_s_length + CONTROL_program_version_nano_s_length extern const f_string_static_t control_program_version_s; #endif // _di_control_program_version_ @@ -115,7 +115,7 @@ extern "C" { #ifndef _di_control_main_t_ typedef struct { - f_console_parameter_t parameters[control_total_parameters_d]; + f_console_parameters_t parameters; uint16_t signal_check; @@ -133,7 +133,7 @@ extern "C" { #define control_main_initialize \ { \ - control_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ 0, \ f_array_lengths_t_initialize, \ F_false, \ diff --git a/level_3/control/c/control.c b/level_3/control/c/control.c index 0ced776..b86787d 100644 --- a/level_3/control/c/control.c +++ b/level_3/control/c/control.c @@ -32,8 +32,8 @@ extern "C" { fll_program_print_help_usage(main->output.to, main->context, control_program_name_s, control_command_s); - fl_print_format(" When the %[%s%q%] parameter represents a directory path then the file name is generated from either the", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, control_long_socket_s, main->context.set.notable); - fl_print_format(" %[%s%q%] parameter or from the control settings file.%q%q", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, control_long_name_s, main->context.set.notable, f_string_eol_s, f_string_eol_s); + fl_print_format(" When the %[%q%q%] parameter represents a directory path then the file name is generated from either the", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, control_long_socket_s, main->context.set.notable); + fl_print_format(" %[%q%q%] parameter or from the control settings file.%q%q", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, control_long_name_s, main->context.set.notable, f_string_eol_s, f_string_eol_s); fl_print_format(" A rule action allows for either the full rule path, such as '%[boot/root%]'", main->output.to.stream, main->context.set.notable, main->context.set.notable); fl_print_format(" as a single parameter or two parameters with the first representing the rule directory path '%[boot%]'", main->output.to.stream, main->context.set.notable, main->context.set.notable); @@ -51,87 +51,87 @@ extern "C" { f_status_t status = F_none; + f_console_parameter_t parameters[] = control_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = control_total_parameters_d; + { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, control_total_parameters_d); + f_console_parameter_id_t ids[3] = { control_parameter_no_color_e, control_parameter_light_e, control_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - { - f_console_parameter_id_t ids[3] = { control_parameter_no_color_e, control_parameter_light_e, control_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + fll_program_parameter_process_empty(&main->context, sets); + } - fll_program_parameter_process_empty(&main->context, sets); + if (F_status_is_error(status)) { + if (main->error.verbosity != f_console_verbosity_quiet_e) { + fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); + fll_print_dynamic(f_string_eol_s, main->error.to.stream); } - if (F_status_is_error(status)) { - if (main->error.verbosity != f_console_verbosity_quiet_e) { - fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - fll_print_dynamic(f_string_eol_s, main->error.to.stream); - } - - control_main_delete(main); + control_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { control_parameter_verbosity_quiet_e, control_parameter_verbosity_normal_e, control_parameter_verbosity_verbose_e, control_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { control_parameter_verbosity_quiet_e, control_parameter_verbosity_normal_e, control_parameter_verbosity_verbose_e, control_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - control_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + control_main_delete(main); - if (choice == control_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == control_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == control_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == control_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == control_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == control_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == control_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == control_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[control_parameter_help_e].result == f_console_result_found_e) { + status = F_none; + + if (main->parameters.array[control_parameter_help_e].result == f_console_result_found_e) { control_print_help(main); control_main_delete(main); @@ -139,7 +139,7 @@ extern "C" { return F_none; } - if (main->parameters[control_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[control_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, control_program_version_s); control_main_delete(main); @@ -160,19 +160,19 @@ extern "C" { control_long_socket_s }; - f_array_length_t location = f_array_length_t_initialize; + f_array_length_t index = f_array_length_t_initialize; for (uint8_t i = 0; i < 3; ++i) { - if (main->parameters[ids[i]].result == f_console_result_found_e) { + if (main->parameters.array[ids[i]].result == f_console_result_found_e) { control_print_error_parameter_value_not(main, names[i]); status = F_status_set_error(F_parameter); } - else if (main->parameters[ids[i]].result == f_console_result_additional_e) { - location = main->parameters[ids[i]].values.array[main->parameters[ids[i]].values.used - 1]; + else if (main->parameters.array[ids[i]].result == f_console_result_additional_e) { + index = main->parameters.array[ids[i]].values.array[main->parameters.array[ids[i]].values.used - 1]; - if (!strnlen(arguments->argv[location], F_console_parameter_size_d)) { + if (!main->parameters.arguments.array[index].used) { control_print_error_parameter_value_empty(main, names[i]); status = F_status_set_error(F_parameter); @@ -189,13 +189,14 @@ extern "C" { } else if (main->remaining.used) { control_data_t data = control_data_t_initialize; + data.argv = main->parameters.arguments.array; // Verify commands before attempting to connect to the socket. - if (control_command_identify(main, &data, arguments->argv[main->remaining.array[0]]) == F_found) { - status = control_command_verify(main, &data, arguments); + if (control_command_identify(main, &data, data.argv[main->remaining.array[0]]) == F_found) { + status = control_command_verify(main, &data); } else { - control_print_error_parameter_command_not(main, arguments->argv[main->remaining.array[0]]); + control_print_error_parameter_command_not(main, data.argv[main->remaining.array[0]]); status = F_status_set_error(F_parameter); } @@ -210,7 +211,7 @@ extern "C" { data.socket.type = f_socket_type_datagram_d; data.socket.length = sizeof(struct sockaddr_un); - status = control_settings_load(main, &data, arguments); + status = control_settings_load(main, &data); if (F_status_is_error_not(status)) { // @todo construct the packet, send the packet to the controller, and process the response. @@ -233,9 +234,8 @@ extern "C" { // Ensure a newline is always put at the end of the program execution, unless in quiet mode. if (main->output.verbosity != f_console_verbosity_quiet_e) { if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_interrupt) { - fflush(main->output.to.stream); - } + fflush(main->output.to.stream); + fflush(main->error.to.stream); fll_print_dynamic(f_string_eol_s, main->output.to.stream); } diff --git a/level_3/control/c/private-common.c b/level_3/control/c/private-common.c index 48e8f81..46e6f8a 100644 --- a/level_3/control/c/private-common.c +++ b/level_3/control/c/private-common.c @@ -7,35 +7,35 @@ extern "C" { #endif #ifndef _di_controller_strings_ - const f_string_static_t controller_name_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_name_socket_s, 0, CONTROLLER_name_socket_s_length); - const f_string_static_t controller_path_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_s, 0, CONTROLLER_path_socket_s_length); - const f_string_static_t controller_path_socket_prefix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_prefix_s, 0, CONTROLLER_path_socket_prefix_s_length); - const f_string_static_t controller_path_socket_suffix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_suffix_s, 0, CONTROLLER_path_socket_suffix_s_length); + const f_string_static_t controller_name_socket_s = macro_f_string_static_t_initialize(CONTROLLER_name_socket_s, 0, CONTROLLER_name_socket_s_length); + const f_string_static_t controller_path_socket_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_s, 0, CONTROLLER_path_socket_s_length); + const f_string_static_t controller_path_socket_prefix_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_prefix_s, 0, CONTROLLER_path_socket_prefix_s_length); + const f_string_static_t controller_path_socket_suffix_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_suffix_s, 0, CONTROLLER_path_socket_suffix_s_length); #endif // _di_controller_strings_ #ifndef _di_control_strings_s_ - const f_string_static_t control_path_settings_s = macro_f_string_static_t_initialize2(CONTROL_path_settings_s, 0, CONTROL_path_settings_s_length); - - const f_string_static_t control_command_s = macro_f_string_static_t_initialize2(CONTROL_command_s, 0, CONTROL_command_s_length); - const f_string_static_t control_default_s = macro_f_string_static_t_initialize2(CONTROL_default_s, 0, CONTROL_default_s_length); - const f_string_static_t control_name_socket_s = macro_f_string_static_t_initialize2(CONTROL_name_socket_s, 0, CONTROL_name_socket_s_length); - const f_string_static_t control_path_socket_s = macro_f_string_static_t_initialize2(CONTROL_path_socket_s, 0, CONTROL_path_socket_s_length); - const f_string_static_t control_path_socket_prefix_s = macro_f_string_static_t_initialize2(CONTROL_path_socket_prefix_s, 0, CONTROL_path_socket_prefix_s_length); - const f_string_static_t control_path_socket_suffix_s = macro_f_string_static_t_initialize2(CONTROL_path_socket_suffix_s, 0, CONTROL_path_socket_suffix_s_length); - - const f_string_static_t control_error_s = macro_f_string_static_t_initialize2(CONTROL_error_s, 0, CONTROL_error_s_length); - const f_string_static_t control_freeze_s = macro_f_string_static_t_initialize2(CONTROL_freeze_s, 0, CONTROL_freeze_s_length); - const f_string_static_t control_kill_s = macro_f_string_static_t_initialize2(CONTROL_kill_s, 0, CONTROL_kill_s_length); - const f_string_static_t control_pause_s = macro_f_string_static_t_initialize2(CONTROL_pause_s, 0, CONTROL_pause_s_length); - const f_string_static_t control_reboot_s = macro_f_string_static_t_initialize2(CONTROL_reboot_s, 0, CONTROL_reboot_s_length); - const f_string_static_t control_reload_s = macro_f_string_static_t_initialize2(CONTROL_reload_s, 0, CONTROL_reload_s_length); - const f_string_static_t control_rerun_s = macro_f_string_static_t_initialize2(CONTROL_rerun_s, 0, CONTROL_rerun_s_length); - const f_string_static_t control_restart_s = macro_f_string_static_t_initialize2(CONTROL_restart_s, 0, CONTROL_restart_s_length); - const f_string_static_t control_resume_s = macro_f_string_static_t_initialize2(CONTROL_resume_s, 0, CONTROL_resume_s_length); - const f_string_static_t control_shutdown_s = macro_f_string_static_t_initialize2(CONTROL_shutdown_s, 0, CONTROL_shutdown_s_length); - const f_string_static_t control_start_s = macro_f_string_static_t_initialize2(CONTROL_start_s, 0, CONTROL_start_s_length); - const f_string_static_t control_stop_s = macro_f_string_static_t_initialize2(CONTROL_stop_s, 0, CONTROL_stop_s_length); - const f_string_static_t control_thaw_s = macro_f_string_static_t_initialize2(CONTROL_thaw_s, 0, CONTROL_thaw_s_length); + const f_string_static_t control_path_settings_s = macro_f_string_static_t_initialize(CONTROL_path_settings_s, 0, CONTROL_path_settings_s_length); + + const f_string_static_t control_command_s = macro_f_string_static_t_initialize(CONTROL_command_s, 0, CONTROL_command_s_length); + const f_string_static_t control_default_s = macro_f_string_static_t_initialize(CONTROL_default_s, 0, CONTROL_default_s_length); + const f_string_static_t control_name_socket_s = macro_f_string_static_t_initialize(CONTROL_name_socket_s, 0, CONTROL_name_socket_s_length); + const f_string_static_t control_path_socket_s = macro_f_string_static_t_initialize(CONTROL_path_socket_s, 0, CONTROL_path_socket_s_length); + const f_string_static_t control_path_socket_prefix_s = macro_f_string_static_t_initialize(CONTROL_path_socket_prefix_s, 0, CONTROL_path_socket_prefix_s_length); + const f_string_static_t control_path_socket_suffix_s = macro_f_string_static_t_initialize(CONTROL_path_socket_suffix_s, 0, CONTROL_path_socket_suffix_s_length); + + const f_string_static_t control_error_s = macro_f_string_static_t_initialize(CONTROL_error_s, 0, CONTROL_error_s_length); + const f_string_static_t control_freeze_s = macro_f_string_static_t_initialize(CONTROL_freeze_s, 0, CONTROL_freeze_s_length); + const f_string_static_t control_kill_s = macro_f_string_static_t_initialize(CONTROL_kill_s, 0, CONTROL_kill_s_length); + const f_string_static_t control_pause_s = macro_f_string_static_t_initialize(CONTROL_pause_s, 0, CONTROL_pause_s_length); + const f_string_static_t control_reboot_s = macro_f_string_static_t_initialize(CONTROL_reboot_s, 0, CONTROL_reboot_s_length); + const f_string_static_t control_reload_s = macro_f_string_static_t_initialize(CONTROL_reload_s, 0, CONTROL_reload_s_length); + const f_string_static_t control_rerun_s = macro_f_string_static_t_initialize(CONTROL_rerun_s, 0, CONTROL_rerun_s_length); + const f_string_static_t control_restart_s = macro_f_string_static_t_initialize(CONTROL_restart_s, 0, CONTROL_restart_s_length); + const f_string_static_t control_resume_s = macro_f_string_static_t_initialize(CONTROL_resume_s, 0, CONTROL_resume_s_length); + const f_string_static_t control_shutdown_s = macro_f_string_static_t_initialize(CONTROL_shutdown_s, 0, CONTROL_shutdown_s_length); + const f_string_static_t control_start_s = macro_f_string_static_t_initialize(CONTROL_start_s, 0, CONTROL_start_s_length); + const f_string_static_t control_stop_s = macro_f_string_static_t_initialize(CONTROL_stop_s, 0, CONTROL_stop_s_length); + const f_string_static_t control_thaw_s = macro_f_string_static_t_initialize(CONTROL_thaw_s, 0, CONTROL_thaw_s_length); #endif // _di_control_strings_s_ #ifndef _di_control_data_delete_ diff --git a/level_3/control/c/private-common.h b/level_3/control/c/private-common.h index 52dc250..f03e624 100644 --- a/level_3/control/c/private-common.h +++ b/level_3/control/c/private-common.h @@ -239,6 +239,7 @@ extern "C" { * command: The command type code. * cache: A cache. * socket: A socket used to connect to the controller. + * argv: The argument structure in control_main_t.parameters for simplifying syntax. */ #ifndef _di_control_data_t_ typedef struct { @@ -247,6 +248,8 @@ extern "C" { control_cache_t cache; f_socket_t socket; + + f_string_static_t *argv; } control_data_t; #define control_data_t_initialize \ @@ -254,6 +257,7 @@ extern "C" { 0, \ f_string_dynamic_t_initialize, \ f_socket_t_initialize, \ + 0, \ } #endif // _di_control_data_t_ diff --git a/level_3/control/c/private-control.c b/level_3/control/c/private-control.c index 762479d..29e8a8e 100644 --- a/level_3/control/c/private-control.c +++ b/level_3/control/c/private-control.c @@ -8,78 +8,75 @@ extern "C" { #endif #ifndef _di_control_command_identify_ - f_status_t control_command_identify(control_main_t * const main, control_data_t * const data, const f_string_t command) { + f_status_t control_command_identify(control_main_t * const main, control_data_t * const data, const f_string_static_t command) { - const f_string_static_t command_string = macro_f_string_static_t_initialize2(command, 0, strnlen(command, F_console_parameter_size_d)); - - - if (fl_string_dynamic_compare(command_string, control_freeze_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_freeze_s) == F_equal_to) { data->command = control_command_type_freeze_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_kill_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_kill_s) == F_equal_to) { data->command = control_command_type_kill_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_pause_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_pause_s) == F_equal_to) { data->command = control_command_type_pause_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_reboot_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_reboot_s) == F_equal_to) { data->command = control_command_type_reboot_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_reload_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_reload_s) == F_equal_to) { data->command = control_command_type_reload_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_rerun_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_rerun_s) == F_equal_to) { data->command = control_command_type_rerun_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_restart_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_restart_s) == F_equal_to) { data->command = control_command_type_restart_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_resume_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_resume_s) == F_equal_to) { data->command = control_command_type_resume_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_shutdown_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_shutdown_s) == F_equal_to) { data->command = control_command_type_shutdown_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_start_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_start_s) == F_equal_to) { data->command = control_command_type_start_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_stop_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_stop_s) == F_equal_to) { data->command = control_command_type_stop_e; return F_found; } - if (fl_string_dynamic_compare(command_string, control_thaw_s) == F_equal_to) { + if (fl_string_dynamic_compare(command, control_thaw_s) == F_equal_to) { data->command = control_command_type_thaw_e; return F_found; @@ -90,7 +87,7 @@ extern "C" { #endif // _di_control_command_identify_ #ifndef _di_control_command_verify_ - f_status_t control_command_verify(control_main_t * const main, control_data_t * const data, const f_console_arguments_t *arguments) { + f_status_t control_command_verify(control_main_t * const main, control_data_t * const data) { switch (data->command) { case control_command_type_freeze_e: @@ -104,30 +101,30 @@ extern "C" { case control_command_type_stop_e: case control_command_type_thaw_e: if (main->remaining.used < 2) { - control_print_error_parameter_command_rule_not(main, arguments->argv[0]); + control_print_error_parameter_command_rule_not(main, data->argv[main->remaining.array[0]]); return F_status_set_error(F_parameter); } else if (main->remaining.used > 3) { - control_print_error_parameter_command_rule_too_many(main, arguments->argv[0]); + control_print_error_parameter_command_rule_too_many(main, data->argv[main->remaining.array[0]]); return F_status_set_error(F_parameter); } - if (!strnlen(arguments->argv[main->remaining.array[1]], F_console_parameter_size_d)) { + if (!data->argv[main->remaining.array[1]].used) { if (main->remaining.used == 2) { - control_print_error_parameter_command_rule_empty(main, arguments->argv[0]); + control_print_error_parameter_command_rule_empty(main, data->argv[main->remaining.array[0]]); } else { - control_print_error_parameter_command_rule_directory_empty(main, arguments->argv[0]); + control_print_error_parameter_command_rule_directory_empty(main, data->argv[main->remaining.array[0]]); } return F_status_set_error(F_parameter); } if (main->remaining.used == 3) { - if (!strnlen(arguments->argv[main->remaining.array[2]], F_console_parameter_size_d)) { - control_print_error_parameter_command_rule_basename_empty(main, arguments->argv[0]); + if (!data->argv[main->remaining.array[2]].used) { + control_print_error_parameter_command_rule_basename_empty(main, data->argv[main->remaining.array[0]]); return F_status_set_error(F_parameter); } @@ -149,28 +146,23 @@ extern "C" { #endif // _di_control_command_verify_ #ifndef _di_control_settings_load_ - f_status_t control_settings_load(control_main_t * const main, control_data_t * const data, const f_console_arguments_t *arguments) { + f_status_t control_settings_load(control_main_t * const main, control_data_t * const data) { f_status_t status = F_none; data->cache.buffer_small.used = 0; - if (main->parameters[control_parameter_socket_e].result == f_console_result_additional_e) { - const f_array_length_t location = main->parameters[control_parameter_settings_e].values.array[main->parameters[control_parameter_settings_e].values.used - 1]; + if (main->parameters.array[control_parameter_socket_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[control_parameter_settings_e].values.array[main->parameters.array[control_parameter_settings_e].values.used - 1]; - status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], F_console_parameter_size_d), &data->cache.buffer_small); + status = f_string_dynamic_append(data->argv[index], &data->cache.buffer_small); } else { - status = f_string_dynamic_append_nulless(control_path_settings_s, &data->cache.buffer_small); + status = f_string_dynamic_append(control_path_settings_s, &data->cache.buffer_small); } if (F_status_is_error(status)) { - if (main->parameters[control_parameter_socket_e].result == f_console_result_additional_e) { - fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true); - } - else { - fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); - } + fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true); return status; } @@ -178,10 +170,10 @@ extern "C" { { f_file_t file = f_file_t_initialize; - status = f_file_stream_open(data->cache.buffer_small.string, f_file_open_mode_read_s.string, &file); + status = f_file_stream_open(data->cache.buffer_small, f_file_open_mode_read_s, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data->cache.buffer_small.string, "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data->cache.buffer_small, f_file_operation_open_s, fll_error_file_type_file_e); return status; } @@ -191,7 +183,7 @@ extern "C" { f_file_stream_close(F_true, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data->cache.buffer_small.string, "read", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data->cache.buffer_small, f_file_operation_read_s, fll_error_file_type_file_e); return status; } @@ -206,13 +198,13 @@ extern "C" { status = fll_fss_extended_read(data->cache.buffer_large, state, &range, &objects, &contents, 0, 0, &delimits, 0); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, data->cache.buffer_small.string, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, data->cache.buffer_small, f_file_operation_process_s, fll_error_file_type_file_e); } else { status = fl_fss_apply_delimit(delimits, &data->cache.buffer_large); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, data->cache.buffer_small.string, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, data->cache.buffer_small, f_file_operation_process_s, fll_error_file_type_file_e); } } @@ -251,27 +243,24 @@ extern "C" { data->cache.buffer_small.used = 0; - if (main->parameters[control_parameter_socket_e].result == f_console_result_additional_e) { - const f_array_length_t location = main->parameters[control_parameter_socket_e].values.array[main->parameters[control_parameter_socket_e].values.used - 1]; + if (main->parameters.array[control_parameter_socket_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[control_parameter_socket_e].values.array[main->parameters.array[control_parameter_socket_e].values.used - 1]; - status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], F_console_parameter_size_d), &data->cache.buffer_small); + status = f_string_dynamic_append(data->argv[index], &data->cache.buffer_small); } else if (parameter_hass[1]) { status = f_string_dynamic_partial_append_nulless(data->cache.buffer_large, objects.array[parameter_ats[1]], &data->cache.buffer_small); } else { - status = f_string_dynamic_append_nulless(controller_path_socket_s, &data->cache.buffer_small); + status = f_string_dynamic_append(controller_path_socket_s, &data->cache.buffer_small); } if (F_status_is_error(status)) { - if (main->parameters[control_parameter_socket_e].result == f_console_result_additional_e) { - fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true); - } - else if (parameter_hass[1]) { - fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); + if (main->parameters.array[control_parameter_socket_e].result == f_console_result_additional_e || !parameter_hass[1]) { + fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true); } else { - fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); } } else { @@ -282,11 +271,11 @@ extern "C" { } } - status = f_file_exists(data->cache.buffer_small.string); + status = f_file_exists(data->cache.buffer_small); if (F_status_is_error(status) || status == F_false) { if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, data->cache.buffer_small.string, "find", fll_error_file_type_directory_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, data->cache.buffer_small, f_file_operation_find_s, fll_error_file_type_directory_e); if (main->error.verbosity != f_console_verbosity_quiet_e) { fll_print_dynamic(f_string_eol_s, main->error.to.stream); @@ -299,7 +288,7 @@ extern "C" { } // Construct the file name when the socket path is a directory. - else if (f_file_is(data->cache.buffer_small.string, F_file_type_directory_d, F_true) == F_true) { + else if (f_file_is(data->cache.buffer_small, F_file_type_directory_d, F_true) == F_true) { status = f_string_dynamic_append_assure(f_path_separator_s, &data->cache.buffer_small); if (F_status_is_error(status)) { @@ -326,10 +315,10 @@ extern "C" { for (uint8_t i = 0; i < 3; ++i) { - if (append_ids[i] && main->parameters[append_ids[i]].result == f_console_result_additional_e) { - const f_array_length_t location = main->parameters[append_ids[i]].values.array[main->parameters[append_ids[i]].values.used - 1]; + if (append_ids[i] && main->parameters.array[append_ids[i]].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[append_ids[i]].values.array[main->parameters.array[append_ids[i]].values.used - 1]; - status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], F_console_parameter_size_d), &data->cache.buffer_small); + status = f_string_dynamic_append(data->argv[index], &data->cache.buffer_small); } else if (append_hass[i]) { status = f_string_dynamic_partial_append_nulless(data->cache.buffer_large, objects.array[append_hass[i]], &data->cache.buffer_small); @@ -339,14 +328,11 @@ extern "C" { } if (F_status_is_error(status)) { - if (append_ids[i] && main->parameters[append_ids[i]].result == f_console_result_additional_e) { - fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true); - } - else if (append_hass[i]) { - fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); + if (append_ids[i] && main->parameters.array[append_ids[i]].result == f_console_result_additional_e || !append_hass[i]) { + fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true); } else { - fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); } break; @@ -362,11 +348,11 @@ extern "C" { } if (F_status_is_error_not(status)) { - status = f_file_exists(data->cache.buffer_small.string); + status = f_file_exists(data->cache.buffer_small); if (F_status_is_error(status) || status == F_false) { if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, data->cache.buffer_small.string, "find", fll_error_file_type_directory_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, data->cache.buffer_small, f_file_operation_find_s, fll_error_file_type_directory_e); if (main->error.verbosity != f_console_verbosity_quiet_e) { fll_print_dynamic(f_string_eol_s, main->error.to.stream); @@ -380,7 +366,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (f_file_is(data->cache.buffer_small.string, F_file_type_socket_d, F_true) == F_false) { + if (f_file_is(data->cache.buffer_small, F_file_type_socket_d, F_true) == F_false) { control_print_error_socket_file_not(main, data->cache.buffer_small); status = F_status_set_error(F_socket_not); diff --git a/level_3/control/c/private-control.h b/level_3/control/c/private-control.h index 0398212..3481458 100644 --- a/level_3/control/c/private-control.h +++ b/level_3/control/c/private-control.h @@ -28,7 +28,7 @@ extern "C" { * F_found_not if name is unknown. */ #ifndef _di_control_command_identify_ - extern f_status_t control_command_identify(control_main_t * const main, control_data_t * const data, const f_string_t command) F_attribute_visibility_internal_d; + extern f_status_t control_command_identify(control_main_t * const main, control_data_t * const data, const f_string_static_t command) F_attribute_visibility_internal_d; #endif // _di_control_command_identify_ /** @@ -38,11 +38,9 @@ extern "C" { * The main program data. * @param data * The control data. - * @param arguments - * The main program arguments. */ #ifndef _di_control_command_verify_ - extern f_status_t control_command_verify(control_main_t * const main, control_data_t * const data, const f_console_arguments_t *arguments) F_attribute_visibility_internal_d; + extern f_status_t control_command_verify(control_main_t * const main, control_data_t * const data) F_attribute_visibility_internal_d; #endif // _di_control_command_verify_ /** * Load and process the control settings file. @@ -53,8 +51,6 @@ extern "C" { * The main program data. * @param data * The control data. - * @param arguments - * The main program arguments. * * @return * F_none on success. @@ -91,7 +87,7 @@ extern "C" { * @see fll_fss_extended_read() */ #ifndef _di_control_settings_load_ - extern f_status_t control_settings_load(control_main_t * const main, control_data_t * const data, const f_console_arguments_t *arguments) F_attribute_visibility_internal_d; + extern f_status_t control_settings_load(control_main_t * const main, control_data_t * const data) F_attribute_visibility_internal_d; #endif // _di_control_settings_load_ #ifdef __cplusplus diff --git a/level_3/control/c/private-print.c b/level_3/control/c/private-print.c index 9ce56a1..70a2d44 100644 --- a/level_3/control/c/private-print.c +++ b/level_3/control/c/private-print.c @@ -7,14 +7,14 @@ extern "C" { #endif #ifndef _di_control_print_error_parameter_command_not_ - void control_print_error_parameter_command_not(control_main_t * const main, const f_string_t command) { + void control_print_error_parameter_command_not(control_main_t * const main, const f_string_static_t command) { if (main->error.verbosity == f_console_verbosity_quiet_e) return; flockfile(main->error.to.stream); - fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); - fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); + fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); fl_print_format("%[' is not a known controller command.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); funlockfile(main->error.to.stream); @@ -22,14 +22,14 @@ extern "C" { #endif // _di_control_print_error_parameter_command_not_ #ifndef _di_control_print_error_parameter_command_rule_basename_empty_ - void control_print_error_parameter_command_rule_basename_empty(control_main_t * const main, const f_string_t command) { + void control_print_error_parameter_command_rule_basename_empty(control_main_t * const main, const f_string_static_t command) { if (main->error.verbosity == f_console_verbosity_quiet_e) return; flockfile(main->error.to.stream); - fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); - fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); + fl_print_format("%q%[%QThe command parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); fl_print_format("%[' a rule base name cannot be an empty string.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); funlockfile(main->error.to.stream); @@ -37,14 +37,14 @@ extern "C" { #endif // _di_control_print_error_parameter_command_rule_basename_empty_ #ifndef _di_control_print_error_parameter_command_rule_directory_empty_ - void control_print_error_parameter_command_rule_directory_empty(control_main_t * const main, const f_string_t command) { + void control_print_error_parameter_command_rule_directory_empty(control_main_t * const main, const f_string_static_t command) { if (main->error.verbosity == f_console_verbosity_quiet_e) return; flockfile(main->error.to.stream); - fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); - fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); + fl_print_format("%q%[%QThe command parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); fl_print_format("%[' a rule directory path cannot be an empty string.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); funlockfile(main->error.to.stream); @@ -52,14 +52,14 @@ extern "C" { #endif // _di_control_print_error_parameter_command_rule_directory_empty_ #ifndef _di_control_print_error_parameter_command_rule_empty_ - void control_print_error_parameter_command_rule_empty(control_main_t * const main, const f_string_t command) { + void control_print_error_parameter_command_rule_empty(control_main_t * const main, const f_string_static_t command) { if (main->error.verbosity == f_console_verbosity_quiet_e) return; flockfile(main->error.to.stream); - fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); - fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); + fl_print_format("%q%[%QThe command parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); fl_print_format("%[' a rule name cannot be an empty string.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); funlockfile(main->error.to.stream); @@ -67,14 +67,14 @@ extern "C" { #endif // _di_control_print_error_parameter_command_rule_empty_ #ifndef _di_control_print_error_parameter_command_rule_not_ - void control_print_error_parameter_command_rule_not(control_main_t * const main, const f_string_t command) { + void control_print_error_parameter_command_rule_not(control_main_t * const main, const f_string_static_t command) { if (main->error.verbosity == f_console_verbosity_quiet_e) return; flockfile(main->error.to.stream); - fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); - fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); + fl_print_format("%q%[%QThe command parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); fl_print_format("%[' requires either a full rule name or a rule directory path along with the rule base name.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); funlockfile(main->error.to.stream); @@ -82,14 +82,14 @@ extern "C" { #endif // _di_control_print_error_parameter_command_rule_not_ #ifndef _di_control_print_error_parameter_command_rule_too_many_ - void control_print_error_parameter_command_rule_too_many(control_main_t * const main, const f_string_t command) { + void control_print_error_parameter_command_rule_too_many(control_main_t * const main, const f_string_static_t command) { if (main->error.verbosity == f_console_verbosity_quiet_e) return; flockfile(main->error.to.stream); - fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); - fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); + fl_print_format("%q%[%QThe command parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable); fl_print_format("%[' has too many arguments.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); funlockfile(main->error.to.stream); @@ -101,7 +101,7 @@ extern "C" { if (main->error.verbosity == f_console_verbosity_quiet_e) return; - fll_print_format("%[%QNo commands are provided.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s); + fll_print_format("%q%[%QNo commands provided.%]%q", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s); } #endif // _di_control_print_error_commands_none_ @@ -112,7 +112,7 @@ extern "C" { flockfile(main->error.to.stream); - fl_print_format("%[%QThe value for the parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, parameter, main->context.set.notable); fl_print_format("%[' must not be an empty string.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); @@ -127,7 +127,7 @@ extern "C" { flockfile(main->error.to.stream); - fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, parameter, main->context.set.notable); fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); @@ -140,7 +140,7 @@ extern "C" { if (main->error.verbosity == f_console_verbosity_quiet_e) return; - fll_print_format("%[%QPipe input is not supported by this program.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s); + fll_print_format("%q%[%QPipe input is not supported by this program.%]%q", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s); } #endif // _di_control_print_error_pipe_supported_not_ @@ -151,7 +151,7 @@ extern "C" { flockfile(main->error.to.stream); - fl_print_format("%[%QFailed to connect to the socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%q%[%QFailed to connect to the socket file '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable); fl_print_format("%['.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); @@ -166,7 +166,7 @@ extern "C" { flockfile(main->error.to.stream); - fl_print_format("%[%QThe controller socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%q%[%QThe controller socket file '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable); fl_print_format("%[' could not be found and is required.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); @@ -181,7 +181,7 @@ extern "C" { flockfile(main->error.to.stream); - fl_print_format("%[%QThe controller socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error); + fl_print_format("%q%[%QThe controller socket file '%]", main->error.to.stream, f_string_eol_s, main->context.set.error, main->error.prefix, main->context.set.error); fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable); fl_print_format("%[' is not a socket file.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); diff --git a/level_3/control/c/private-print.h b/level_3/control/c/private-print.h index a74ec61..24f435a 100644 --- a/level_3/control/c/private-print.h +++ b/level_3/control/c/private-print.h @@ -21,7 +21,7 @@ extern "C" { * The parameter representing a command. */ #ifndef _di_control_print_error_parameter_command_not_ - extern void control_print_error_parameter_command_not(control_main_t * const main, const f_string_t command) F_attribute_visibility_internal_d; + extern void control_print_error_parameter_command_not(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d; #endif // _di_control_print_error_parameter_command_not_ /** @@ -33,7 +33,7 @@ extern "C" { * The parameter representing a command. */ #ifndef _di_control_print_error_parameter_command_rule_basename_empty_ - extern void control_print_error_parameter_command_rule_basename_empty(control_main_t * const main, const f_string_t command) F_attribute_visibility_internal_d; + extern void control_print_error_parameter_command_rule_basename_empty(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d; #endif // _di_control_print_error_parameter_command_rule_basename_empty_ /** @@ -45,7 +45,7 @@ extern "C" { * The parameter representing a command. */ #ifndef _di_control_print_error_parameter_command_rule_directory_empty_ - extern void control_print_error_parameter_command_rule_directory_empty(control_main_t * const main, const f_string_t command) F_attribute_visibility_internal_d; + extern void control_print_error_parameter_command_rule_directory_empty(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d; #endif // _di_control_print_error_parameter_command_rule_directory_empty_ /** @@ -57,7 +57,7 @@ extern "C" { * The parameter representing a command. */ #ifndef _di_control_print_error_parameter_command_rule_empty_ - extern void control_print_error_parameter_command_rule_empty(control_main_t * const main, const f_string_t command) F_attribute_visibility_internal_d; + extern void control_print_error_parameter_command_rule_empty(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d; #endif // _di_control_print_error_parameter_command_rule_empty_ /** @@ -69,7 +69,7 @@ extern "C" { * The parameter representing a command. */ #ifndef _di_control_print_error_parameter_command_rule_not_ - extern void control_print_error_parameter_command_rule_not(control_main_t * const main, const f_string_t command) F_attribute_visibility_internal_d; + extern void control_print_error_parameter_command_rule_not(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d; #endif // _di_control_print_error_parameter_command_rule_not_ /** @@ -81,7 +81,7 @@ extern "C" { * The parameter representing a command. */ #ifndef _di_control_print_error_parameter_command_rule_too_many_ - extern void control_print_error_parameter_command_rule_too_many(control_main_t * const main, const f_string_t command) F_attribute_visibility_internal_d; + extern void control_print_error_parameter_command_rule_too_many(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d; #endif // _di_control_print_error_parameter_command_rule_too_many_ /** diff --git a/level_3/controller/c/common.c b/level_3/controller/c/common.c index 9aba2e9..2d35ced 100644 --- a/level_3/controller/c/common.c +++ b/level_3/controller/c/common.c @@ -5,62 +5,57 @@ extern "C" { #endif #ifndef _di_controller_program_version_ - const f_string_static_t controller_program_version_s = macro_f_string_static_t_initialize2(CONTROLLER_program_version_s, 0, CONTROLLER_program_version_s_length); + const f_string_static_t controller_program_version_s = macro_f_string_static_t_initialize(CONTROLLER_program_version_s, 0, CONTROLLER_program_version_s_length); #endif // _di_controller_program_version_ #ifndef _di_controller_program_name_ - const f_string_static_t controller_program_name_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_s, 0, CONTROLLER_program_name_s_length); - const f_string_static_t controller_program_name_long_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_long_s, 0, CONTROLLER_program_name_long_s_length); + const f_string_static_t controller_program_name_s = macro_f_string_static_t_initialize(CONTROLLER_program_name_s, 0, CONTROLLER_program_name_s_length); + const f_string_static_t controller_program_name_long_s = macro_f_string_static_t_initialize(CONTROLLER_program_name_long_s, 0, CONTROLLER_program_name_long_s_length); - const f_string_static_t controller_program_name_init_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_init_s, 0, CONTROLLER_program_name_init_s_length); - const f_string_static_t controller_program_name_init_long_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_init_long_s, 0, CONTROLLER_program_name_init_long_s_length); + const f_string_static_t controller_program_name_init_s = macro_f_string_static_t_initialize(CONTROLLER_program_name_init_s, 0, CONTROLLER_program_name_init_s_length); + const f_string_static_t controller_program_name_init_long_s = macro_f_string_static_t_initialize(CONTROLLER_program_name_init_long_s, 0, CONTROLLER_program_name_init_long_s_length); #endif // _di_controller_program_name_ #ifndef _di_controller_defines_ - const f_string_static_t controller_default_program_script_s = macro_f_string_static_t_initialize2(CONTROLLER_default_program_script_s, 0, CONTROLLER_default_program_script_s_length); - const f_string_static_t controller_path_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_s, 0, CONTROLLER_path_pid_s_length); - const f_string_static_t controller_path_pid_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_init_s, 0, CONTROLLER_path_pid_init_s_length); - const f_string_static_t controller_path_pid_prefix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_prefix_s, 0, CONTROLLER_path_pid_prefix_s_length); - const f_string_static_t controller_path_pid_suffix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_suffix_s, 0, CONTROLLER_path_pid_suffix_s_length); - const f_string_static_t controller_path_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_path_settings_s, 0, CONTROLLER_path_settings_s_length); - const f_string_static_t controller_path_settings_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_settings_init_s, 0, CONTROLLER_path_settings_init_s_length); - const f_string_static_t controller_path_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_s, 0, CONTROLLER_path_socket_s_length); - const f_string_static_t controller_path_socket_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_init_s, 0, CONTROLLER_path_socket_s_length); - const f_string_static_t controller_path_socket_prefix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_prefix_s, 0, CONTROLLER_path_socket_prefix_s_length); - const f_string_static_t controller_path_socket_suffix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_suffix_s, 0, CONTROLLER_path_socket_suffix_s_length); + const f_string_static_t controller_default_program_script_s = macro_f_string_static_t_initialize(CONTROLLER_default_program_script_s, 0, CONTROLLER_default_program_script_s_length); + const f_string_static_t controller_path_pid_s = macro_f_string_static_t_initialize(CONTROLLER_path_pid_s, 0, CONTROLLER_path_pid_s_length); + const f_string_static_t controller_path_pid_init_s = macro_f_string_static_t_initialize(CONTROLLER_path_pid_init_s, 0, CONTROLLER_path_pid_init_s_length); + const f_string_static_t controller_path_pid_prefix_s = macro_f_string_static_t_initialize(CONTROLLER_path_pid_prefix_s, 0, CONTROLLER_path_pid_prefix_s_length); + const f_string_static_t controller_path_pid_suffix_s = macro_f_string_static_t_initialize(CONTROLLER_path_pid_suffix_s, 0, CONTROLLER_path_pid_suffix_s_length); + const f_string_static_t controller_path_settings_s = macro_f_string_static_t_initialize(CONTROLLER_path_settings_s, 0, CONTROLLER_path_settings_s_length); + const f_string_static_t controller_path_settings_init_s = macro_f_string_static_t_initialize(CONTROLLER_path_settings_init_s, 0, CONTROLLER_path_settings_init_s_length); + const f_string_static_t controller_path_socket_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_s, 0, CONTROLLER_path_socket_s_length); + const f_string_static_t controller_path_socket_init_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_init_s, 0, CONTROLLER_path_socket_s_length); + const f_string_static_t controller_path_socket_prefix_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_prefix_s, 0, CONTROLLER_path_socket_prefix_s_length); + const f_string_static_t controller_path_socket_suffix_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_suffix_s, 0, CONTROLLER_path_socket_suffix_s_length); - const f_string_static_t controller_short_cgroup_s = macro_f_string_static_t_initialize2(CONTROLLER_short_cgroup_s, 0, CONTROLLER_short_cgroup_s_length); - const f_string_static_t controller_short_daemon_s = macro_f_string_static_t_initialize2(CONTROLLER_short_daemon_s, 0, CONTROLLER_short_daemon_s_length); - const f_string_static_t controller_short_init_s = macro_f_string_static_t_initialize2(CONTROLLER_short_init_s, 0, CONTROLLER_short_init_s_length); - const f_string_static_t controller_short_interruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_short_interruptible_s, 0, CONTROLLER_short_interruptible_s_length); - const f_string_static_t controller_short_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_short_pid_s, 0, CONTROLLER_short_pid_s_length); - const f_string_static_t controller_short_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_short_settings_s, 0, CONTROLLER_short_settings_s_length); - const f_string_static_t controller_short_simulate_s = macro_f_string_static_t_initialize2(CONTROLLER_short_simulate_s, 0, CONTROLLER_short_simulate_s_length); - const f_string_static_t controller_short_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_short_socket_s, 0, CONTROLLER_short_socket_s_length); - const f_string_static_t controller_short_uninterruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_short_uninterruptible_s, 0, CONTROLLER_short_uninterruptible_s_length); - const f_string_static_t controller_short_validate_s = macro_f_string_static_t_initialize2(CONTROLLER_short_validate_s, 0, CONTROLLER_short_validate_s_length); + const f_string_static_t controller_short_cgroup_s = macro_f_string_static_t_initialize(CONTROLLER_short_cgroup_s, 0, CONTROLLER_short_cgroup_s_length); + const f_string_static_t controller_short_daemon_s = macro_f_string_static_t_initialize(CONTROLLER_short_daemon_s, 0, CONTROLLER_short_daemon_s_length); + const f_string_static_t controller_short_init_s = macro_f_string_static_t_initialize(CONTROLLER_short_init_s, 0, CONTROLLER_short_init_s_length); + const f_string_static_t controller_short_interruptible_s = macro_f_string_static_t_initialize(CONTROLLER_short_interruptible_s, 0, CONTROLLER_short_interruptible_s_length); + const f_string_static_t controller_short_pid_s = macro_f_string_static_t_initialize(CONTROLLER_short_pid_s, 0, CONTROLLER_short_pid_s_length); + const f_string_static_t controller_short_settings_s = macro_f_string_static_t_initialize(CONTROLLER_short_settings_s, 0, CONTROLLER_short_settings_s_length); + const f_string_static_t controller_short_simulate_s = macro_f_string_static_t_initialize(CONTROLLER_short_simulate_s, 0, CONTROLLER_short_simulate_s_length); + const f_string_static_t controller_short_socket_s = macro_f_string_static_t_initialize(CONTROLLER_short_socket_s, 0, CONTROLLER_short_socket_s_length); + const f_string_static_t controller_short_uninterruptible_s = macro_f_string_static_t_initialize(CONTROLLER_short_uninterruptible_s, 0, CONTROLLER_short_uninterruptible_s_length); + const f_string_static_t controller_short_validate_s = macro_f_string_static_t_initialize(CONTROLLER_short_validate_s, 0, CONTROLLER_short_validate_s_length); - const f_string_static_t controller_long_cgroup_s = macro_f_string_static_t_initialize2(CONTROLLER_long_cgroup_s, 0, CONTROLLER_long_cgroup_s_length); - const f_string_static_t controller_long_daemon_s = macro_f_string_static_t_initialize2(CONTROLLER_long_daemon_s, 0, CONTROLLER_long_daemon_s_length); - const f_string_static_t controller_long_init_s = macro_f_string_static_t_initialize2(CONTROLLER_long_init_s, 0, CONTROLLER_long_init_s_length); - const f_string_static_t controller_long_interruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_long_interruptible_s, 0, CONTROLLER_long_interruptible_s_length); - const f_string_static_t controller_long_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_long_pid_s, 0, CONTROLLER_long_pid_s_length); - const f_string_static_t controller_long_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_long_settings_s, 0, CONTROLLER_long_settings_s_length); - const f_string_static_t controller_long_simulate_s = macro_f_string_static_t_initialize2(CONTROLLER_long_simulate_s, 0, CONTROLLER_long_simulate_s_length); - const f_string_static_t controller_long_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_long_socket_s, 0, CONTROLLER_long_socket_s_length); - const f_string_static_t controller_long_uninterruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_long_uninterruptible_s, 0, CONTROLLER_long_uninterruptible_s_length); - const f_string_static_t controller_long_validate_s = macro_f_string_static_t_initialize2(CONTROLLER_long_validate_s, 0, CONTROLLER_long_validate_s_length); + const f_string_static_t controller_long_cgroup_s = macro_f_string_static_t_initialize(CONTROLLER_long_cgroup_s, 0, CONTROLLER_long_cgroup_s_length); + const f_string_static_t controller_long_daemon_s = macro_f_string_static_t_initialize(CONTROLLER_long_daemon_s, 0, CONTROLLER_long_daemon_s_length); + const f_string_static_t controller_long_init_s = macro_f_string_static_t_initialize(CONTROLLER_long_init_s, 0, CONTROLLER_long_init_s_length); + const f_string_static_t controller_long_interruptible_s = macro_f_string_static_t_initialize(CONTROLLER_long_interruptible_s, 0, CONTROLLER_long_interruptible_s_length); + const f_string_static_t controller_long_pid_s = macro_f_string_static_t_initialize(CONTROLLER_long_pid_s, 0, CONTROLLER_long_pid_s_length); + const f_string_static_t controller_long_settings_s = macro_f_string_static_t_initialize(CONTROLLER_long_settings_s, 0, CONTROLLER_long_settings_s_length); + const f_string_static_t controller_long_simulate_s = macro_f_string_static_t_initialize(CONTROLLER_long_simulate_s, 0, CONTROLLER_long_simulate_s_length); + const f_string_static_t controller_long_socket_s = macro_f_string_static_t_initialize(CONTROLLER_long_socket_s, 0, CONTROLLER_long_socket_s_length); + const f_string_static_t controller_long_uninterruptible_s = macro_f_string_static_t_initialize(CONTROLLER_long_uninterruptible_s, 0, CONTROLLER_long_uninterruptible_s_length); + const f_string_static_t controller_long_validate_s = macro_f_string_static_t_initialize(CONTROLLER_long_validate_s, 0, CONTROLLER_long_validate_s_length); #endif // _di_controller_defines_ #ifndef _di_controller_main_delete_ f_status_t controller_main_delete(controller_main_t * const main) { - for (f_array_length_t i = 0; i < controller_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); macro_f_color_context_t_delete_simple(main->context); diff --git a/level_3/controller/c/common.h b/level_3/controller/c/common.h index 58c53b4..fdb4821 100644 --- a/level_3/controller/c/common.h +++ b/level_3/controller/c/common.h @@ -309,7 +309,7 @@ extern "C" { #ifndef _di_controller_main_t_ typedef struct { - f_console_parameter_t parameters[controller_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -336,7 +336,7 @@ extern "C" { #define controller_main_t_initialize \ { \ - controller_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ F_false, \ diff --git a/level_3/controller/c/common/private-common.c b/level_3/controller/c/common/private-common.c index 81ce642..2ddfcd0 100644 --- a/level_3/controller/c/common/private-common.c +++ b/level_3/controller/c/common/private-common.c @@ -6,124 +6,124 @@ extern "C" { #endif #ifndef _di_controller_string_s_ - const f_string_static_t controller_action_s = macro_f_string_static_t_initialize2(CONTROLLER_action_s, 0, CONTROLLER_action_s_length); - const f_string_static_t controller_actions_s = macro_f_string_static_t_initialize2(CONTROLLER_actions_s, 0, CONTROLLER_actions_s_length); - const f_string_static_t controller_affinity_s = macro_f_string_static_t_initialize2(CONTROLLER_affinity_s, 0, CONTROLLER_affinity_s_length); - const f_string_static_t controller_as_s = macro_f_string_static_t_initialize2(CONTROLLER_as_s, 0, CONTROLLER_as_s_length); - const f_string_static_t controller_asynchronous_s = macro_f_string_static_t_initialize2(CONTROLLER_asynchronous_s, 0, CONTROLLER_asynchronous_s_length); - const f_string_static_t controller_bash_s = macro_f_string_static_t_initialize2(CONTROLLER_bash_s, 0, CONTROLLER_bash_s_length); - const f_string_static_t controller_batch_s = macro_f_string_static_t_initialize2(CONTROLLER_batch_s, 0, CONTROLLER_batch_s_length); - const f_string_static_t controller_capability_s = macro_f_string_static_t_initialize2(CONTROLLER_capability_s, 0, CONTROLLER_capability_s_length); - const f_string_static_t controller_cgroup_s = macro_f_string_static_t_initialize2(CONTROLLER_cgroup_s, 0, CONTROLLER_cgroup_s_length); - const f_string_static_t controller_create_s = macro_f_string_static_t_initialize2(CONTROLLER_create_s, 0, CONTROLLER_create_s_length); - const f_string_static_t controller_command_s = macro_f_string_static_t_initialize2(CONTROLLER_command_s, 0, CONTROLLER_command_s_length); - const f_string_static_t controller_consider_s = macro_f_string_static_t_initialize2(CONTROLLER_consider_s, 0, CONTROLLER_consider_s_length); - const f_string_static_t controller_control_s = macro_f_string_static_t_initialize2(CONTROLLER_control_s, 0, CONTROLLER_control_s_length); - const f_string_static_t controller_control_group_s = macro_f_string_static_t_initialize2(CONTROLLER_control_group_s, 0, CONTROLLER_control_group_s_length); - const f_string_static_t controller_control_mode_s = macro_f_string_static_t_initialize2(CONTROLLER_control_mode_s, 0, CONTROLLER_control_mode_s_length); - const f_string_static_t controller_control_user_s = macro_f_string_static_t_initialize2(CONTROLLER_control_user_s, 0, CONTROLLER_control_user_s_length); - const f_string_static_t controller_cpu_s = macro_f_string_static_t_initialize2(CONTROLLER_cpu_s, 0, CONTROLLER_cpu_s_length); - const f_string_static_t controller_core_s = macro_f_string_static_t_initialize2(CONTROLLER_core_s, 0, CONTROLLER_core_s_length); - const f_string_static_t controller_data_s = macro_f_string_static_t_initialize2(CONTROLLER_data_s, 0, CONTROLLER_data_s_length); - const f_string_static_t controller_deadline_s = macro_f_string_static_t_initialize2(CONTROLLER_deadline_s, 0, CONTROLLER_deadline_s_length); - const f_string_static_t controller_default_s = macro_f_string_static_t_initialize2(CONTROLLER_default_s, 0, CONTROLLER_default_s_length); - const f_string_static_t controller_define_s = macro_f_string_static_t_initialize2(CONTROLLER_define_s, 0, CONTROLLER_define_s_length); - const f_string_static_t controller_delay_s = macro_f_string_static_t_initialize2(CONTROLLER_delay_s, 0, CONTROLLER_delay_s_length); - const f_string_static_t controller_disable_s = macro_f_string_static_t_initialize2(CONTROLLER_disable_s, 0, CONTROLLER_disable_s_length); - const f_string_static_t controller_entry_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_s, 0, CONTROLLER_entry_s_length); - const f_string_static_t controller_entries_s = macro_f_string_static_t_initialize2(CONTROLLER_entries_s, 0, CONTROLLER_entries_s_length); - const f_string_static_t controller_environment_s = macro_f_string_static_t_initialize2(CONTROLLER_environment_s, 0, CONTROLLER_environment_s_length); - const f_string_static_t controller_error_s = macro_f_string_static_t_initialize2(CONTROLLER_error_s, 0, CONTROLLER_error_s_length); - const f_string_static_t controller_execute_s = macro_f_string_static_t_initialize2(CONTROLLER_execute_s, 0, CONTROLLER_execute_s_length); - const f_string_static_t controller_existing_s = macro_f_string_static_t_initialize2(CONTROLLER_existing_s, 0, CONTROLLER_existing_s_length); - const f_string_static_t controller_exit_s = macro_f_string_static_t_initialize2(CONTROLLER_exit_s, 0, CONTROLLER_exit_s_length); - const f_string_static_t controller_exits_s = macro_f_string_static_t_initialize2(CONTROLLER_exits_s, 0, CONTROLLER_exits_s_length); - const f_string_static_t controller_fail_s = macro_f_string_static_t_initialize2(CONTROLLER_fail_s, 0, CONTROLLER_fail_s_length); - const f_string_static_t controller_failsafe_s = macro_f_string_static_t_initialize2(CONTROLLER_failsafe_s, 0, CONTROLLER_failsafe_s_length); - const f_string_static_t controller_failure_s = macro_f_string_static_t_initialize2(CONTROLLER_failure_s, 0, CONTROLLER_failure_s_length); - const f_string_static_t controller_fifo_s = macro_f_string_static_t_initialize2(CONTROLLER_fifo_s, 0, CONTROLLER_fifo_s_length); - const f_string_static_t controller_freeze_s = macro_f_string_static_t_initialize2(CONTROLLER_freeze_s, 0, CONTROLLER_freeze_s_length); - const f_string_static_t controller_fsize_s = macro_f_string_static_t_initialize2(CONTROLLER_fsize_s, 0, CONTROLLER_fsize_s_length); - const f_string_static_t controller_full_path_s = macro_f_string_static_t_initialize2(CONTROLLER_full_path_s, 0, CONTROLLER_full_path_s_length); - const f_string_static_t controller_group_s = macro_f_string_static_t_initialize2(CONTROLLER_group_s, 0, CONTROLLER_group_s_length); - const f_string_static_t controller_groups_s = macro_f_string_static_t_initialize2(CONTROLLER_groups_s, 0, CONTROLLER_groups_s_length); - const f_string_static_t controller_how_s = macro_f_string_static_t_initialize2(CONTROLLER_how_s, 0, CONTROLLER_how_s_length); - const f_string_static_t controller_idle_s = macro_f_string_static_t_initialize2(CONTROLLER_idle_s, 0, CONTROLLER_idle_s_length); - const f_string_static_t controller_item_s = macro_f_string_static_t_initialize2(CONTROLLER_item_s, 0, CONTROLLER_item_s_length); - const f_string_static_t controller_init_s = macro_f_string_static_t_initialize2(CONTROLLER_init_s, 0, CONTROLLER_init_s_length); - const f_string_static_t controller_kill_s = macro_f_string_static_t_initialize2(CONTROLLER_kill_s, 0, CONTROLLER_kill_s_length); - const f_string_static_t controller_length_s = macro_f_string_static_t_initialize2(CONTROLLER_length_s, 0, CONTROLLER_length_s_length); - const f_string_static_t controller_limit_s = macro_f_string_static_t_initialize2(CONTROLLER_limit_s, 0, CONTROLLER_limit_s_length); - const f_string_static_t controller_locks_s = macro_f_string_static_t_initialize2(CONTROLLER_locks_s, 0, CONTROLLER_locks_s_length); - const f_string_static_t controller_main_s = macro_f_string_static_t_initialize2(CONTROLLER_main_s, 0, CONTROLLER_main_s_length); - const f_string_static_t controller_max_s = macro_f_string_static_t_initialize2(CONTROLLER_max_s, 0, CONTROLLER_max_s_length); - const f_string_static_t controller_memlock_s = macro_f_string_static_t_initialize2(CONTROLLER_memlock_s, 0, CONTROLLER_memlock_s_length); - const f_string_static_t controller_method_s = macro_f_string_static_t_initialize2(CONTROLLER_method_s, 0, CONTROLLER_method_s_length); - const f_string_static_t controller_mode_s = macro_f_string_static_t_initialize2(CONTROLLER_mode_s, 0, CONTROLLER_mode_s_length); - const f_string_static_t controller_msgqueue_s = macro_f_string_static_t_initialize2(CONTROLLER_msgqueue_s, 0, CONTROLLER_msgqueue_s_length); - const f_string_static_t controller_name_s = macro_f_string_static_t_initialize2(CONTROLLER_name_s, 0, CONTROLLER_name_s_length); - const f_string_static_t controller_need_s = macro_f_string_static_t_initialize2(CONTROLLER_need_s, 0, CONTROLLER_need_s_length); - const f_string_static_t controller_new_s = macro_f_string_static_t_initialize2(CONTROLLER_new_s, 0, CONTROLLER_new_s_length); - const f_string_static_t controller_nice_s = macro_f_string_static_t_initialize2(CONTROLLER_nice_s, 0, CONTROLLER_nice_s_length); - const f_string_static_t controller_no_s = macro_f_string_static_t_initialize2(CONTROLLER_no_s, 0, CONTROLLER_no_s_length); - const f_string_static_t controller_nofile_s = macro_f_string_static_t_initialize2(CONTROLLER_nofile_s, 0, CONTROLLER_nofile_s_length); - const f_string_static_t controller_normal_s = macro_f_string_static_t_initialize2(CONTROLLER_normal_s, 0, CONTROLLER_normal_s_length); - const f_string_static_t controller_nproc_s = macro_f_string_static_t_initialize2(CONTROLLER_nproc_s, 0, CONTROLLER_nproc_s_length); - const f_string_static_t controller_on_s = macro_f_string_static_t_initialize2(CONTROLLER_on_s, 0, CONTROLLER_on_s_length); - const f_string_static_t controller_optional_s = macro_f_string_static_t_initialize2(CONTROLLER_optional_s, 0, CONTROLLER_optional_s_length); - const f_string_static_t controller_other_s = macro_f_string_static_t_initialize2(CONTROLLER_other_s, 0, CONTROLLER_other_s_length); - const f_string_static_t controller_parameter_s = macro_f_string_static_t_initialize2(CONTROLLER_parameter_s, 0, CONTROLLER_parameter_s_length); - const f_string_static_t controller_parameters_s = macro_f_string_static_t_initialize2(CONTROLLER_parameters_s, 0, CONTROLLER_parameters_s_length); - const f_string_static_t controller_path_s = macro_f_string_static_t_initialize2(CONTROLLER_path_s, 0, CONTROLLER_path_s_length); - const f_string_static_t controller_pause_s = macro_f_string_static_t_initialize2(CONTROLLER_pause_s, 0, CONTROLLER_pause_s_length); - const f_string_static_t controller_payload_type_s = macro_f_string_static_t_initialize2(CONTROLLER_payload_type_s, 0, CONTROLLER_payload_type_s_length); - const f_string_static_t controller_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_pid_s, 0, CONTROLLER_pid_s_length); - const f_string_static_t controller_pid_file_s = macro_f_string_static_t_initialize2(CONTROLLER_pid_file_s, 0, CONTROLLER_pid_file_s_length); - const f_string_static_t controller_processor_s = macro_f_string_static_t_initialize2(CONTROLLER_processor_s, 0, CONTROLLER_processor_s_length); - const f_string_static_t controller_program_s = macro_f_string_static_t_initialize2(CONTROLLER_program_s, 0, CONTROLLER_program_s_length); - const f_string_static_t controller_ready_s = macro_f_string_static_t_initialize2(CONTROLLER_ready_s, 0, CONTROLLER_ready_s_length); - const f_string_static_t controller_reload_s = macro_f_string_static_t_initialize2(CONTROLLER_reload_s, 0, CONTROLLER_reload_s_length); - const f_string_static_t controller_require_s = macro_f_string_static_t_initialize2(CONTROLLER_require_s, 0, CONTROLLER_require_s_length); - const f_string_static_t controller_required_s = macro_f_string_static_t_initialize2(CONTROLLER_required_s, 0, CONTROLLER_required_s_length); - const f_string_static_t controller_rerun_s = macro_f_string_static_t_initialize2(CONTROLLER_rerun_s, 0, CONTROLLER_rerun_s_length); - const f_string_static_t controller_reset_s = macro_f_string_static_t_initialize2(CONTROLLER_reset_s, 0, CONTROLLER_reset_s_length); - const f_string_static_t controller_restart_s = macro_f_string_static_t_initialize2(CONTROLLER_restart_s, 0, CONTROLLER_restart_s_length); - const f_string_static_t controller_resume_s = macro_f_string_static_t_initialize2(CONTROLLER_resume_s, 0, CONTROLLER_resume_s_length); - const f_string_static_t controller_round_robin_s = macro_f_string_static_t_initialize2(CONTROLLER_round_robin_s, 0, CONTROLLER_round_robin_s_length); - const f_string_static_t controller_rss_s = macro_f_string_static_t_initialize2(CONTROLLER_rss_s, 0, CONTROLLER_rss_s_length); - const f_string_static_t controller_rtprio_s = macro_f_string_static_t_initialize2(CONTROLLER_rtprio_s, 0, CONTROLLER_rtprio_s_length); - const f_string_static_t controller_rttime_s = macro_f_string_static_t_initialize2(CONTROLLER_rttime_s, 0, CONTROLLER_rttime_s_length); - const f_string_static_t controller_rule_s = macro_f_string_static_t_initialize2(CONTROLLER_rule_s, 0, CONTROLLER_rule_s_length); - const f_string_static_t controller_rules_s = macro_f_string_static_t_initialize2(CONTROLLER_rules_s, 0, CONTROLLER_rules_s_length); - const f_string_static_t controller_same_s = macro_f_string_static_t_initialize2(CONTROLLER_same_s, 0, CONTROLLER_same_s_length); - const f_string_static_t controller_scheduler_s = macro_f_string_static_t_initialize2(CONTROLLER_scheduler_s, 0, CONTROLLER_scheduler_s_length); - const f_string_static_t controller_script_s = macro_f_string_static_t_initialize2(CONTROLLER_script_s, 0, CONTROLLER_script_s_length); - const f_string_static_t controller_service_s = macro_f_string_static_t_initialize2(CONTROLLER_service_s, 0, CONTROLLER_service_s_length); - const f_string_static_t controller_setting_s = macro_f_string_static_t_initialize2(CONTROLLER_setting_s, 0, CONTROLLER_setting_s_length); - const f_string_static_t controller_session_s = macro_f_string_static_t_initialize2(CONTROLLER_session_s, 0, CONTROLLER_session_s_length); - const f_string_static_t controller_session_new_s = macro_f_string_static_t_initialize2(CONTROLLER_session_new_s, 0, CONTROLLER_session_new_s_length); - const f_string_static_t controller_session_same_s = macro_f_string_static_t_initialize2(CONTROLLER_session_same_s, 0, CONTROLLER_session_same_s_length); - const f_string_static_t controller_show_s = macro_f_string_static_t_initialize2(CONTROLLER_show_s, 0, CONTROLLER_show_s_length); - const f_string_static_t controller_sigpending_s = macro_f_string_static_t_initialize2(CONTROLLER_sigpending_s, 0, CONTROLLER_sigpending_s_length); - const f_string_static_t controller_stack_s = macro_f_string_static_t_initialize2(CONTROLLER_stack_s, 0, CONTROLLER_stack_s_length); - const f_string_static_t controller_start_s = macro_f_string_static_t_initialize2(CONTROLLER_start_s, 0, CONTROLLER_start_s_length); - const f_string_static_t controller_status_s = macro_f_string_static_t_initialize2(CONTROLLER_status_s, 0, CONTROLLER_status_s_length); - const f_string_static_t controller_stop_s = macro_f_string_static_t_initialize2(CONTROLLER_stop_s, 0, CONTROLLER_stop_s_length); - const f_string_static_t controller_succeed_s = macro_f_string_static_t_initialize2(CONTROLLER_succeed_s, 0, CONTROLLER_succeed_s_length); - const f_string_static_t controller_success_s = macro_f_string_static_t_initialize2(CONTROLLER_success_s, 0, CONTROLLER_success_s_length); - const f_string_static_t controller_synchronous_s = macro_f_string_static_t_initialize2(CONTROLLER_synchronous_s, 0, CONTROLLER_synchronous_s_length); - const f_string_static_t controller_thaw_s = macro_f_string_static_t_initialize2(CONTROLLER_thaw_s, 0, CONTROLLER_thaw_s_length); - const f_string_static_t controller_timeout_s = macro_f_string_static_t_initialize2(CONTROLLER_timeout_s, 0, CONTROLLER_timeout_s_length); - const f_string_static_t controller_type_s = macro_f_string_static_t_initialize2(CONTROLLER_type_s, 0, CONTROLLER_type_s_length); - const f_string_static_t controller_use_s = macro_f_string_static_t_initialize2(CONTROLLER_use_s, 0, CONTROLLER_use_s_length); - const f_string_static_t controller_user_s = macro_f_string_static_t_initialize2(CONTROLLER_user_s, 0, CONTROLLER_user_s_length); - const f_string_static_t controller_utility_s = macro_f_string_static_t_initialize2(CONTROLLER_utility_s, 0, CONTROLLER_utility_s_length); - const f_string_static_t controller_value_s = macro_f_string_static_t_initialize2(CONTROLLER_value_s, 0, CONTROLLER_value_s_length); - const f_string_static_t controller_wait_s = macro_f_string_static_t_initialize2(CONTROLLER_wait_s, 0, CONTROLLER_wait_s_length); - const f_string_static_t controller_want_s = macro_f_string_static_t_initialize2(CONTROLLER_want_s, 0, CONTROLLER_want_s_length); - const f_string_static_t controller_wish_s = macro_f_string_static_t_initialize2(CONTROLLER_wish_s, 0, CONTROLLER_wish_s_length); - const f_string_static_t controller_with_s = macro_f_string_static_t_initialize2(CONTROLLER_with_s, 0, CONTROLLER_with_s_length); - const f_string_static_t controller_yes_s = macro_f_string_static_t_initialize2(CONTROLLER_yes_s, 0, CONTROLLER_yes_s_length); + const f_string_static_t controller_action_s = macro_f_string_static_t_initialize(CONTROLLER_action_s, 0, CONTROLLER_action_s_length); + const f_string_static_t controller_actions_s = macro_f_string_static_t_initialize(CONTROLLER_actions_s, 0, CONTROLLER_actions_s_length); + const f_string_static_t controller_affinity_s = macro_f_string_static_t_initialize(CONTROLLER_affinity_s, 0, CONTROLLER_affinity_s_length); + const f_string_static_t controller_as_s = macro_f_string_static_t_initialize(CONTROLLER_as_s, 0, CONTROLLER_as_s_length); + const f_string_static_t controller_asynchronous_s = macro_f_string_static_t_initialize(CONTROLLER_asynchronous_s, 0, CONTROLLER_asynchronous_s_length); + const f_string_static_t controller_bash_s = macro_f_string_static_t_initialize(CONTROLLER_bash_s, 0, CONTROLLER_bash_s_length); + const f_string_static_t controller_batch_s = macro_f_string_static_t_initialize(CONTROLLER_batch_s, 0, CONTROLLER_batch_s_length); + const f_string_static_t controller_capability_s = macro_f_string_static_t_initialize(CONTROLLER_capability_s, 0, CONTROLLER_capability_s_length); + const f_string_static_t controller_cgroup_s = macro_f_string_static_t_initialize(CONTROLLER_cgroup_s, 0, CONTROLLER_cgroup_s_length); + const f_string_static_t controller_create_s = macro_f_string_static_t_initialize(CONTROLLER_create_s, 0, CONTROLLER_create_s_length); + const f_string_static_t controller_command_s = macro_f_string_static_t_initialize(CONTROLLER_command_s, 0, CONTROLLER_command_s_length); + const f_string_static_t controller_consider_s = macro_f_string_static_t_initialize(CONTROLLER_consider_s, 0, CONTROLLER_consider_s_length); + const f_string_static_t controller_control_s = macro_f_string_static_t_initialize(CONTROLLER_control_s, 0, CONTROLLER_control_s_length); + const f_string_static_t controller_control_group_s = macro_f_string_static_t_initialize(CONTROLLER_control_group_s, 0, CONTROLLER_control_group_s_length); + const f_string_static_t controller_control_mode_s = macro_f_string_static_t_initialize(CONTROLLER_control_mode_s, 0, CONTROLLER_control_mode_s_length); + const f_string_static_t controller_control_user_s = macro_f_string_static_t_initialize(CONTROLLER_control_user_s, 0, CONTROLLER_control_user_s_length); + const f_string_static_t controller_cpu_s = macro_f_string_static_t_initialize(CONTROLLER_cpu_s, 0, CONTROLLER_cpu_s_length); + const f_string_static_t controller_core_s = macro_f_string_static_t_initialize(CONTROLLER_core_s, 0, CONTROLLER_core_s_length); + const f_string_static_t controller_data_s = macro_f_string_static_t_initialize(CONTROLLER_data_s, 0, CONTROLLER_data_s_length); + const f_string_static_t controller_deadline_s = macro_f_string_static_t_initialize(CONTROLLER_deadline_s, 0, CONTROLLER_deadline_s_length); + const f_string_static_t controller_default_s = macro_f_string_static_t_initialize(CONTROLLER_default_s, 0, CONTROLLER_default_s_length); + const f_string_static_t controller_define_s = macro_f_string_static_t_initialize(CONTROLLER_define_s, 0, CONTROLLER_define_s_length); + const f_string_static_t controller_delay_s = macro_f_string_static_t_initialize(CONTROLLER_delay_s, 0, CONTROLLER_delay_s_length); + const f_string_static_t controller_disable_s = macro_f_string_static_t_initialize(CONTROLLER_disable_s, 0, CONTROLLER_disable_s_length); + const f_string_static_t controller_entry_s = macro_f_string_static_t_initialize(CONTROLLER_entry_s, 0, CONTROLLER_entry_s_length); + const f_string_static_t controller_entries_s = macro_f_string_static_t_initialize(CONTROLLER_entries_s, 0, CONTROLLER_entries_s_length); + const f_string_static_t controller_environment_s = macro_f_string_static_t_initialize(CONTROLLER_environment_s, 0, CONTROLLER_environment_s_length); + const f_string_static_t controller_error_s = macro_f_string_static_t_initialize(CONTROLLER_error_s, 0, CONTROLLER_error_s_length); + const f_string_static_t controller_execute_s = macro_f_string_static_t_initialize(CONTROLLER_execute_s, 0, CONTROLLER_execute_s_length); + const f_string_static_t controller_existing_s = macro_f_string_static_t_initialize(CONTROLLER_existing_s, 0, CONTROLLER_existing_s_length); + const f_string_static_t controller_exit_s = macro_f_string_static_t_initialize(CONTROLLER_exit_s, 0, CONTROLLER_exit_s_length); + const f_string_static_t controller_exits_s = macro_f_string_static_t_initialize(CONTROLLER_exits_s, 0, CONTROLLER_exits_s_length); + const f_string_static_t controller_fail_s = macro_f_string_static_t_initialize(CONTROLLER_fail_s, 0, CONTROLLER_fail_s_length); + const f_string_static_t controller_failsafe_s = macro_f_string_static_t_initialize(CONTROLLER_failsafe_s, 0, CONTROLLER_failsafe_s_length); + const f_string_static_t controller_failure_s = macro_f_string_static_t_initialize(CONTROLLER_failure_s, 0, CONTROLLER_failure_s_length); + const f_string_static_t controller_fifo_s = macro_f_string_static_t_initialize(CONTROLLER_fifo_s, 0, CONTROLLER_fifo_s_length); + const f_string_static_t controller_freeze_s = macro_f_string_static_t_initialize(CONTROLLER_freeze_s, 0, CONTROLLER_freeze_s_length); + const f_string_static_t controller_fsize_s = macro_f_string_static_t_initialize(CONTROLLER_fsize_s, 0, CONTROLLER_fsize_s_length); + const f_string_static_t controller_full_path_s = macro_f_string_static_t_initialize(CONTROLLER_full_path_s, 0, CONTROLLER_full_path_s_length); + const f_string_static_t controller_group_s = macro_f_string_static_t_initialize(CONTROLLER_group_s, 0, CONTROLLER_group_s_length); + const f_string_static_t controller_groups_s = macro_f_string_static_t_initialize(CONTROLLER_groups_s, 0, CONTROLLER_groups_s_length); + const f_string_static_t controller_how_s = macro_f_string_static_t_initialize(CONTROLLER_how_s, 0, CONTROLLER_how_s_length); + const f_string_static_t controller_idle_s = macro_f_string_static_t_initialize(CONTROLLER_idle_s, 0, CONTROLLER_idle_s_length); + const f_string_static_t controller_item_s = macro_f_string_static_t_initialize(CONTROLLER_item_s, 0, CONTROLLER_item_s_length); + const f_string_static_t controller_init_s = macro_f_string_static_t_initialize(CONTROLLER_init_s, 0, CONTROLLER_init_s_length); + const f_string_static_t controller_kill_s = macro_f_string_static_t_initialize(CONTROLLER_kill_s, 0, CONTROLLER_kill_s_length); + const f_string_static_t controller_length_s = macro_f_string_static_t_initialize(CONTROLLER_length_s, 0, CONTROLLER_length_s_length); + const f_string_static_t controller_limit_s = macro_f_string_static_t_initialize(CONTROLLER_limit_s, 0, CONTROLLER_limit_s_length); + const f_string_static_t controller_locks_s = macro_f_string_static_t_initialize(CONTROLLER_locks_s, 0, CONTROLLER_locks_s_length); + const f_string_static_t controller_main_s = macro_f_string_static_t_initialize(CONTROLLER_main_s, 0, CONTROLLER_main_s_length); + const f_string_static_t controller_max_s = macro_f_string_static_t_initialize(CONTROLLER_max_s, 0, CONTROLLER_max_s_length); + const f_string_static_t controller_memlock_s = macro_f_string_static_t_initialize(CONTROLLER_memlock_s, 0, CONTROLLER_memlock_s_length); + const f_string_static_t controller_method_s = macro_f_string_static_t_initialize(CONTROLLER_method_s, 0, CONTROLLER_method_s_length); + const f_string_static_t controller_mode_s = macro_f_string_static_t_initialize(CONTROLLER_mode_s, 0, CONTROLLER_mode_s_length); + const f_string_static_t controller_msgqueue_s = macro_f_string_static_t_initialize(CONTROLLER_msgqueue_s, 0, CONTROLLER_msgqueue_s_length); + const f_string_static_t controller_name_s = macro_f_string_static_t_initialize(CONTROLLER_name_s, 0, CONTROLLER_name_s_length); + const f_string_static_t controller_need_s = macro_f_string_static_t_initialize(CONTROLLER_need_s, 0, CONTROLLER_need_s_length); + const f_string_static_t controller_new_s = macro_f_string_static_t_initialize(CONTROLLER_new_s, 0, CONTROLLER_new_s_length); + const f_string_static_t controller_nice_s = macro_f_string_static_t_initialize(CONTROLLER_nice_s, 0, CONTROLLER_nice_s_length); + const f_string_static_t controller_no_s = macro_f_string_static_t_initialize(CONTROLLER_no_s, 0, CONTROLLER_no_s_length); + const f_string_static_t controller_nofile_s = macro_f_string_static_t_initialize(CONTROLLER_nofile_s, 0, CONTROLLER_nofile_s_length); + const f_string_static_t controller_normal_s = macro_f_string_static_t_initialize(CONTROLLER_normal_s, 0, CONTROLLER_normal_s_length); + const f_string_static_t controller_nproc_s = macro_f_string_static_t_initialize(CONTROLLER_nproc_s, 0, CONTROLLER_nproc_s_length); + const f_string_static_t controller_on_s = macro_f_string_static_t_initialize(CONTROLLER_on_s, 0, CONTROLLER_on_s_length); + const f_string_static_t controller_optional_s = macro_f_string_static_t_initialize(CONTROLLER_optional_s, 0, CONTROLLER_optional_s_length); + const f_string_static_t controller_other_s = macro_f_string_static_t_initialize(CONTROLLER_other_s, 0, CONTROLLER_other_s_length); + const f_string_static_t controller_parameter_s = macro_f_string_static_t_initialize(CONTROLLER_parameter_s, 0, CONTROLLER_parameter_s_length); + const f_string_static_t controller_parameters_s = macro_f_string_static_t_initialize(CONTROLLER_parameters_s, 0, CONTROLLER_parameters_s_length); + const f_string_static_t controller_path_s = macro_f_string_static_t_initialize(CONTROLLER_path_s, 0, CONTROLLER_path_s_length); + const f_string_static_t controller_pause_s = macro_f_string_static_t_initialize(CONTROLLER_pause_s, 0, CONTROLLER_pause_s_length); + const f_string_static_t controller_payload_type_s = macro_f_string_static_t_initialize(CONTROLLER_payload_type_s, 0, CONTROLLER_payload_type_s_length); + const f_string_static_t controller_pid_s = macro_f_string_static_t_initialize(CONTROLLER_pid_s, 0, CONTROLLER_pid_s_length); + const f_string_static_t controller_pid_file_s = macro_f_string_static_t_initialize(CONTROLLER_pid_file_s, 0, CONTROLLER_pid_file_s_length); + const f_string_static_t controller_processor_s = macro_f_string_static_t_initialize(CONTROLLER_processor_s, 0, CONTROLLER_processor_s_length); + const f_string_static_t controller_program_s = macro_f_string_static_t_initialize(CONTROLLER_program_s, 0, CONTROLLER_program_s_length); + const f_string_static_t controller_ready_s = macro_f_string_static_t_initialize(CONTROLLER_ready_s, 0, CONTROLLER_ready_s_length); + const f_string_static_t controller_reload_s = macro_f_string_static_t_initialize(CONTROLLER_reload_s, 0, CONTROLLER_reload_s_length); + const f_string_static_t controller_require_s = macro_f_string_static_t_initialize(CONTROLLER_require_s, 0, CONTROLLER_require_s_length); + const f_string_static_t controller_required_s = macro_f_string_static_t_initialize(CONTROLLER_required_s, 0, CONTROLLER_required_s_length); + const f_string_static_t controller_rerun_s = macro_f_string_static_t_initialize(CONTROLLER_rerun_s, 0, CONTROLLER_rerun_s_length); + const f_string_static_t controller_reset_s = macro_f_string_static_t_initialize(CONTROLLER_reset_s, 0, CONTROLLER_reset_s_length); + const f_string_static_t controller_restart_s = macro_f_string_static_t_initialize(CONTROLLER_restart_s, 0, CONTROLLER_restart_s_length); + const f_string_static_t controller_resume_s = macro_f_string_static_t_initialize(CONTROLLER_resume_s, 0, CONTROLLER_resume_s_length); + const f_string_static_t controller_round_robin_s = macro_f_string_static_t_initialize(CONTROLLER_round_robin_s, 0, CONTROLLER_round_robin_s_length); + const f_string_static_t controller_rss_s = macro_f_string_static_t_initialize(CONTROLLER_rss_s, 0, CONTROLLER_rss_s_length); + const f_string_static_t controller_rtprio_s = macro_f_string_static_t_initialize(CONTROLLER_rtprio_s, 0, CONTROLLER_rtprio_s_length); + const f_string_static_t controller_rttime_s = macro_f_string_static_t_initialize(CONTROLLER_rttime_s, 0, CONTROLLER_rttime_s_length); + const f_string_static_t controller_rule_s = macro_f_string_static_t_initialize(CONTROLLER_rule_s, 0, CONTROLLER_rule_s_length); + const f_string_static_t controller_rules_s = macro_f_string_static_t_initialize(CONTROLLER_rules_s, 0, CONTROLLER_rules_s_length); + const f_string_static_t controller_same_s = macro_f_string_static_t_initialize(CONTROLLER_same_s, 0, CONTROLLER_same_s_length); + const f_string_static_t controller_scheduler_s = macro_f_string_static_t_initialize(CONTROLLER_scheduler_s, 0, CONTROLLER_scheduler_s_length); + const f_string_static_t controller_script_s = macro_f_string_static_t_initialize(CONTROLLER_script_s, 0, CONTROLLER_script_s_length); + const f_string_static_t controller_service_s = macro_f_string_static_t_initialize(CONTROLLER_service_s, 0, CONTROLLER_service_s_length); + const f_string_static_t controller_setting_s = macro_f_string_static_t_initialize(CONTROLLER_setting_s, 0, CONTROLLER_setting_s_length); + const f_string_static_t controller_session_s = macro_f_string_static_t_initialize(CONTROLLER_session_s, 0, CONTROLLER_session_s_length); + const f_string_static_t controller_session_new_s = macro_f_string_static_t_initialize(CONTROLLER_session_new_s, 0, CONTROLLER_session_new_s_length); + const f_string_static_t controller_session_same_s = macro_f_string_static_t_initialize(CONTROLLER_session_same_s, 0, CONTROLLER_session_same_s_length); + const f_string_static_t controller_show_s = macro_f_string_static_t_initialize(CONTROLLER_show_s, 0, CONTROLLER_show_s_length); + const f_string_static_t controller_sigpending_s = macro_f_string_static_t_initialize(CONTROLLER_sigpending_s, 0, CONTROLLER_sigpending_s_length); + const f_string_static_t controller_stack_s = macro_f_string_static_t_initialize(CONTROLLER_stack_s, 0, CONTROLLER_stack_s_length); + const f_string_static_t controller_start_s = macro_f_string_static_t_initialize(CONTROLLER_start_s, 0, CONTROLLER_start_s_length); + const f_string_static_t controller_status_s = macro_f_string_static_t_initialize(CONTROLLER_status_s, 0, CONTROLLER_status_s_length); + const f_string_static_t controller_stop_s = macro_f_string_static_t_initialize(CONTROLLER_stop_s, 0, CONTROLLER_stop_s_length); + const f_string_static_t controller_succeed_s = macro_f_string_static_t_initialize(CONTROLLER_succeed_s, 0, CONTROLLER_succeed_s_length); + const f_string_static_t controller_success_s = macro_f_string_static_t_initialize(CONTROLLER_success_s, 0, CONTROLLER_success_s_length); + const f_string_static_t controller_synchronous_s = macro_f_string_static_t_initialize(CONTROLLER_synchronous_s, 0, CONTROLLER_synchronous_s_length); + const f_string_static_t controller_thaw_s = macro_f_string_static_t_initialize(CONTROLLER_thaw_s, 0, CONTROLLER_thaw_s_length); + const f_string_static_t controller_timeout_s = macro_f_string_static_t_initialize(CONTROLLER_timeout_s, 0, CONTROLLER_timeout_s_length); + const f_string_static_t controller_type_s = macro_f_string_static_t_initialize(CONTROLLER_type_s, 0, CONTROLLER_type_s_length); + const f_string_static_t controller_use_s = macro_f_string_static_t_initialize(CONTROLLER_use_s, 0, CONTROLLER_use_s_length); + const f_string_static_t controller_user_s = macro_f_string_static_t_initialize(CONTROLLER_user_s, 0, CONTROLLER_user_s_length); + const f_string_static_t controller_utility_s = macro_f_string_static_t_initialize(CONTROLLER_utility_s, 0, CONTROLLER_utility_s_length); + const f_string_static_t controller_value_s = macro_f_string_static_t_initialize(CONTROLLER_value_s, 0, CONTROLLER_value_s_length); + const f_string_static_t controller_wait_s = macro_f_string_static_t_initialize(CONTROLLER_wait_s, 0, CONTROLLER_wait_s_length); + const f_string_static_t controller_want_s = macro_f_string_static_t_initialize(CONTROLLER_want_s, 0, CONTROLLER_want_s_length); + const f_string_static_t controller_wish_s = macro_f_string_static_t_initialize(CONTROLLER_wish_s, 0, CONTROLLER_wish_s_length); + const f_string_static_t controller_with_s = macro_f_string_static_t_initialize(CONTROLLER_with_s, 0, CONTROLLER_with_s_length); + const f_string_static_t controller_yes_s = macro_f_string_static_t_initialize(CONTROLLER_yes_s, 0, CONTROLLER_yes_s_length); #endif // _di_controller_string_s_ #ifdef __cplusplus diff --git a/level_3/controller/c/common/private-rule.c b/level_3/controller/c/common/private-rule.c index 7dfbf4e..a0ddeec 100644 --- a/level_3/controller/c/common/private-rule.c +++ b/level_3/controller/c/common/private-rule.c @@ -6,8 +6,8 @@ extern "C" { #endif #ifndef _di_controller_rule_action_t_ - const f_string_static_t controller_rule_action_method_string_extended_s = macro_f_string_static_t_initialize2(CONTROLLER_rule_action_method_string_extended_s, 0, CONTROLLER_rule_action_method_string_extended_s_length); - const f_string_static_t controller_rule_action_method_string_extended_list_s = macro_f_string_static_t_initialize2(CONTROLLER_rule_action_method_string_extended_list_s, 0, CONTROLLER_rule_action_method_string_extended_list_s_length); + const f_string_static_t controller_rule_action_method_string_extended_s = macro_f_string_static_t_initialize(CONTROLLER_rule_action_method_string_extended_s, 0, CONTROLLER_rule_action_method_string_extended_s_length); + const f_string_static_t controller_rule_action_method_string_extended_list_s = macro_f_string_static_t_initialize(CONTROLLER_rule_action_method_string_extended_list_s, 0, CONTROLLER_rule_action_method_string_extended_list_s_length); #endif // _di_controller_rule_action_t_ #ifndef _di_controller_rule_action_delete_simple_ diff --git a/level_3/controller/c/control/private-control.c b/level_3/controller/c/control/private-control.c index 8dd7de1..9159d5f 100644 --- a/level_3/controller/c/control/private-control.c +++ b/level_3/controller/c/control/private-control.c @@ -315,7 +315,7 @@ extern "C" { #ifndef _di_controller_control_respond_error_string_ f_status_t controller_control_respond_error_string(const controller_global_t *global, controller_control_t * const control, const f_status_t status, const f_string_t message) { - const f_string_static_t string = macro_f_string_static_t_initialize(message, strlen(message)); + const f_string_static_t string = macro_f_string_static_t_initialize2(message, strlen(message)); return controller_control_respond_error(global, control, status, string); } diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index d6ebc9e..117109e 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -68,87 +68,89 @@ extern "C" { f_status_t status = F_none; + f_console_parameter_t parameters[] = controller_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = controller_total_parameters_d; + { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, controller_total_parameters_d); + f_console_parameter_id_t ids[3] = { controller_parameter_no_color_e, controller_parameter_light_e, controller_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - { - f_console_parameter_id_t ids[3] = { controller_parameter_no_color_e, controller_parameter_light_e, controller_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + fll_program_parameter_process_empty(&main->context, sets); + } - fll_program_parameter_process_empty(&main->context, sets); + if (F_status_is_error(status)) { + if (main->error.verbosity != f_console_verbosity_quiet_e) { + fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); + fll_print_dynamic(f_string_eol_s, main->error.to.stream); } - if (F_status_is_error(status)) { - if (main->error.verbosity != f_console_verbosity_quiet_e) { - fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - fll_print_dynamic(f_string_eol_s, main->error.to.stream); - } + controller_main_delete(main); - controller_main_delete(main); - - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { controller_parameter_verbosity_quiet_e, controller_parameter_verbosity_normal_e, controller_parameter_verbosity_verbose_e, controller_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { controller_parameter_verbosity_quiet_e, controller_parameter_verbosity_normal_e, controller_parameter_verbosity_verbose_e, controller_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - controller_main_delete(main); - - return status; - } + if (F_status_is_error(status)) { + controller_main_delete(main); - if (choice == controller_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == controller_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == controller_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == controller_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == controller_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == controller_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == controller_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == controller_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[controller_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[controller_parameter_help_e].result == f_console_result_found_e) { controller_print_help(main); controller_main_delete(main); @@ -156,7 +158,7 @@ extern "C" { return F_none; } - if (main->parameters[controller_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_version_e].result == f_console_result_found_e) { controller_lock_print(main->output.to, 0); fll_program_print_version(main->output.to, controller_program_version_s); @@ -203,7 +205,7 @@ extern "C" { return status; } - if (main->parameters[controller_parameter_init_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_init_e].result == f_console_result_found_e) { main->as_init = F_true; } @@ -211,7 +213,7 @@ extern "C" { setting.mode = controller_setting_mode_service_e; } - if (main->parameters[controller_parameter_settings_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_settings_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(main->error.to, 0); @@ -224,17 +226,19 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[controller_parameter_settings_e].locations.used) { - const f_array_length_t location = main->parameters[controller_parameter_settings_e].values.array[main->parameters[controller_parameter_settings_e].values.used - 1]; + else if (main->parameters.array[controller_parameter_settings_e].locations.used) { + const f_array_length_t location = main->parameters.array[controller_parameter_settings_e].values.array[main->parameters.array[controller_parameter_settings_e].values.used - 1]; status = fll_path_canonical(arguments->argv[location], &setting.path_setting); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, arguments->argv[location], "verify", fll_error_file_type_path_e); + const f_string_static_t argv = macro_f_string_static_t_initialize(arguments->argv[location], 0, strnlen(arguments->argv[location], F_console_parameter_size_d); + + fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, argv, f_file_operation_verify_s, fll_error_file_type_path_e); } } else { - if (main->parameters[controller_parameter_init_e].result == f_console_result_found_e && !main->as_init) { + if (main->parameters.array[controller_parameter_init_e].result == f_console_result_found_e && !main->as_init) { status = f_string_dynamic_append(controller_path_settings_init_s, &setting.path_setting); } else if (main->default_path_setting->used) { @@ -250,7 +254,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[controller_parameter_pid_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_pid_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(main->error.to, 0); @@ -263,8 +267,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[controller_parameter_pid_e].locations.used) { - const f_array_length_t location = main->parameters[controller_parameter_pid_e].values.array[main->parameters[controller_parameter_pid_e].values.used - 1]; + else if (main->parameters.array[controller_parameter_pid_e].locations.used) { + const f_array_length_t location = main->parameters.array[controller_parameter_pid_e].values.array[main->parameters.array[controller_parameter_pid_e].values.used - 1]; if (strnlen(arguments->argv[location], F_console_parameter_size_d)) { status = fll_path_canonical(arguments->argv[location], &setting.path_pid); @@ -279,8 +283,8 @@ extern "C" { } } - if (F_status_is_error_not(status) && !setting.path_pid.used && !main->parameters[controller_parameter_pid_e].locations.used) { - if (main->parameters[controller_parameter_init_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && !setting.path_pid.used && !main->parameters.array[controller_parameter_pid_e].locations.used) { + if (main->parameters.array[controller_parameter_init_e].result == f_console_result_found_e) { status = f_string_dynamic_append(controller_path_pid_init_s, &setting.path_pid); } else { @@ -309,7 +313,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[controller_parameter_cgroup_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_cgroup_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(main->error.to, 0); @@ -322,8 +326,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[controller_parameter_cgroup_e].locations.used) { - const f_array_length_t location = main->parameters[controller_parameter_cgroup_e].values.array[main->parameters[controller_parameter_cgroup_e].values.used - 1]; + else if (main->parameters.array[controller_parameter_cgroup_e].locations.used) { + const f_array_length_t location = main->parameters.array[controller_parameter_cgroup_e].values.array[main->parameters.array[controller_parameter_cgroup_e].values.used - 1]; if (strnlen(arguments->argv[location], F_console_parameter_size_d)) { status = fll_path_canonical(arguments->argv[location], &setting.path_cgroup); @@ -360,8 +364,8 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[controller_parameter_daemon_e].result == f_console_result_found_e) { - if (main->parameters[controller_parameter_validate_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[controller_parameter_daemon_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_validate_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(main->error.to, 0); @@ -382,7 +386,7 @@ extern "C" { setting.entry.pid = controller_entry_pid_disable_e; setting.entry.show = controller_entry_show_init_e; - if (main->parameters[controller_parameter_interruptible_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_interruptible_e].result == f_console_result_found_e) { setting.interruptible = F_true; } else { @@ -390,7 +394,7 @@ extern "C" { } } else { - if (main->parameters[controller_parameter_uninterruptible_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_uninterruptible_e].result == f_console_result_found_e) { setting.interruptible = F_false; } else { diff --git a/level_3/controller/c/controller/private-controller.c b/level_3/controller/c/controller/private-controller.c index 819e2a5..791bf06 100644 --- a/level_3/controller/c/controller/private-controller.c +++ b/level_3/controller/c/controller/private-controller.c @@ -115,7 +115,7 @@ extern "C" { path[path_length] = 0; - status = f_file_stream_open(path, 0, &file); + status = f_file_stream_open(path, f_string_empty_s, &file); if (F_status_is_error(status)) { if (!required && F_status_set_fine(status) == F_file_found_not) { @@ -125,7 +125,7 @@ extern "C" { } if (global.main->error.verbosity != f_console_verbosity_quiet_e) { - controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stream_open", F_true, path, "open", fll_error_file_type_file_e); + controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stream_open", F_true, path, f_file_operation_open_s, fll_error_file_type_file_e); } } else { @@ -388,7 +388,7 @@ extern "C" { f_status_t status = F_none; if (global->setting->entry.pid != controller_entry_pid_disable_e && !global->setting->path_pid.used) { - if (global->main->parameters[controller_parameter_validate_e].result == f_console_result_additional_e) { + if (global->main->parameters.array[controller_parameter_validate_e].result == f_console_result_additional_e) { status = controller_file_pid_create(global->main->pid, global->setting->path_pid); } @@ -440,7 +440,7 @@ extern "C" { fl_print_format("%qPID file '", global->main->output.to.stream, f_string_eol_s); fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.notable, global->setting->path_pid, global->main->context.set.notable); - if (global->main->parameters[controller_parameter_validate_e].result == f_console_result_none_e) { + if (global->main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e) { fl_print_format("' created.%q", global->main->output.to.stream, f_string_eol_s); } else { @@ -580,7 +580,7 @@ extern "C" { fl_print_format("%qControl socket '", global->main->output.to.stream, f_string_eol_s); fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); - if (global->main->parameters[controller_parameter_validate_e].result == f_console_result_none_e) { + if (global->main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e) { fl_print_format("' created.%q", global->main->output.to.stream, f_string_eol_s); } else { diff --git a/level_3/controller/c/controller/private-controller_print.c b/level_3/controller/c/controller/private-controller_print.c index 5ed4bc9..078750f 100644 --- a/level_3/controller/c/controller/private-controller_print.c +++ b/level_3/controller/c/controller/private-controller_print.c @@ -27,7 +27,7 @@ extern "C" { #endif // _di_controller_print_error_ #ifndef _di_controller_print_error_file_ - void controller_print_error_file(controller_thread_t * const thread, const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type) { + void controller_print_error_file(controller_thread_t * const thread, const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { if (print.verbosity == f_console_verbosity_quiet_e) return; if (status == F_interrupt) return; diff --git a/level_3/controller/c/controller/private-controller_print.h b/level_3/controller/c/controller/private-controller_print.h index bbfd80e..d32959d 100644 --- a/level_3/controller/c/controller/private-controller_print.h +++ b/level_3/controller/c/controller/private-controller_print.h @@ -61,7 +61,7 @@ extern "C" { * @see fll_error_file_print() */ #ifndef _di_controller_print_error_file_ - extern void controller_print_error_file(controller_thread_t * const thread, const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type) F_attribute_visibility_internal_d; + extern void controller_print_error_file(controller_thread_t * const thread, const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) F_attribute_visibility_internal_d; #endif // _di_controller_print_error_file_ /** diff --git a/level_3/controller/c/entry/private-entry.c b/level_3/controller/c/entry/private-entry.c index 36e9961..70f68de 100644 --- a/level_3/controller/c/entry/private-entry.c +++ b/level_3/controller/c/entry/private-entry.c @@ -417,7 +417,7 @@ extern "C" { if (F_status_is_error(status)) { // @todo instead call: fll_error_file_print(). - // fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, arguments->argv[location], "verify", fll_error_file_type_path_e); + // fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, arguments->argv[location], f_file_operation_verify_s, fll_error_file_type_path_e); controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "fll_path_canonical", F_true, global.thread); action->status = status; @@ -965,7 +965,7 @@ extern "C" { return status; } - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e) { if (global->main->error.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(global->main->output.to, global->thread); @@ -1002,7 +1002,7 @@ extern "C" { } if (F_status_is_error(entry_action->status)) { - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) { if (global->main->error.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(global->main->output.to, global->thread); @@ -1080,7 +1080,7 @@ extern "C" { if (entry_action->type == controller_entry_action_type_ready_e) { if ((entry_action->code & controller_entry_rule_code_wait_d) || global->setting->ready == controller_setting_ready_wait_e) { - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e || entry->show == controller_entry_show_init_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e || entry->show == controller_entry_show_init_e) { if (global->main->output.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(global->main->output.to, global->thread); @@ -1092,14 +1092,14 @@ extern "C" { } } - if (global->main->parameters[controller_parameter_validate_e].result == f_console_result_none_e) { + if (global->main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e) { status = controller_rule_wait_all(*global, is_entry, F_false, process); if (F_status_is_error(status)) return status; } } if (global->setting->ready == controller_setting_ready_yes_e) { - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e) { if (global->main->output.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(global->main->output.to, global->thread); @@ -1112,7 +1112,7 @@ extern "C" { } } else { - if (!failsafe && (global->main->error.verbosity == f_console_verbosity_verbose_e || entry->show == controller_entry_show_init_e) && global->main->parameters[controller_parameter_simulate_e].result == f_console_result_none_e) { + if (!failsafe && (global->main->error.verbosity == f_console_verbosity_verbose_e || entry->show == controller_entry_show_init_e) && global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_none_e) { fl_print_format("%qState is now '%[%q%]'.%q", global->main->output.to.stream, f_string_eol_s, global->main->context.set.notable, controller_ready_s, global->main->context.set.notable, f_string_eol_s); } @@ -1170,7 +1170,7 @@ extern "C" { return status; } - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e) { if (global->main->output.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(global->main->output.to, global->thread); @@ -1206,7 +1206,7 @@ extern "C" { const f_array_length_t id_rule_length = entry_action->parameters.array[0].used + entry_action->parameters.array[1].used + 1; char id_rule_name[id_rule_length + 1]; - const f_string_static_t alias_rule = macro_f_string_static_t_initialize(id_rule_name, id_rule_length); + const f_string_static_t alias_rule = macro_f_string_static_t_initialize2(id_rule_name, id_rule_length); memcpy(id_rule_name, entry_action->parameters.array[0].string, entry_action->parameters.array[0].used); memcpy(id_rule_name + entry_action->parameters.array[0].used + 1, entry_action->parameters.array[1].string, entry_action->parameters.array[1].used); @@ -1226,14 +1226,14 @@ extern "C" { f_thread_unlock(&global->thread->lock.rule); - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e || (entry->show == controller_entry_show_init_e && entry_action->type != controller_entry_action_type_consider_e)) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e || (entry->show == controller_entry_show_init_e && entry_action->type != controller_entry_action_type_consider_e)) { if (global->main->output.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%q%q %q item rule ", global->main->output.to.stream, f_string_eol_s, entry_action->type == controller_entry_action_type_consider_e ? controller_entry_print_considering_s : controller_entry_print_processing_s, is_entry ? controller_entry_s : controller_exit_s); fl_print_format("'%[%Q%]'", global->main->output.to.stream, global->main->context.set.title, alias_rule, global->main->context.set.title); - if (entry->show == controller_entry_show_init_e && global->main->parameters[controller_parameter_simulate_e].result == f_console_result_none_e) { + if (entry->show == controller_entry_show_init_e && global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_none_e) { fl_print_format(" [%[%q%]]", global->main->output.to.stream, global->main->context.set.notable, entry_action->code == controller_entry_rule_code_asynchronous_d ? controller_asynchronous_s : controller_synchronous_s, global->main->context.set.notable); if (entry_action->code == controller_entry_rule_code_wait_d) { @@ -1318,7 +1318,7 @@ extern "C" { // Designate the action as failed. entry_action->status = F_status_set_error(F_failure); - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_none_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_none_e) { f_thread_unlock(&global->thread->lock.rule); if (entry_action->code & controller_entry_rule_code_require_d) { @@ -1340,7 +1340,7 @@ extern "C" { options_force = 0; options_process = 0; - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) { options_process |= controller_process_option_simulate_d; } @@ -1352,12 +1352,12 @@ extern "C" { options_process |= controller_process_option_wait_d; } - if (global->main->parameters[controller_parameter_validate_e].result == f_console_result_found_e) { + if (global->main->parameters.array[controller_parameter_validate_e].result == f_console_result_found_e) { options_process |= controller_process_option_validate_d; } if (entry_action->code & controller_entry_rule_code_asynchronous_d) { - if (global->main->parameters[controller_parameter_validate_e].result == f_console_result_none_e) { + if (global->main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e) { options_force |= controller_process_option_asynchronous_d; } @@ -1370,13 +1370,13 @@ extern "C" { break; } - if (F_status_is_error(status) && global->main->parameters[controller_parameter_simulate_e].result == f_console_result_none_e && (entry_action->code & controller_entry_rule_code_require_d)) { + if (F_status_is_error(status) && global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_none_e && (entry_action->code & controller_entry_rule_code_require_d)) { return F_status_set_error(F_require); } } } else if (entry_action->type == controller_entry_action_type_execute_e) { - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e || entry->show == controller_entry_show_init_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e || entry->show == controller_entry_show_init_e) { if (global->main->output.verbosity != f_console_verbosity_quiet_e) { controller_lock_print(global->main->output.to, global->thread); @@ -1397,7 +1397,7 @@ extern "C" { } } - if (global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e) { + if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) { return F_execute; } @@ -1410,7 +1410,7 @@ extern "C" { option |= FL_execute_parameter_option_session_d; } - status = fll_execute_into(0, entry_action->parameters, option, 0, (void *) &result); + status = fll_execute_into(f_string_empty_s, entry_action->parameters, option, 0, (void *) &result); if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_file_found_not) { @@ -1557,7 +1557,7 @@ extern "C" { } // Check to see if any required processes failed, but do not do this if already operating in failsafe. - if (F_status_is_error_not(status) && !failsafe && global->main->parameters[controller_parameter_validate_e].result == f_console_result_none_e) { + if (F_status_is_error_not(status) && !failsafe && global->main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e) { const f_status_t status_wait = controller_rule_wait_all(*global, is_entry, F_true, 0); if (F_status_is_error(status_wait)) { @@ -1569,7 +1569,7 @@ extern "C" { } } - if ((global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e && global->main->error.verbosity != f_console_verbosity_quiet_e) || global->main->error.verbosity == f_console_verbosity_verbose_e) { + if ((global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e && global->main->error.verbosity != f_console_verbosity_quiet_e) || global->main->error.verbosity == f_console_verbosity_verbose_e) { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%qDone processing %q item '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s); diff --git a/level_3/controller/c/entry/private-entry_print.c b/level_3/controller/c/entry/private-entry_print.c index 2f4930d..4dc32ea 100644 --- a/level_3/controller/c/entry/private-entry_print.c +++ b/level_3/controller/c/entry/private-entry_print.c @@ -8,10 +8,10 @@ extern "C" { #endif #ifndef _di_controller_entry_print_string_s_ - const f_string_static_t controller_entry_print_considering_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_print_considering_s, 0, CONTROLLER_entry_print_considering_s_length); - const f_string_static_t controller_entry_print_failsafe_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_print_failsafe_s, 0, CONTROLLER_entry_print_failsafe_s_length); - const f_string_static_t controller_entry_print_processing_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_print_processing_s, 0, CONTROLLER_entry_print_processing_s_length); - const f_string_static_t controller_entry_print_suffix_megatime_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_print_suffix_megatime_s, 0, CONTROLLER_entry_print_suffix_megatime_s_length); + const f_string_static_t controller_entry_print_considering_s = macro_f_string_static_t_initialize(CONTROLLER_entry_print_considering_s, 0, CONTROLLER_entry_print_considering_s_length); + const f_string_static_t controller_entry_print_failsafe_s = macro_f_string_static_t_initialize(CONTROLLER_entry_print_failsafe_s, 0, CONTROLLER_entry_print_failsafe_s_length); + const f_string_static_t controller_entry_print_processing_s = macro_f_string_static_t_initialize(CONTROLLER_entry_print_processing_s, 0, CONTROLLER_entry_print_processing_s_length); + const f_string_static_t controller_entry_print_suffix_megatime_s = macro_f_string_static_t_initialize(CONTROLLER_entry_print_suffix_megatime_s, 0, CONTROLLER_entry_print_suffix_megatime_s_length); #endif // _di_controller_entry_print_string_s_ #ifndef _di_controller_entry_action_parameters_print_ @@ -33,7 +33,7 @@ extern "C" { #ifndef _di_controller_entry_preprocess_print_simulate_setting_value_ void controller_entry_preprocess_print_simulate_setting_value(const controller_global_t global, const bool is_entry, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_static_t suffix) { - if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) { + if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e)) { return; } @@ -108,7 +108,7 @@ extern "C" { #endif // _di_controller_entry_print_error_cache_ #ifndef _di_controller_entry_print_error_file_ - void controller_entry_print_error_file(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type, controller_thread_t *thread) { + void controller_entry_print_error_file(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, controller_thread_t *thread) { if (print.verbosity == f_console_verbosity_quiet_e) return; if (status == F_interrupt) return; diff --git a/level_3/controller/c/entry/private-entry_print.h b/level_3/controller/c/entry/private-entry_print.h index d96678a..01cdd7d 100644 --- a/level_3/controller/c/entry/private-entry_print.h +++ b/level_3/controller/c/entry/private-entry_print.h @@ -147,7 +147,7 @@ extern "C" { * @see controller_entry_print_error_cache() */ #ifndef _di_controller_entry_print_error_file_ - extern void controller_entry_print_error_file(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type, controller_thread_t *thread) F_attribute_visibility_internal_d; + extern void controller_entry_print_error_file(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, controller_thread_t *thread) F_attribute_visibility_internal_d; #endif // _di_controller_entry_print_error_file_ /** diff --git a/level_3/controller/c/rule/private-rule.c b/level_3/controller/c/rule/private-rule.c index 6decd60..8461e86 100644 --- a/level_3/controller/c/rule/private-rule.c +++ b/level_3/controller/c/rule/private-rule.c @@ -1369,11 +1369,11 @@ extern "C" { const f_string_statics_t simulated_arguments = f_string_statics_t_initialize; fl_execute_parameter_t simulated_parameter = macro_fl_execute_parameter_t_initialize(execute_set->parameter.option, execute_set->parameter.wait, process->rule.has & controller_rule_has_environment_d ? execute_set->parameter.environment : 0, execute_set->parameter.signals, &f_string_empty_s); - status = fll_execute_program(controller_default_program_script_s.string, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result); + status = fll_execute_program(controller_default_program_script_s, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result); } } else { - status = fll_execute_program(program.string, arguments, &execute_set->parameter, &execute_set->as, (void *) &result); + status = fll_execute_program(program, arguments, &execute_set->parameter, &execute_set->as, (void *) &result); } if (status == F_parent) { @@ -1562,13 +1562,13 @@ extern "C" { status = f_file_exists(pid_file.string); if (F_status_is_error(status)) { - controller_print_error_file(thread, main->error, F_status_set_fine(status), "f_file_exists", F_true, pid_file.string, "find", fll_error_file_type_file_e); + controller_print_error_file(thread, main->error, F_status_set_fine(status), "f_file_exists", F_true, pid_file.string, f_file_operation_find_s, fll_error_file_type_file_e); return status; } if (status == F_true) { - controller_print_error_file(thread, main->error, F_file_found, "f_file_exists", F_true, pid_file.string, "find", fll_error_file_type_file_e); + controller_print_error_file(thread, main->error, F_file_found, "f_file_exists", F_true, pid_file.string, f_file_operation_find_s, fll_error_file_type_file_e); return F_status_set_error(F_file_found); } @@ -1624,11 +1624,11 @@ extern "C" { const f_string_statics_t simulated_arguments = f_string_statics_t_initialize; fl_execute_parameter_t simulated_parameter = macro_fl_execute_parameter_t_initialize(execute_set->parameter.option, execute_set->parameter.wait, process->rule.has & controller_rule_has_environment_d ? execute_set->parameter.environment : 0, execute_set->parameter.signals, &f_string_empty_s); - status = fll_execute_program(controller_default_program_script_s.string, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result); + status = fll_execute_program(controller_default_program_script_s, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result); } } else { - status = fll_execute_program(program.string, arguments, &execute_set->parameter, &execute_set->as, (void *) &result); + status = fll_execute_program(program, arguments, &execute_set->parameter, &execute_set->as, (void *) &result); } if (status == F_parent) { @@ -2436,7 +2436,7 @@ extern "C" { memcpy(alias_other_buffer, global.setting->rules.array[id_rule].alias.string, global.setting->rules.array[id_rule].alias.used); alias_other_buffer[global.setting->rules.array[id_rule].alias.used] = 0; - const f_string_static_t alias_other = macro_f_string_static_t_initialize(alias_other_buffer, global.setting->rules.array[id_rule].alias.used); + const f_string_static_t alias_other = macro_f_string_static_t_initialize2(alias_other_buffer, global.setting->rules.array[id_rule].alias.used); f_thread_unlock(&global.thread->lock.rule); @@ -2472,7 +2472,7 @@ extern "C" { options_process = 0; - if (global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e) { + if (global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) { options_process |= controller_process_option_simulate_d; } @@ -4623,7 +4623,7 @@ extern "C" { rule->timeout_stop = number; } - if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) { + if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e)) { f_string_static_t name_sub = controller_stop_s; if (timeout_code == controller_rule_timeout_code_kill_d) { @@ -4815,7 +4815,7 @@ extern "C" { rule->nice = number; rule->has |= controller_rule_has_nice_d; - if (global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e || global.main->error.verbosity == f_console_verbosity_verbose_e) { + if (global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global.main->error.verbosity == f_console_verbosity_verbose_e) { cache->action.generic.used = 0; status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic); @@ -4895,7 +4895,7 @@ extern "C" { rule->user = number; rule->has |= controller_rule_has_user_d; - if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) { + if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e)) { cache->action.generic.used = 0; status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic); @@ -5125,7 +5125,7 @@ extern "C" { controller_rule_setting_read_print_values(global, controller_environment_s, i, cache); } else { - if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) { + if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e)) { controller_lock_print(global.main->output.to, global.thread); fl_print_format("%qProcessing rule item action '%[%q%]' setting value to an empty set.%q", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, controller_environment_s, global.main->context.set.title, f_string_eol_s); @@ -5354,7 +5354,7 @@ extern "C" { ++rule->ons.used; } - if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) { + if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e)) { controller_lock_print(global.main->output.to, global.thread); fl_print_format("%qProcessing rule item action '%[%S%]', adding ", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, controller_on_s, global.main->context.set.title); diff --git a/level_3/controller/c/rule/private-rule_print.c b/level_3/controller/c/rule/private-rule_print.c index 46db4de..f598578 100644 --- a/level_3/controller/c/rule/private-rule_print.c +++ b/level_3/controller/c/rule/private-rule_print.c @@ -303,7 +303,7 @@ extern "C" { #ifndef _di_controller_rule_setting_read_print_value_ void controller_rule_setting_read_print_value(const controller_global_t global, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix) { - if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) { + if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e)) { return; } @@ -328,7 +328,7 @@ extern "C" { #ifndef _di_controller_rule_setting_read_print_values_ void controller_rule_setting_read_print_values(const controller_global_t global, const f_string_static_t name, const f_array_length_t index, controller_cache_t * const cache) { - if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) { + if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e)) { return; } diff --git a/level_3/controller/c/thread/private-thread.c b/level_3/controller/c/thread/private-thread.c index c1913d9..033dc99 100644 --- a/level_3/controller/c/thread/private-thread.c +++ b/level_3/controller/c/thread/private-thread.c @@ -25,7 +25,7 @@ extern "C" { if (global->thread->enabled != controller_thread_enabled_e) return 0; - const struct timespec delay = controller_time_seconds(global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e ? controller_thread_cleanup_interval_short_d : controller_thread_cleanup_interval_long_d); + const struct timespec delay = controller_time_seconds(global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e ? controller_thread_cleanup_interval_short_d : controller_thread_cleanup_interval_long_d); f_status_t status = F_none; @@ -215,7 +215,7 @@ extern "C" { } } else { - if (main->parameters[controller_parameter_daemon_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_daemon_e].result == f_console_result_found_e) { setting->ready = controller_setting_ready_done_e; if (f_file_exists(setting->path_pid.string) == F_true) { @@ -254,7 +254,7 @@ extern "C" { // Only make the rule and control threads available once any/all pre-processing and are completed. if (F_status_is_error_not(status) && status != F_failure && status != F_child && thread.enabled == controller_thread_enabled_e) { - if (main->parameters[controller_parameter_validate_e].result == f_console_result_none_e) { + if (main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e) { // Wait for the entry thread to complete before starting the rule thread. controller_thread_join(&thread.id_rule); @@ -286,7 +286,7 @@ extern "C" { return F_child; } - if (F_status_is_error_not(status) && status != F_failure && main->parameters[controller_parameter_validate_e].result == f_console_result_none_e && controller_thread_is_enabled(F_true, &thread)) { + if (F_status_is_error_not(status) && status != F_failure && main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e && controller_thread_is_enabled(F_true, &thread)) { if (setting->mode == controller_setting_mode_service_e) { controller_thread_join(&thread.id_signal); diff --git a/level_3/controller/c/thread/private-thread_entry.c b/level_3/controller/c/thread/private-thread_entry.c index b0f4e68..ac148e7 100644 --- a/level_3/controller/c/thread/private-thread_entry.c +++ b/level_3/controller/c/thread/private-thread_entry.c @@ -36,7 +36,7 @@ extern "C" { } if (F_status_is_error_not(*status) && *status != F_child) { - if (main->parameters[controller_parameter_validate_e].result == f_console_result_none_e || main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e || main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) { if (entry->setting->entry.pid == controller_entry_pid_require_e && f_file_exists(entry->setting->path_pid.string) == F_true) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -163,7 +163,7 @@ extern "C" { } if (F_status_is_error_not(*status) && *status != F_child && *status != F_file_found_not) { - if (main->parameters[controller_parameter_validate_e].result == f_console_result_none_e || main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e) { + if (main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e || main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) { *status = controller_entry_process(entry->global, cache, F_false, F_false); diff --git a/level_3/fake/c/common.c b/level_3/fake/c/common.c index e1e1047..2e5a5ed 100644 --- a/level_3/fake/c/common.c +++ b/level_3/fake/c/common.c @@ -5,16 +5,16 @@ extern "C" { #endif #ifndef _di_fake_program_version_ - const f_string_static_t fake_program_version_s = macro_f_string_static_t_initialize2(FAKE_program_version_s, 0, FAKE_program_version_s_length); + const f_string_static_t fake_program_version_s = macro_f_string_static_t_initialize(FAKE_program_version_s, 0, FAKE_program_version_s_length); #endif // _di_fake_program_version_ #ifndef _di_fake_program_name_ - const f_string_static_t fake_program_name_s = macro_f_string_static_t_initialize2(FAKE_program_name_s, 0, FAKE_program_name_s_length); - const f_string_static_t fake_program_name_long_s = macro_f_string_static_t_initialize2(FAKE_program_name_long_s, 0, FAKE_program_name_long_s_length); + const f_string_static_t fake_program_name_s = macro_f_string_static_t_initialize(FAKE_program_name_s, 0, FAKE_program_name_s_length); + const f_string_static_t fake_program_name_long_s = macro_f_string_static_t_initialize(FAKE_program_name_long_s, 0, FAKE_program_name_long_s_length); #endif // _di_fake_program_name_ #ifndef _di_fake_program_help_parameters_ - const f_string_static_t fake_program_help_parameters_s = macro_f_string_static_t_initialize2(FAKE_program_help_parameters_s, 0, FAKE_program_help_parameters_s_length); + const f_string_static_t fake_program_help_parameters_s = macro_f_string_static_t_initialize(FAKE_program_help_parameters_s, 0, FAKE_program_help_parameters_s_length); #endif // _di_fake_program_help_parameters_ /** @@ -22,107 +22,102 @@ extern "C" { * These structures are hard-coded by their individual pieces to be constructed later on. */ #ifndef _di_fake_path_ - const f_string_static_t fake_path_part_bash_s = macro_f_string_static_t_initialize2(FAKE_path_part_bash_s, 0, FAKE_path_part_bash_s_length); - const f_string_static_t fake_path_part_build_s = macro_f_string_static_t_initialize2(FAKE_path_part_build_s, 0, FAKE_path_part_build_s_length); - const f_string_static_t fake_path_part_c_s = macro_f_string_static_t_initialize2(FAKE_path_part_c_s, 0, FAKE_path_part_c_s_length); - const f_string_static_t fake_path_part_cpp_s = macro_f_string_static_t_initialize2(FAKE_path_part_cpp_s, 0, FAKE_path_part_cpp_s_length); - const f_string_static_t fake_path_part_data_s = macro_f_string_static_t_initialize2(FAKE_path_part_data_s, 0, FAKE_path_part_data_s_length); - const f_string_static_t fake_path_part_documents_s = macro_f_string_static_t_initialize2(FAKE_path_part_documents_s, 0, FAKE_path_part_documents_s_length); - const f_string_static_t fake_path_part_includes_s = macro_f_string_static_t_initialize2(FAKE_path_part_includes_s, 0, FAKE_path_part_includes_s_length); - const f_string_static_t fake_path_part_libraries_s = macro_f_string_static_t_initialize2(FAKE_path_part_libraries_s, 0, FAKE_path_part_libraries_s_length); - const f_string_static_t fake_path_part_licenses_s = macro_f_string_static_t_initialize2(FAKE_path_part_licenses_s, 0, FAKE_path_part_licenses_s_length); - const f_string_static_t fake_path_part_objects_s = macro_f_string_static_t_initialize2(FAKE_path_part_objects_s, 0, FAKE_path_part_objects_s_length); - const f_string_static_t fake_path_part_process_s = macro_f_string_static_t_initialize2(FAKE_path_part_process_s, 0, FAKE_path_part_process_s_length); - const f_string_static_t fake_path_part_programs_s = macro_f_string_static_t_initialize2(FAKE_path_part_programs_s, 0, FAKE_path_part_programs_s_length); - const f_string_static_t fake_path_part_script_s = macro_f_string_static_t_initialize2(FAKE_path_part_script_s, 0, FAKE_path_part_script_s_length); - const f_string_static_t fake_path_part_settings_s = macro_f_string_static_t_initialize2(FAKE_path_part_settings_s, 0, FAKE_path_part_settings_s_length); - const f_string_static_t fake_path_part_shared_s = macro_f_string_static_t_initialize2(FAKE_path_part_shared_s, 0, FAKE_path_part_shared_s_length); - const f_string_static_t fake_path_part_stage_s = macro_f_string_static_t_initialize2(FAKE_path_part_stage_s, 0, FAKE_path_part_stage_s_length); - const f_string_static_t fake_path_part_static_s = macro_f_string_static_t_initialize2(FAKE_path_part_static_s, 0, FAKE_path_part_static_s_length); + const f_string_static_t fake_path_part_bash_s = macro_f_string_static_t_initialize(FAKE_path_part_bash_s, 0, FAKE_path_part_bash_s_length); + const f_string_static_t fake_path_part_build_s = macro_f_string_static_t_initialize(FAKE_path_part_build_s, 0, FAKE_path_part_build_s_length); + const f_string_static_t fake_path_part_c_s = macro_f_string_static_t_initialize(FAKE_path_part_c_s, 0, FAKE_path_part_c_s_length); + const f_string_static_t fake_path_part_cpp_s = macro_f_string_static_t_initialize(FAKE_path_part_cpp_s, 0, FAKE_path_part_cpp_s_length); + const f_string_static_t fake_path_part_data_s = macro_f_string_static_t_initialize(FAKE_path_part_data_s, 0, FAKE_path_part_data_s_length); + const f_string_static_t fake_path_part_documents_s = macro_f_string_static_t_initialize(FAKE_path_part_documents_s, 0, FAKE_path_part_documents_s_length); + const f_string_static_t fake_path_part_includes_s = macro_f_string_static_t_initialize(FAKE_path_part_includes_s, 0, FAKE_path_part_includes_s_length); + const f_string_static_t fake_path_part_libraries_s = macro_f_string_static_t_initialize(FAKE_path_part_libraries_s, 0, FAKE_path_part_libraries_s_length); + const f_string_static_t fake_path_part_licenses_s = macro_f_string_static_t_initialize(FAKE_path_part_licenses_s, 0, FAKE_path_part_licenses_s_length); + const f_string_static_t fake_path_part_objects_s = macro_f_string_static_t_initialize(FAKE_path_part_objects_s, 0, FAKE_path_part_objects_s_length); + const f_string_static_t fake_path_part_process_s = macro_f_string_static_t_initialize(FAKE_path_part_process_s, 0, FAKE_path_part_process_s_length); + const f_string_static_t fake_path_part_programs_s = macro_f_string_static_t_initialize(FAKE_path_part_programs_s, 0, FAKE_path_part_programs_s_length); + const f_string_static_t fake_path_part_script_s = macro_f_string_static_t_initialize(FAKE_path_part_script_s, 0, FAKE_path_part_script_s_length); + const f_string_static_t fake_path_part_settings_s = macro_f_string_static_t_initialize(FAKE_path_part_settings_s, 0, FAKE_path_part_settings_s_length); + const f_string_static_t fake_path_part_shared_s = macro_f_string_static_t_initialize(FAKE_path_part_shared_s, 0, FAKE_path_part_shared_s_length); + const f_string_static_t fake_path_part_stage_s = macro_f_string_static_t_initialize(FAKE_path_part_stage_s, 0, FAKE_path_part_stage_s_length); + const f_string_static_t fake_path_part_static_s = macro_f_string_static_t_initialize(FAKE_path_part_static_s, 0, FAKE_path_part_static_s_length); #endif // _di_fake_path_ #ifndef _di_fake_file_ - const f_string_static_t fake_file_defines_s = macro_f_string_static_t_initialize2(FAKE_file_defines_s, 0, FAKE_file_defines_s_length); - const f_string_static_t fake_file_dependencies_s = macro_f_string_static_t_initialize2(FAKE_file_dependencies_s, 0, FAKE_file_dependencies_s_length); - const f_string_static_t fake_file_process_pre_s = macro_f_string_static_t_initialize2(FAKE_file_process_pre_s, 0, FAKE_file_process_pre_s_length); - const f_string_static_t fake_file_process_post_s = macro_f_string_static_t_initialize2(FAKE_file_process_post_s, 0, FAKE_file_process_post_s_length); - const f_string_static_t fake_file_readme_s = macro_f_string_static_t_initialize2(FAKE_file_readme_s, 0, FAKE_file_readme_s_length); + const f_string_static_t fake_file_defines_s = macro_f_string_static_t_initialize(FAKE_file_defines_s, 0, FAKE_file_defines_s_length); + const f_string_static_t fake_file_dependencies_s = macro_f_string_static_t_initialize(FAKE_file_dependencies_s, 0, FAKE_file_dependencies_s_length); + const f_string_static_t fake_file_process_pre_s = macro_f_string_static_t_initialize(FAKE_file_process_pre_s, 0, FAKE_file_process_pre_s_length); + const f_string_static_t fake_file_process_post_s = macro_f_string_static_t_initialize(FAKE_file_process_post_s, 0, FAKE_file_process_post_s_length); + const f_string_static_t fake_file_readme_s = macro_f_string_static_t_initialize(FAKE_file_readme_s, 0, FAKE_file_readme_s_length); #endif // _di_fake_file_ /** * Provide default settings. */ #ifndef _di_fake_defaults_ - const f_string_static_t fake_default_path_build_s = macro_f_string_static_t_initialize2(FAKE_default_path_build_s, 0, FAKE_default_path_build_s_length); - const f_string_static_t fake_default_path_data_s = macro_f_string_static_t_initialize2(FAKE_default_path_data_s, 0, FAKE_default_path_data_s_length); - const f_string_static_t fake_default_path_sources_s = macro_f_string_static_t_initialize2(FAKE_default_path_sources_s, 0, FAKE_default_path_sources_s_length); - const f_string_static_t fake_default_path_work_s = macro_f_string_static_t_initialize2(FAKE_default_path_work_s, 0, FAKE_default_path_work_s_length); - - const f_string_static_t fake_default_define_s = macro_f_string_static_t_initialize2(FAKE_default_define_s, 0, FAKE_default_define_s_length); - const f_string_static_t fake_default_fakefile_s = macro_f_string_static_t_initialize2(FAKE_default_fakefile_s, 0, FAKE_default_fakefile_s_length); - const f_string_static_t fake_default_mode_s = macro_f_string_static_t_initialize2(FAKE_default_mode_s, 0, FAKE_default_mode_s_length); - const f_string_static_t fake_default_process_s = macro_f_string_static_t_initialize2(FAKE_default_process_s, 0, FAKE_default_process_s_length); - const f_string_static_t fake_default_settings_s = macro_f_string_static_t_initialize2(FAKE_default_settings_s, 0, FAKE_default_settings_s_length); + const f_string_static_t fake_default_path_build_s = macro_f_string_static_t_initialize(FAKE_default_path_build_s, 0, FAKE_default_path_build_s_length); + const f_string_static_t fake_default_path_data_s = macro_f_string_static_t_initialize(FAKE_default_path_data_s, 0, FAKE_default_path_data_s_length); + const f_string_static_t fake_default_path_sources_s = macro_f_string_static_t_initialize(FAKE_default_path_sources_s, 0, FAKE_default_path_sources_s_length); + const f_string_static_t fake_default_path_work_s = macro_f_string_static_t_initialize(FAKE_default_path_work_s, 0, FAKE_default_path_work_s_length); + + const f_string_static_t fake_default_define_s = macro_f_string_static_t_initialize(FAKE_default_define_s, 0, FAKE_default_define_s_length); + const f_string_static_t fake_default_fakefile_s = macro_f_string_static_t_initialize(FAKE_default_fakefile_s, 0, FAKE_default_fakefile_s_length); + const f_string_static_t fake_default_mode_s = macro_f_string_static_t_initialize(FAKE_default_mode_s, 0, FAKE_default_mode_s_length); + const f_string_static_t fake_default_process_s = macro_f_string_static_t_initialize(FAKE_default_process_s, 0, FAKE_default_process_s_length); + const f_string_static_t fake_default_settings_s = macro_f_string_static_t_initialize(FAKE_default_settings_s, 0, FAKE_default_settings_s_length); #endif // _di_fake_defaults_ #ifndef _di_fake_build_language_ - const f_string_static_t fake_build_language_bash_s = macro_f_string_static_t_initialize2(FAKE_build_language_bash_s, 0, FAKE_build_language_bash_s_length); - const f_string_static_t fake_build_language_c_s = macro_f_string_static_t_initialize2(FAKE_build_language_c_s, 0, FAKE_build_language_c_s_length); - const f_string_static_t fake_build_language_cpp_s = macro_f_string_static_t_initialize2(FAKE_build_language_cpp_s, 0, FAKE_build_language_cpp_s_length); + const f_string_static_t fake_build_language_bash_s = macro_f_string_static_t_initialize(FAKE_build_language_bash_s, 0, FAKE_build_language_bash_s_length); + const f_string_static_t fake_build_language_c_s = macro_f_string_static_t_initialize(FAKE_build_language_c_s, 0, FAKE_build_language_c_s_length); + const f_string_static_t fake_build_language_cpp_s = macro_f_string_static_t_initialize(FAKE_build_language_cpp_s, 0, FAKE_build_language_cpp_s_length); #endif // _di_fake_build_language_ #ifndef _di_fake_build_version_ - const f_string_static_t fake_build_version_major_s = macro_f_string_static_t_initialize2(FAKE_build_version_major_s, 0, FAKE_build_version_major_s_length); - const f_string_static_t fake_build_version_minor_s = macro_f_string_static_t_initialize2(FAKE_build_version_minor_s, 0, FAKE_build_version_minor_s_length); - const f_string_static_t fake_build_version_micro_s = macro_f_string_static_t_initialize2(FAKE_build_version_micro_s, 0, FAKE_build_version_micro_s_length); - const f_string_static_t fake_build_version_nano_s = macro_f_string_static_t_initialize2(FAKE_build_version_nano_s, 0, FAKE_build_version_nano_s_length); + const f_string_static_t fake_build_version_major_s = macro_f_string_static_t_initialize(FAKE_build_version_major_s, 0, FAKE_build_version_major_s_length); + const f_string_static_t fake_build_version_minor_s = macro_f_string_static_t_initialize(FAKE_build_version_minor_s, 0, FAKE_build_version_minor_s_length); + const f_string_static_t fake_build_version_micro_s = macro_f_string_static_t_initialize(FAKE_build_version_micro_s, 0, FAKE_build_version_micro_s_length); + const f_string_static_t fake_build_version_nano_s = macro_f_string_static_t_initialize(FAKE_build_version_nano_s, 0, FAKE_build_version_nano_s_length); #endif // _di_fake_build_version_ #ifndef _di_fake_defines_ - const f_string_static_t fake_short_define_s = macro_f_string_static_t_initialize2(FAKE_short_define_s, 0, FAKE_short_define_s_length); - const f_string_static_t fake_short_fakefile_s = macro_f_string_static_t_initialize2(FAKE_short_fakefile_s, 0, FAKE_short_fakefile_s_length); - const f_string_static_t fake_short_mode_s = macro_f_string_static_t_initialize2(FAKE_short_mode_s, 0, FAKE_short_mode_s_length); - const f_string_static_t fake_short_process_s = macro_f_string_static_t_initialize2(FAKE_short_process_s, 0, FAKE_short_process_s_length); - const f_string_static_t fake_short_settings_s = macro_f_string_static_t_initialize2(FAKE_short_settings_s, 0, FAKE_short_settings_s_length); - - const f_string_static_t fake_short_path_build_s = macro_f_string_static_t_initialize2(FAKE_short_path_build_s, 0, FAKE_short_path_build_s_length); - const f_string_static_t fake_short_path_data_s = macro_f_string_static_t_initialize2(FAKE_short_path_data_s, 0, FAKE_short_path_data_s_length); - const f_string_static_t fake_short_path_sources_s = macro_f_string_static_t_initialize2(FAKE_short_path_sources_s, 0, FAKE_short_path_sources_s_length); - const f_string_static_t fake_short_path_work_s = macro_f_string_static_t_initialize2(FAKE_short_path_work_s, 0, FAKE_short_path_work_s_length); - - const f_string_static_t fake_long_define_s = macro_f_string_static_t_initialize2(FAKE_long_define_s, 0, FAKE_long_define_s_length); - const f_string_static_t fake_long_fakefile_s = macro_f_string_static_t_initialize2(FAKE_long_fakefile_s, 0, FAKE_long_fakefile_s_length); - const f_string_static_t fake_long_mode_s = macro_f_string_static_t_initialize2(FAKE_long_mode_s, 0, FAKE_long_mode_s_length); - const f_string_static_t fake_long_process_s = macro_f_string_static_t_initialize2(FAKE_long_process_s, 0, FAKE_long_process_s_length); - const f_string_static_t fake_long_settings_s = macro_f_string_static_t_initialize2(FAKE_long_settings_s, 0, FAKE_long_settings_s_length); - - const f_string_static_t fake_long_path_build_s = macro_f_string_static_t_initialize2(FAKE_long_path_build_s, 0, FAKE_long_path_build_s_length); - const f_string_static_t fake_long_path_data_s = macro_f_string_static_t_initialize2(FAKE_long_path_data_s, 0, FAKE_long_path_data_s_length); - const f_string_static_t fake_long_path_sources_s = macro_f_string_static_t_initialize2(FAKE_long_path_sources_s, 0, FAKE_long_path_sources_s_length); - const f_string_static_t fake_long_path_work_s = macro_f_string_static_t_initialize2(FAKE_long_path_work_s, 0, FAKE_long_path_work_s_length); - - const f_string_static_t fake_long_documents_disabled_s = macro_f_string_static_t_initialize2(FAKE_long_documents_disabled_s, 0, FAKE_long_documents_disabled_s_length); - const f_string_static_t fake_long_documents_enabled_s = macro_f_string_static_t_initialize2(FAKE_long_documents_enabled_s, 0, FAKE_long_documents_enabled_s_length); - const f_string_static_t fake_long_shared_disabled_s = macro_f_string_static_t_initialize2(FAKE_long_shared_disabled_s, 0, FAKE_long_shared_disabled_s_length); - const f_string_static_t fake_long_shared_enabled_s = macro_f_string_static_t_initialize2(FAKE_long_shared_enabled_s, 0, FAKE_long_shared_enabled_s_length); - const f_string_static_t fake_long_static_disabled_s = macro_f_string_static_t_initialize2(FAKE_long_static_disabled_s, 0, FAKE_long_static_disabled_s_length); - const f_string_static_t fake_long_static_enabled_s = macro_f_string_static_t_initialize2(FAKE_long_static_enabled_s, 0, FAKE_long_static_enabled_s_length); - - const f_string_static_t fake_other_operation_build_s = macro_f_string_static_t_initialize2(FAKE_other_operation_build_s, 0, FAKE_other_operation_build_s_length); - const f_string_static_t fake_other_operation_clean_s = macro_f_string_static_t_initialize2(FAKE_other_operation_clean_s, 0, FAKE_other_operation_clean_s_length); - const f_string_static_t fake_other_operation_make_s = macro_f_string_static_t_initialize2(FAKE_other_operation_make_s, 0, FAKE_other_operation_make_s_length); - const f_string_static_t fake_other_operation_skeleton_s = macro_f_string_static_t_initialize2(FAKE_other_operation_skeleton_s, 0, FAKE_other_operation_skeleton_s_length); + const f_string_static_t fake_short_define_s = macro_f_string_static_t_initialize(FAKE_short_define_s, 0, FAKE_short_define_s_length); + const f_string_static_t fake_short_fakefile_s = macro_f_string_static_t_initialize(FAKE_short_fakefile_s, 0, FAKE_short_fakefile_s_length); + const f_string_static_t fake_short_mode_s = macro_f_string_static_t_initialize(FAKE_short_mode_s, 0, FAKE_short_mode_s_length); + const f_string_static_t fake_short_process_s = macro_f_string_static_t_initialize(FAKE_short_process_s, 0, FAKE_short_process_s_length); + const f_string_static_t fake_short_settings_s = macro_f_string_static_t_initialize(FAKE_short_settings_s, 0, FAKE_short_settings_s_length); + + const f_string_static_t fake_short_path_build_s = macro_f_string_static_t_initialize(FAKE_short_path_build_s, 0, FAKE_short_path_build_s_length); + const f_string_static_t fake_short_path_data_s = macro_f_string_static_t_initialize(FAKE_short_path_data_s, 0, FAKE_short_path_data_s_length); + const f_string_static_t fake_short_path_sources_s = macro_f_string_static_t_initialize(FAKE_short_path_sources_s, 0, FAKE_short_path_sources_s_length); + const f_string_static_t fake_short_path_work_s = macro_f_string_static_t_initialize(FAKE_short_path_work_s, 0, FAKE_short_path_work_s_length); + + const f_string_static_t fake_long_define_s = macro_f_string_static_t_initialize(FAKE_long_define_s, 0, FAKE_long_define_s_length); + const f_string_static_t fake_long_fakefile_s = macro_f_string_static_t_initialize(FAKE_long_fakefile_s, 0, FAKE_long_fakefile_s_length); + const f_string_static_t fake_long_mode_s = macro_f_string_static_t_initialize(FAKE_long_mode_s, 0, FAKE_long_mode_s_length); + const f_string_static_t fake_long_process_s = macro_f_string_static_t_initialize(FAKE_long_process_s, 0, FAKE_long_process_s_length); + const f_string_static_t fake_long_settings_s = macro_f_string_static_t_initialize(FAKE_long_settings_s, 0, FAKE_long_settings_s_length); + + const f_string_static_t fake_long_path_build_s = macro_f_string_static_t_initialize(FAKE_long_path_build_s, 0, FAKE_long_path_build_s_length); + const f_string_static_t fake_long_path_data_s = macro_f_string_static_t_initialize(FAKE_long_path_data_s, 0, FAKE_long_path_data_s_length); + const f_string_static_t fake_long_path_sources_s = macro_f_string_static_t_initialize(FAKE_long_path_sources_s, 0, FAKE_long_path_sources_s_length); + const f_string_static_t fake_long_path_work_s = macro_f_string_static_t_initialize(FAKE_long_path_work_s, 0, FAKE_long_path_work_s_length); + + const f_string_static_t fake_long_documents_disabled_s = macro_f_string_static_t_initialize(FAKE_long_documents_disabled_s, 0, FAKE_long_documents_disabled_s_length); + const f_string_static_t fake_long_documents_enabled_s = macro_f_string_static_t_initialize(FAKE_long_documents_enabled_s, 0, FAKE_long_documents_enabled_s_length); + const f_string_static_t fake_long_shared_disabled_s = macro_f_string_static_t_initialize(FAKE_long_shared_disabled_s, 0, FAKE_long_shared_disabled_s_length); + const f_string_static_t fake_long_shared_enabled_s = macro_f_string_static_t_initialize(FAKE_long_shared_enabled_s, 0, FAKE_long_shared_enabled_s_length); + const f_string_static_t fake_long_static_disabled_s = macro_f_string_static_t_initialize(FAKE_long_static_disabled_s, 0, FAKE_long_static_disabled_s_length); + const f_string_static_t fake_long_static_enabled_s = macro_f_string_static_t_initialize(FAKE_long_static_enabled_s, 0, FAKE_long_static_enabled_s_length); + + const f_string_static_t fake_other_operation_build_s = macro_f_string_static_t_initialize(FAKE_other_operation_build_s, 0, FAKE_other_operation_build_s_length); + const f_string_static_t fake_other_operation_clean_s = macro_f_string_static_t_initialize(FAKE_other_operation_clean_s, 0, FAKE_other_operation_clean_s_length); + const f_string_static_t fake_other_operation_make_s = macro_f_string_static_t_initialize(FAKE_other_operation_make_s, 0, FAKE_other_operation_make_s_length); + const f_string_static_t fake_other_operation_skeleton_s = macro_f_string_static_t_initialize(FAKE_other_operation_skeleton_s, 0, FAKE_other_operation_skeleton_s_length); #endif // _di_fake_defines_ #ifndef _di_fake_main_delete_ f_status_t fake_main_delete(fake_main_t * const main) { - for (f_array_length_t i = 0; i < fake_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fake/c/common.h b/level_3/fake/c/common.h index be25427..40a51c1 100644 --- a/level_3/fake/c/common.h +++ b/level_3/fake/c/common.h @@ -422,7 +422,7 @@ extern "C" { #ifndef _di_fake_main_t_ typedef struct { - f_console_parameter_t parameters[fake_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -497,7 +497,7 @@ extern "C" { #define fake_main_t_initialize \ { \ - fake_console_parameter_t_initialize, \ + macro_f_console_parameters_t_initialize(fake_console_parameter_t_initialize, fake_total_parameters_d) \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 3a14fab..b74453e 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -88,89 +88,90 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fake_total_parameters_d); + f_console_parameter_t parameters[] = fake_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fake_total_parameters_d; - // Load all parameters and identify priority of color parameters. - { - f_console_parameter_id_t ids[3] = { fake_parameter_no_color_e, fake_parameter_light_e, fake_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + // Load all parameters and identify priority of color parameters. + { + f_console_parameter_id_t ids[3] = { fake_parameter_no_color_e, fake_parameter_light_e, fake_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - fake_main_delete(main); - return status; - } + fake_main_delete(main); + return status; } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fake_parameter_verbosity_quiet_e, fake_parameter_verbosity_normal_e, fake_parameter_verbosity_verbose_e, fake_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fake_parameter_verbosity_quiet_e, fake_parameter_verbosity_normal_e, fake_parameter_verbosity_verbose_e, fake_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - fake_main_delete(main); - return status; - } + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - if (choice == fake_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fake_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fake_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fake_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + fake_main_delete(main); + return status; } - status = F_none; + if (choice == fake_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fake_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fake_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fake_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - f_array_length_t operations_length = main->parameters[fake_parameter_operation_build_e].locations.used; + f_string_static_t * const argv = main->parameters.arguments.array; + status = F_none; + + f_array_length_t operations_length = main->parameters.array[fake_parameter_operation_build_e].locations.used; - operations_length += main->parameters[fake_parameter_operation_clean_e].locations.used; - operations_length += main->parameters[fake_parameter_operation_make_e].locations.used; - operations_length += main->parameters[fake_parameter_operation_skeleton_e].locations.used; + operations_length += main->parameters.array[fake_parameter_operation_clean_e].locations.used; + operations_length += main->parameters.array[fake_parameter_operation_make_e].locations.used; + operations_length += main->parameters.array[fake_parameter_operation_skeleton_e].locations.used; uint8_t operations[operations_length]; f_string_static_t operations_name = f_string_static_t_initialize; @@ -182,17 +183,17 @@ extern "C" { f_array_length_t j = 0; f_array_length_t k = 0; - for (; i < main->parameters[fake_parameter_operation_build_e].locations.used; ++i, ++locations_length) { + for (; i < main->parameters.array[fake_parameter_operation_build_e].locations.used; ++i, ++locations_length) { operations[locations_length] = fake_operation_build_e; - locations[locations_length] = main->parameters[fake_parameter_operation_build_e].locations.array[i]; + locations[locations_length] = main->parameters.array[fake_parameter_operation_build_e].locations.array[i]; } // for - for (i = 0; i < main->parameters[fake_parameter_operation_clean_e].locations.used; ++i) { + for (i = 0; i < main->parameters.array[fake_parameter_operation_clean_e].locations.used; ++i) { for (j = 0; j < locations_length; ++j) { - if (main->parameters[fake_parameter_operation_clean_e].locations.array[i] < locations[j]) { + if (main->parameters.array[fake_parameter_operation_clean_e].locations.array[i] < locations[j]) { for (k = locations_length; k > j; --k) { locations[k] = locations[k - 1]; operations[k] = operations[k - 1]; @@ -202,16 +203,16 @@ extern "C" { } } // for - locations[j] = main->parameters[fake_parameter_operation_clean_e].locations.array[i]; + locations[j] = main->parameters.array[fake_parameter_operation_clean_e].locations.array[i]; operations[j] = fake_operation_clean_e; ++locations_length; } // for - for (i = 0; i < main->parameters[fake_parameter_operation_make_e].locations.used; ++i) { + for (i = 0; i < main->parameters.array[fake_parameter_operation_make_e].locations.used; ++i) { for (j = 0; j < locations_length; ++j) { - if (main->parameters[fake_parameter_operation_make_e].locations.array[i] < locations[j]) { + if (main->parameters.array[fake_parameter_operation_make_e].locations.array[i] < locations[j]) { for (k = locations_length; k > j; --k) { locations[k] = locations[k - 1]; operations[k] = operations[k - 1]; @@ -221,16 +222,16 @@ extern "C" { } } // for - locations[j] = main->parameters[fake_parameter_operation_make_e].locations.array[i]; + locations[j] = main->parameters.array[fake_parameter_operation_make_e].locations.array[i]; operations[j] = fake_operation_make_e; ++locations_length; } // for - for (i = 0; i < main->parameters[fake_parameter_operation_skeleton_e].locations.used; ++i) { + for (i = 0; i < main->parameters.array[fake_parameter_operation_skeleton_e].locations.used; ++i) { for (j = 0; j < locations_length; ++j) { - if (main->parameters[fake_parameter_operation_skeleton_e].locations.array[i] < locations[j]) { + if (main->parameters.array[fake_parameter_operation_skeleton_e].locations.array[i] < locations[j]) { for (k = locations_length; k > j; --k) { locations[k] = locations[k - 1]; @@ -241,7 +242,7 @@ extern "C" { } } // for - locations[j] = main->parameters[fake_parameter_operation_skeleton_e].locations.array[i]; + locations[j] = main->parameters.array[fake_parameter_operation_skeleton_e].locations.array[i]; operations[j] = fake_operation_skeleton_e; ++locations_length; } // for @@ -249,7 +250,7 @@ extern "C" { status = F_none; - if (main->parameters[fake_parameter_help_e].result == f_console_result_found_e) { + if (main->parameters.array[fake_parameter_help_e].result == f_console_result_found_e) { fake_print_help(main->output.to, main->context); fake_main_delete(main); @@ -257,7 +258,7 @@ extern "C" { return F_none; } - if (main->parameters[fake_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fake_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fake_program_version_s); fake_main_delete(main); diff --git a/level_3/fake/c/private-build-library.c b/level_3/fake/c/private-build-library.c index a7af0a4..7f2b52d 100644 --- a/level_3/fake/c/private-build-library.c +++ b/level_3/fake/c/private-build-library.c @@ -43,13 +43,13 @@ extern "C" { path_sources = &main->path_sources_cpp; } } - else if (main->parameters[fake_parameter_path_sources_e].result != f_console_result_additional_e) { + else if (main->parameters.array[fake_parameter_path_sources_e].result != f_console_result_additional_e) { path_sources = &data_build.setting.path_sources; } f_array_length_t i = 0; f_array_length_t j = 0; - f_array_length_t source_length = 0; + f_string_static_t source = f_string_static_t_initialize; const f_string_dynamics_t *sources[2] = { &data_build.setting.build_sources_library, @@ -62,15 +62,16 @@ extern "C" { if (!sources[i]->array[j].used) continue; - source_length = path_sources->used + sources[i]->array[j].used; + source.used = path_sources->used + sources[i]->array[j].used; - char source[source_length + 1]; + char source_string[source.used + 1]; + source.string = source_string; - memcpy(source, path_sources->string, path_sources->used); - memcpy(source + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used); - source[source_length] = 0; + memcpy(source_string, path_sources->string, path_sources->used); + memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used); + source_string[source.used] = 0; - *status = fll_execute_arguments_add(source, source_length, &arguments); + *status = fll_execute_arguments_add(source, &arguments); if (F_status_is_error(*status)) break; } // for @@ -86,7 +87,7 @@ extern "C" { } } - const f_array_length_t parameter_file_name_length = fake_build_parameter_library_name_prefix_s_length + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_shared_s_length; + const f_array_length_t parameter_file_name_length = fake_build_parameter_library_name_prefix_s.used + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_shared_s.used; const f_array_length_t parameter_file_name_major_length = data_build.setting.version_major.used ? parameter_file_name_length + data_build.setting.version_major_prefix.used + data_build.setting.version_major.used : 0; const f_array_length_t parameter_file_name_minor_length = data_build.setting.version_minor.used ? parameter_file_name_major_length + data_build.setting.version_minor_prefix.used + data_build.setting.version_minor.used : 0; const f_array_length_t parameter_file_name_micro_length = data_build.setting.version_micro.used ? parameter_file_name_minor_length + data_build.setting.version_micro_prefix.used + data_build.setting.version_micro.used : 0; @@ -104,25 +105,25 @@ extern "C" { parameter_file_name_micro[parameter_file_name_micro_length] = 0; parameter_file_name_nano[parameter_file_name_nano_length] = 0; - memcpy(parameter_file_name, fake_build_parameter_library_name_prefix_s, fake_build_parameter_library_name_prefix_s_length); + memcpy(parameter_file_name, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used); if (parameter_file_name_major_length) { - memcpy(parameter_file_name_major, fake_build_parameter_library_name_prefix_s, fake_build_parameter_library_name_prefix_s_length); + memcpy(parameter_file_name_major, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used); if (parameter_file_name_minor_length) { - memcpy(parameter_file_name_minor, fake_build_parameter_library_name_prefix_s, fake_build_parameter_library_name_prefix_s_length); + memcpy(parameter_file_name_minor, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used); if (parameter_file_name_micro_length) { - memcpy(parameter_file_name_micro, fake_build_parameter_library_name_prefix_s, fake_build_parameter_library_name_prefix_s_length); + memcpy(parameter_file_name_micro, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used); if (parameter_file_name_nano_length) { - memcpy(parameter_file_name_nano, fake_build_parameter_library_name_prefix_s, fake_build_parameter_library_name_prefix_s_length); + memcpy(parameter_file_name_nano, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used); } } } } - f_array_length_t count = fake_build_parameter_library_name_prefix_s_length; + f_array_length_t count = fake_build_parameter_library_name_prefix_s.used; memcpy(parameter_file_name + count, data_build.setting.project_name.string, data_build.setting.project_name.used); @@ -144,26 +145,26 @@ extern "C" { count += data_build.setting.project_name.used; - memcpy(parameter_file_name + count, fake_build_parameter_library_name_suffix_shared_s, fake_build_parameter_library_name_suffix_shared_s_length); + memcpy(parameter_file_name + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used); if (parameter_file_name_major_length) { - memcpy(parameter_file_name_major + count, fake_build_parameter_library_name_suffix_shared_s, fake_build_parameter_library_name_suffix_shared_s_length); + memcpy(parameter_file_name_major + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used); if (parameter_file_name_minor_length) { - memcpy(parameter_file_name_minor + count, fake_build_parameter_library_name_suffix_shared_s, fake_build_parameter_library_name_suffix_shared_s_length); + memcpy(parameter_file_name_minor + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used); if (parameter_file_name_micro_length) { - memcpy(parameter_file_name_micro + count, fake_build_parameter_library_name_suffix_shared_s, fake_build_parameter_library_name_suffix_shared_s_length); + memcpy(parameter_file_name_micro + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used); if (parameter_file_name_nano_length) { - memcpy(parameter_file_name_nano + count, fake_build_parameter_library_name_suffix_shared_s, fake_build_parameter_library_name_suffix_shared_s_length); + memcpy(parameter_file_name_nano + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used); } } } } if (parameter_file_name_major_length) { - count += fake_build_parameter_library_name_suffix_shared_s_length; + count += fake_build_parameter_library_name_suffix_shared_s.used; if (data_build.setting.version_major_prefix.used) { memcpy(parameter_file_name_major + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used); @@ -256,7 +257,7 @@ extern "C" { } { - f_array_length_t parameter_linker_length = fake_build_parameter_library_shared_prefix_s_length; + f_array_length_t parameter_linker_length = fake_build_parameter_library_shared_prefix_s.used; f_array_length_t parameter_file_path_length = main->path_build_libraries_shared.used; if (data_build.setting.version_file == fake_build_version_type_major_e) { @@ -288,7 +289,7 @@ extern "C" { char parameter_linker[parameter_linker_length + 1]; char parameter_file_path[parameter_file_path_length + 1]; - memcpy(parameter_linker, fake_build_parameter_library_shared_prefix_s, fake_build_parameter_library_shared_prefix_s_length); + memcpy(parameter_linker, fake_build_parameter_library_shared_prefix_s.string, fake_build_parameter_library_shared_prefix_s.used); memcpy(parameter_file_path, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used); if (data_build.setting.version_file == fake_build_version_type_major_e) { @@ -305,40 +306,33 @@ extern "C" { } if (data_build.setting.version_target == fake_build_version_type_major_e) { - memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s_length, parameter_file_name_major, parameter_file_name_major_length); + memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_major, parameter_file_name_major_length); } else if (data_build.setting.version_target == fake_build_version_type_minor_e) { - memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s_length, parameter_file_name_minor, parameter_file_name_minor_length); + memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_minor, parameter_file_name_minor_length); } else if (data_build.setting.version_target == fake_build_version_type_micro_e) { - memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s_length, parameter_file_name_micro, parameter_file_name_micro_length); + memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_micro, parameter_file_name_micro_length); } else if (data_build.setting.version_target == fake_build_version_type_nano_e) { - memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s_length, parameter_file_name_nano, parameter_file_name_nano_length); + memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_nano, parameter_file_name_nano_length); } parameter_linker[parameter_linker_length] = 0; parameter_file_path[parameter_file_path_length] = 0; - const f_string_t values[] = { + const f_string_static_t values[] = { fake_build_parameter_library_shared_s, - parameter_linker, + macro_f_string_static_t_initialize(parameter_linker, 0, parameter_linker_length), fake_build_parameter_library_output_s, - parameter_file_path, - }; - - const f_array_length_t lengths[] = { - fake_build_parameter_library_shared_s_length, - parameter_linker_length, - fake_build_parameter_library_output_s_length, - parameter_file_path_length, + macro_f_string_static_t_initialize(parameter_file_path, 0, parameter_file_path_length), }; for (uint8_t i = 0; i < 4; ++i) { - if (!lengths[i]) continue; + if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], lengths[i], &arguments); + *status = fll_execute_arguments_add(values[i], &arguments); if (F_status_is_error(*status)) break; } // for @@ -503,37 +497,39 @@ extern "C" { if (!data_build.setting.build_indexer_arguments.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.build_indexer_arguments.array[i].string, data_build.setting.build_indexer_arguments.array[i].used, &arguments); + *status = fll_execute_arguments_add(data_build.setting.build_indexer_arguments.array[i], &arguments); if (F_status_is_error(*status)) break; } // for if (F_status_is_error_not(*status)) { - f_array_length_t destination_length = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s_length; - destination_length += data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_static_s_length; + f_string_static_t destination = f_string_static_t_initialize; + destination.used = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used; + destination.used += data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_static_s.used; - char destination[destination_length + 1]; + char destination_string[destination.used + 1]; + destination.string = destination_string; - destination_length = 0; + destination.used = 0; - memcpy(destination, main->path_build_libraries_static.string, main->path_build_libraries_static.used); - destination_length += main->path_build_libraries_static.used; + memcpy(destination_string, main->path_build_libraries_static.string, main->path_build_libraries_static.used); + destination.used += main->path_build_libraries_static.used; - memcpy(destination + destination_length, fake_build_parameter_library_name_prefix_s, fake_build_parameter_library_name_prefix_s_length); - destination_length += fake_build_parameter_library_name_prefix_s_length; + memcpy(destination_string + destination.used, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used); + destination.used += fake_build_parameter_library_name_prefix_s.used; - memcpy(destination + destination_length, data_build.setting.project_name.string, data_build.setting.project_name.used); - destination_length += data_build.setting.project_name.used; + memcpy(destination_string + destination.used, data_build.setting.project_name.string, data_build.setting.project_name.used); + destination.used += data_build.setting.project_name.used; - memcpy(destination + destination_length, fake_build_parameter_library_name_suffix_static_s, fake_build_parameter_library_name_suffix_static_s_length); - destination_length += fake_build_parameter_library_name_suffix_static_s_length; + memcpy(destination_string + destination.used, fake_build_parameter_library_name_suffix_static_s.string, fake_build_parameter_library_name_suffix_static_s.used); + destination.used += fake_build_parameter_library_name_suffix_static_s.used; - destination[destination_length] = 0; + destination_string[destination.used] = 0; - *status = fll_execute_arguments_add(destination, destination_length, &arguments); + *status = fll_execute_arguments_add(destination, &arguments); } if (F_status_is_error_not(*status)) { - f_array_length_t source_length = 0; + f_string_static_t source = f_string_static_t_initialize; f_array_length_t j = 0; const f_string_dynamics_t *sources[2] = { @@ -588,28 +584,29 @@ extern "C" { break; } - source_length = source_path.used + file_name.used + fake_build_parameter_object_name_suffix_s_length; + source.used = source_path.used + file_name.used + fake_build_parameter_object_name_suffix_s.used; } else { - source_length = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s_length; + source.used = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used; } - char source[source_length + 1]; + char source_string[source.used + 1]; + source.string = source_string; if (source_path.used) { - memcpy(source, source_path.string, source_path.used); - memcpy(source + source_path.used, file_name.string, file_name.used); - memcpy(source + source_path.used + file_name.used, fake_build_parameter_object_name_suffix_s, fake_build_parameter_object_name_suffix_s_length); + memcpy(source_string, source_path.string, source_path.used); + memcpy(source_string + source_path.used, file_name.string, file_name.used); + memcpy(source_string + source_path.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, fake_build_parameter_object_name_suffix_s.used); } else { - memcpy(source, main->path_build_objects.string, main->path_build_objects.used); - memcpy(source + main->path_build_objects.used, file_name.string, file_name.used); - memcpy(source + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s, fake_build_parameter_object_name_suffix_s_length); + memcpy(source_string, main->path_build_objects.string, main->path_build_objects.used); + memcpy(source_string + main->path_build_objects.used, file_name.string, file_name.used); + memcpy(source_string + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, fake_build_parameter_object_name_suffix_s.used); } - source[source_length] = 0; + source_string[source.used] = 0; - *status = fll_execute_arguments_add(source, source_length, &arguments); + *status = fll_execute_arguments_add(source, &arguments); if (F_status_is_error(*status)) { fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); diff --git a/level_3/fake/c/private-build-load.c b/level_3/fake/c/private-build-load.c index f03d44b..eb00819 100644 --- a/level_3/fake/c/private-build-load.c +++ b/level_3/fake/c/private-build-load.c @@ -32,17 +32,14 @@ extern "C" { for (uint8_t i = 0; i < 2; ++i) { - *status = fl_environment_load_name(variables[i].string, variables[i].used, environment); + *status = fl_environment_load_name(variables[i], environment); if (F_status_is_error(*status)) { fll_error_print(main->error, F_status_set_fine(*status), "fl_environment_load_name", F_true); - break; + + return; } } // for - - if (F_status_is_error(*status)) { - return; - } } if (environment->used + data_build.setting.environment.used > environment->size) { @@ -84,7 +81,11 @@ extern "C" { return; } - char path_file[main->path_data_build.used + setting_file.used + 1]; + f_string_static_t path_file = f_string_static_t_initialize; + path_file.used = main->path_data_build.used + setting_file.used; + + char path_file_string[path_file.used + 1]; + path_file.string = path_file_string; { f_string_dynamic_t buffer = f_string_dynamic_t_initialize; @@ -93,15 +94,15 @@ extern "C" { f_fss_contents_t contents = f_fss_contents_t_initialize; if (setting_file.used) { - memcpy(path_file, main->path_data_build.string, main->path_data_build.used); - memcpy(path_file + main->path_data_build.used, setting_file.string, setting_file.used); + memcpy(path_file_string, main->path_data_build.string, main->path_data_build.used); + memcpy(path_file_string + main->path_data_build.used, setting_file.string, setting_file.used); - path_file[main->path_data_build.used + setting_file.used] = 0; + path_file_string[main->path_data_build.used + setting_file.used] = 0; *status = fake_file_buffer(main, path_file, &buffer); } else { - *status = fake_file_buffer(main, main->file_data_build_settings.string, &buffer); + *status = fake_file_buffer(main, main->file_data_build_settings, &buffer); } if (F_status_is_error_not(*status)) { @@ -124,7 +125,7 @@ extern "C" { fll_error_print(main->error, F_status_set_fine(*status), "fl_fss_apply_delimit", F_true); } else { - fake_build_load_setting_process(main, F_true, setting_file.used ? path_file : main->file_data_build_settings.string, buffer, objects, contents, setting, status); + fake_build_load_setting_process(main, F_true, setting_file.used ? path_file : main->file_data_build_settings, buffer, objects, contents, setting, status); } } @@ -157,7 +158,7 @@ extern "C" { fl_print_format("%q%[%QThe setting '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, names[i], main->error.notable); fl_print_format("%[' is required but is not specified in the settings file '%]", main->error.to.stream, main->error.context, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, setting_file.used ? path_file : main->file_data_build_settings.string, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, setting_file.used ? path_file : main->file_data_build_settings, main->error.notable); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); funlockfile(main->error.to.stream); @@ -178,7 +179,7 @@ extern "C" { #endif // _di_fake_build_load_setting_ #ifndef _di_fake_build_load_setting_process_ - void fake_build_load_setting_process(fake_main_t * const main, const bool checks, const f_string_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t *setting, f_status_t *status) { + void fake_build_load_setting_process(fake_main_t * const main, const bool checks, const f_string_static_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t *setting, f_status_t *status) { if (F_status_is_error(*status) && buffer.used) return; @@ -448,9 +449,7 @@ extern "C" { const int total_build_libraries = setting->build_libraries.used; const f_string_dynamics_t *modes = &setting->modes_default; - f_string_dynamic_t settings_mode_name_dynamic[fake_build_setting_total_d]; - f_string_t settings_mode_names[fake_build_setting_total_d]; - f_array_length_t setting_mode_lengths[fake_build_setting_total_d]; + f_string_dynamic_t settings_mode_names[fake_build_setting_total_d]; bool found = F_false; @@ -482,7 +481,7 @@ extern "C" { fl_print_format("%q%[%QThe specified mode '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, modes->array[i], main->error.notable); fl_print_format("%[' is not a valid mode, according to '%]", main->error.to.stream, main->error.context, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); funlockfile(main->error.to.stream); @@ -494,31 +493,32 @@ extern "C" { break; } - memset(&settings_mode_name_dynamic, 0, sizeof(f_string_dynamic_t) * fake_build_setting_total_d); - memset(&settings_mode_names, 0, sizeof(f_string_t) * fake_build_setting_total_d); - memset(&setting_mode_lengths, 0, sizeof(f_array_length_t) * fake_build_setting_total_d); + memset(&settings_mode_names, 0, sizeof(f_string_dynamic_t) * fake_build_setting_total_d); for (j = 0; j < fake_build_setting_total_d; ++j) { - setting_mode_lengths[j] = settings_length[j] + 1 + modes->array[i].used; + settings_mode_names[j].used = 0; - *status = f_string_dynamic_resize(setting_mode_lengths[j], &settings_mode_name_dynamic[j]); + *status = f_string_dynamic_increase_by(settings_length[j] + f_string_ascii_minus_s.used + modes->array[i].used, &settings_mode_names[j]); if (F_status_is_error(*status)) { - function = "macro_f_string_dynamic_t_resize"; + function = "f_string_dynamic_increase_by"; break; } - memcpy(settings_mode_name_dynamic[j].string, settings_name[j], settings_length[j]); - memcpy(settings_mode_name_dynamic[j].string + settings_length[j] + 1, modes->array[i].string, modes->array[i].used); - settings_mode_name_dynamic[j].string[settings_length[j]] = '-'; + memcpy(settings_mode_names[j].string, settings_name[j], settings_length[j]); + settings_mode_names[j].used = settings_length[j]; + + memcpy(settings_mode_names[j].string, f_string_ascii_minus_s.string, f_string_ascii_minus_s.used); + settings_mode_names[j].used += f_string_ascii_minus_s.used; - settings_mode_names[j] = settings_mode_name_dynamic[j].string; + memcpy(settings_mode_names[j].string + settings_mode_namesf[j].used, modes->array[i].string, modes->array[i].used); + settings_mode_names[j].used += modes->array[i].used; } // for if (*status == F_none) { - *status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, setting_mode_lengths, fake_build_setting_total_d, settings_value, 0, 0); + *status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, fake_build_setting_total_d, settings_value, 0, 0); if (F_status_is_error(*status)) { function = "fll_fss_snatch_apart"; @@ -526,7 +526,7 @@ extern "C" { } for (j = 0; j < fake_build_setting_total_d; ++j) { - f_string_dynamic_resize(0, &settings_mode_name_dynamic[j]); + f_string_dynamic_resize(0, &settings_mode_names[j]); } // for if (F_status_is_error(*status)) break; @@ -565,7 +565,7 @@ extern "C" { funlockfile(main->error.to.stream); fl_print_format("%q%[%QA setting in the file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); fl_print_format("%[' is too long.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); funlockfile(main->error.to.stream); @@ -1233,9 +1233,9 @@ extern "C" { if (F_status_is_error(*status)) return; // Override setting file when any of these are specified in the command line. - if (main->parameters[fake_parameter_shared_disabled_e].result == f_console_result_found_e) { - if (main->parameters[fake_parameter_shared_enabled_e].result == f_console_result_found_e) { - if (main->parameters[fake_parameter_shared_enabled_e].location > main->parameters[fake_parameter_shared_disabled_e].location) { + if (main->parameters.array[fake_parameter_shared_disabled_e].result == f_console_result_found_e) { + if (main->parameters.array[fake_parameter_shared_enabled_e].result == f_console_result_found_e) { + if (main->parameters.array[fake_parameter_shared_enabled_e].location > main->parameters.array[fake_parameter_shared_disabled_e].location) { setting->build_shared = F_true; setting->search_shared = F_true; } @@ -1263,14 +1263,14 @@ extern "C" { setting->search_shared = F_false; } } - else if (main->parameters[fake_parameter_shared_enabled_e].result == f_console_result_found_e) { + else if (main->parameters.array[fake_parameter_shared_enabled_e].result == f_console_result_found_e) { setting->build_shared = F_true; setting->search_shared = F_true; } - if (main->parameters[fake_parameter_static_disabled_e].result == f_console_result_found_e) { - if (main->parameters[fake_parameter_static_enabled_e].result == f_console_result_found_e) { - if (main->parameters[fake_parameter_static_enabled_e].location > main->parameters[fake_parameter_static_disabled_e].location) { + if (main->parameters.array[fake_parameter_static_disabled_e].result == f_console_result_found_e) { + if (main->parameters.array[fake_parameter_static_enabled_e].result == f_console_result_found_e) { + if (main->parameters.array[fake_parameter_static_enabled_e].location > main->parameters.array[fake_parameter_static_disabled_e].location) { setting->build_static = F_true; setting->search_static = F_true; } @@ -1298,7 +1298,7 @@ extern "C" { setting->search_static = F_false; } } - else if (main->parameters[fake_parameter_static_enabled_e].result == f_console_result_found_e) { + else if (main->parameters.array[fake_parameter_static_enabled_e].result == f_console_result_found_e) { setting->build_static = F_true; setting->search_static = F_true; } diff --git a/level_3/fake/c/private-build-load.h b/level_3/fake/c/private-build-load.h index 35bfcf9..21b4a37 100644 --- a/level_3/fake/c/private-build-load.h +++ b/level_3/fake/c/private-build-load.h @@ -87,7 +87,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_load_setting_process_ - extern void fake_build_load_setting_process(fake_main_t * const main, const bool checks, const f_string_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t *setting, f_status_t *status) F_attribute_visibility_internal_d; + extern void fake_build_load_setting_process(fake_main_t * const main, const bool checks, const f_string_static_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t *setting, f_status_t *status) F_attribute_visibility_internal_d; #endif // _di_fake_build_load_setting_process_ /** diff --git a/level_3/fake/c/private-build-objects.c b/level_3/fake/c/private-build-objects.c index 8921cea..4b5938d 100644 --- a/level_3/fake/c/private-build-objects.c +++ b/level_3/fake/c/private-build-objects.c @@ -37,7 +37,7 @@ extern "C" { path_sources = &main->path_sources_cpp; } } - else if (main->parameters[fake_parameter_path_sources_e].result != f_console_result_additional_e) { + else if (main->parameters.array[fake_parameter_path_sources_e].result != f_console_result_additional_e) { path_sources = &data_build.setting.path_sources; } @@ -136,7 +136,7 @@ extern "C" { funlockfile(main->error.to.stream); } else { - fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_create", F_true, destination_path.string, "create", fll_error_file_type_directory_e); + fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_create", F_true, destination_path, f_file_operation_create_s, fll_error_file_type_directory_e); } break; @@ -147,15 +147,15 @@ extern "C" { } } else if (F_status_is_error(*status)) { - fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_exists", F_true, destination_path.string, "create", fll_error_file_type_directory_e); + fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_exists", F_true, destination_path, f_file_operation_create_s, fll_error_file_type_directory_e); break; } - destination_length = destination_path.used + file_name.used + fake_build_parameter_object_name_suffix_s_length; + destination_length = destination_path.used + file_name.used + fake_build_parameter_object_name_suffix_s.used; } else { - destination_length = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s_length; + destination_length = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used; } char destination[destination_length + 1]; @@ -163,37 +163,29 @@ extern "C" { if (destination_path.used) { memcpy(destination, destination_path.string, destination_path.used); memcpy(destination + destination_path.used, file_name.string, file_name.used); - memcpy(destination + destination_path.used + file_name.used, fake_build_parameter_object_name_suffix_s, fake_build_parameter_object_name_suffix_s_length); + memcpy(destination + destination_path.used + file_name.used, fake_build_parameter_object_name_suffix_s, fake_build_parameter_object_name_suffix_s.used); } else { memcpy(destination, main->path_build_objects.string, main->path_build_objects.used); memcpy(destination + main->path_build_objects.used, file_name.string, file_name.used); - memcpy(destination + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s, fake_build_parameter_object_name_suffix_s_length); + memcpy(destination + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s, fake_build_parameter_object_name_suffix_s.used); } destination[destination_length] = 0; - const f_string_t values[] = { - source, + const f_string_static_t values[] = { + macro_f_string_static_t_initialize(source, 0, source_length), fake_build_parameter_object_compile_s, fake_build_parameter_object_static_s, fake_build_parameter_object_output_s, - destination, - }; - - const f_array_length_t lengths[] = { - source_length, - fake_build_parameter_object_compile_s_length, - fake_build_parameter_object_static_s_length, - fake_build_parameter_object_output_s_length, - destination_length, + macro_f_string_static_t_initialize(destination, 0, destination_length), }; for (uint8_t k = 0; k < 5; ++k) { if (!lengths[k]) continue; - *status = fll_execute_arguments_add(values[k], lengths[k], &arguments); + *status = fll_execute_arguments_add(values[k], &arguments); if (F_status_is_error(*status)) break; } // for diff --git a/level_3/fake/c/private-build-program.c b/level_3/fake/c/private-build-program.c index b5e690f..3b2dfd8 100644 --- a/level_3/fake/c/private-build-program.c +++ b/level_3/fake/c/private-build-program.c @@ -43,11 +43,11 @@ extern "C" { path_sources = &main->path_sources_cpp; } } - else if (main->parameters[fake_parameter_path_sources_e].result != f_console_result_additional_e) { + else if (main->parameters.array[fake_parameter_path_sources_e].result != f_console_result_additional_e) { path_sources = &data_build.setting.path_sources; } - f_array_length_t source_length = 0; + f_string_static_t source = f_string_static_t_initialize; const f_string_dynamics_t *sources[2] = { &data_build.setting.build_sources_program, @@ -61,15 +61,16 @@ extern "C" { for (j = 0; j < sources[i]->used; ++j) { - source_length = path_sources->used + sources[i]->array[j].used; + source.used = path_sources->used + sources[i]->array[j].used; - char source[source_length + 1]; + char source_string[source.used + 1]; + source.string = source_string; - memcpy(source, path_sources->string, path_sources->used); - memcpy(source + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used); - source[source_length] = 0; + memcpy(source_string, path_sources->string, path_sources->used); + memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used); + source_string[source.used] = 0; - *status = fll_execute_arguments_add(source, source_length, &arguments); + *status = fll_execute_arguments_add(source, &arguments); if (F_status_is_error(*status)) break; } // for @@ -86,36 +87,33 @@ extern "C" { memcpy(parameter_file_name_path + main->path_build_programs_shared.used, data_build.setting.project_name.string, data_build.setting.project_name.used); parameter_file_name_path[parameter_file_name_path_length] = 0; - const f_string_t values[] = { + const f_string_static_t values[] = { fake_build_parameter_library_output_s, - parameter_file_name_path, - }; - - const f_array_length_t lengths[] = { - fake_build_parameter_library_output_s_length, - parameter_file_name_path_length, + macro_f_string_static_t_initialize(parameter_file_name_path, 0, parameter_file_name_path_length), }; for (uint8_t i = 0; i < 2; ++i) { - if (!lengths[i]) continue; + if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], lengths[i], &arguments); + *status = fll_execute_arguments_add(values[i], &arguments); if (F_status_is_error(*status)) break; } // for } // if project-specific library sources exist, then the -lproject_name needs to be added to the arguments. if (F_status_is_error_not(*status) && data_build.setting.build_sources_library.used) { - f_array_length_t link_project_library_length = fake_build_parameter_library_link_file_s_length + data_build.setting.project_name.used; + f_string_static_t link_project_library = f_string_static_t_initialize; + link_project_library.used = fake_build_parameter_library_link_file_s_length + data_build.setting.project_name.used; - char link_project_library[link_project_library_length + 1]; + char link_project_library_string[link_project_library.used + 1]; + link_project_library.string = link_project_library_string; - memcpy(link_project_library, fake_build_parameter_library_link_file_s, fake_build_parameter_library_link_file_s_length); - memcpy(link_project_library + fake_build_parameter_library_link_file_s_length, data_build.setting.project_name.string, data_build.setting.project_name.used); - link_project_library[link_project_library_length] = 0; + memcpy(link_project_library, fake_build_parameter_library_link_file_s.string, fake_build_parameter_library_link_file_s.used); + memcpy(link_project_library + fake_build_parameter_library_link_file_s.string, data_build.setting.project_name.string, data_build.setting.project_name.used); + link_project_library_string[link_project_library.used] = 0; - *status = fll_execute_arguments_add(link_project_library, link_project_library_length, &arguments); + *status = fll_execute_arguments_add(link_project_library, &arguments); } fake_build_arguments_standard_add(main, data_build, F_true, F_false, &arguments, status); @@ -161,11 +159,11 @@ extern "C" { path_sources = &main->path_sources_cpp; } } - else if (main->parameters[fake_parameter_path_sources_e].result != f_console_result_additional_e) { + else if (main->parameters.array[fake_parameter_path_sources_e].result != f_console_result_additional_e) { path_sources = &data_build.setting.path_sources; } - f_array_length_t source_length = 0; + f_string_static_t source = f_string_static_t_initialize; const f_string_dynamics_t *sources[2] = { &data_build.setting.build_sources_program, @@ -181,15 +179,16 @@ extern "C" { if (!sources[i]->array[j].used) continue; - source_length = path_sources->used + sources[i]->array[j].used; + source.used = path_sources->used + sources[i]->array[j].used; - char source[source_length + 1]; + char source_string[source.used + 1]; + source.string = source_string; - memcpy(source, path_sources->string, path_sources->used); - memcpy(source + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used); - source[source_length] = 0; + memcpy(source_string, path_sources->string, path_sources->used); + memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used); + source_string[source.used] = 0; - *status = fll_execute_arguments_add(source, source_length, &arguments); + *status = fll_execute_arguments_add(source, &arguments); if (F_status_is_error(*status)) break; } // for @@ -209,17 +208,17 @@ extern "C" { memcpy(source_library, main->path_build_libraries_static.string, main->path_build_libraries_static.used); source_library_length += main->path_build_libraries_static.used; - memcpy(source_library + source_library_length, fake_build_parameter_library_name_prefix_s, fake_build_parameter_library_name_prefix_s_length); - source_library_length += fake_build_parameter_library_name_prefix_s_length; + memcpy(source_library + source_library_length, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used); + source_library_length += fake_build_parameter_library_name_prefix_s.used; memcpy(source_library + source_library_length, data_build.setting.project_name.string, data_build.setting.project_name.used); source_library_length += data_build.setting.project_name.used; - memcpy(source_library + source_library_length, fake_build_parameter_library_name_suffix_static_s, fake_build_parameter_library_name_suffix_static_s_length); - source_library_length += fake_build_parameter_library_name_suffix_static_s_length; + memcpy(source_library + source_library_length, fake_build_parameter_library_name_suffix_static_s.string, fake_build_parameter_library_name_suffix_static_s.used); + source_library_length += fake_build_parameter_library_name_suffix_static_s.used; } - source_library[source_library_length] = 0; + source_library.string[source_library_length] = 0; f_array_length_t parameter_file_name_path_length = main->path_build_programs_static.used + data_build.setting.project_name.used; @@ -229,25 +228,18 @@ extern "C" { memcpy(parameter_file_name_path + main->path_build_programs_static.used, data_build.setting.project_name.string, data_build.setting.project_name.used); parameter_file_name_path[parameter_file_name_path_length] = 0; - const f_string_t values[] = { - source_library, + const f_string_static_t values[] = { + macro_f_string_static_t_initialize(source_library, 0, source_library_length), fake_build_parameter_library_static_s, fake_build_parameter_library_output_s, - parameter_file_name_path, - }; - - const f_array_length_t lengths[] = { - source_library_length, - fake_build_parameter_library_static_s_length, - fake_build_parameter_library_output_s_length, - parameter_file_name_path_length, + macro_f_string_static_t_initialize(parameter_file_name_path, 0, parameter_file_name_path_length), }; for (uint8_t i = 0; i < 4; ++i) { - if (!lengths[i]) continue; + if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], lengths[i], &arguments); + *status = fll_execute_arguments_add(values[i], &arguments); if (F_status_is_error(*status)) break; } // for } diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index 66661a8..49058ec 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -19,81 +19,81 @@ extern "C" { if (F_status_is_error(*status)) return; - f_array_length_t build_libraries_length = fake_build_parameter_library_link_path_s_length + main->path_build_libraries_shared.used; + f_array_length_t build_libraries_length = fake_build_parameter_library_link_path_s.used + main->path_build_libraries_shared.used; char build_libraries[build_libraries_length + 1]; - memcpy(build_libraries, fake_build_parameter_library_link_path_s, fake_build_parameter_library_link_path_s_length); + memcpy(build_libraries, fake_build_parameter_library_link_path_s.string, fake_build_parameter_library_link_path_s.used); if (is_shared) { - memcpy(build_libraries + fake_build_parameter_library_link_path_s_length, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used); + memcpy(build_libraries + fake_build_parameter_library_link_path_s.used, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used); } else { - memcpy(build_libraries + fake_build_parameter_library_link_path_s_length, main->path_build_libraries_static.string, main->path_build_libraries_static.used); + memcpy(build_libraries + fake_build_parameter_library_link_path_s.used, main->path_build_libraries_static.string, main->path_build_libraries_static.used); } build_libraries[build_libraries_length] = 0; - f_array_length_t build_includes_length = fake_build_parameter_library_include_s_length + main->path_build_includes.used; + f_array_length_t build_includes_length = fake_build_parameter_library_include_s.used + main->path_build_includes.used; char build_includes[build_includes_length + 1]; - memcpy(build_includes, fake_build_parameter_library_include_s, fake_build_parameter_library_include_s_length); - memcpy(build_includes + fake_build_parameter_library_include_s_length, main->path_build_includes.string, main->path_build_includes.used); + memcpy(build_includes, fake_build_parameter_library_include_s.string, fake_build_parameter_library_include_s.used); + memcpy(build_includes + fake_build_parameter_library_include_s.used, main->path_build_includes.string, main->path_build_includes.used); const f_string_static_t values[] = { - macro_f_string_static_t_initialize2(build_libraries, 0, build_includes_length), - macro_f_string_static_t_initialize2(build_includes, 0, build_includes_length), + macro_f_string_static_t_initialize(build_libraries, 0, build_libraries_length), + macro_f_string_static_t_initialize(build_includes, 0, build_includes_length), }; for (uint8_t i = 0; i < 2; ++i) { - if (!lengths[i]) continue; + if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i].string, values[i].used, arguments); + *status = fll_execute_arguments_add(values[i], arguments); if (F_status_is_error(*status)) break; } // for if (main->path_work.used) { - f_array_length_t length = 0; + f_string_static_t buffer = f_string_static_t_initialize; if (F_status_is_error_not(*status)) { - length = fake_build_parameter_library_include_s_length + main->path_work_includes.used; + buffer.used = fake_build_parameter_library_include_s.used + main->path_work_includes.used; - char string[length + 1]; + char buffer_string[buffer.used + 1]; - memcpy(string, fake_build_parameter_library_include_s, fake_build_parameter_library_include_s_length); - memcpy(string + fake_build_parameter_library_include_s_length, main->path_work_includes.string, main->path_work_includes.used); + memcpy(buffer_string, fake_build_parameter_library_include_s.string, fake_build_parameter_library_include_s.used); + memcpy(buffer_string + fake_build_parameter_library_include_s.used, main->path_work_includes.string, main->path_work_includes.used); - string[length] = 0; + buffer_string[buffer.used] = 0; - *status = fll_execute_arguments_add(string, length, arguments); + *status = fll_execute_arguments_add(buffer, arguments); } if (data_build.setting.search_shared && (is_shared || !data_build.setting.search_exclusive) && F_status_is_error_not(*status)) { - length = fake_build_parameter_library_link_path_s_length + main->path_work_libraries_shared.used; + buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_shared.used; - char string[length + 1]; + char buffer_string[buffer.used + 1]; - memcpy(string, fake_build_parameter_library_link_path_s, fake_build_parameter_library_link_path_s_length); - memcpy(string + fake_build_parameter_library_link_path_s_length, main->path_work_libraries_shared.string, main->path_work_libraries_shared.used); + memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, fake_build_parameter_library_link_path_s.used); + memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, main->path_work_libraries_shared.string, main->path_work_libraries_shared.used); - string[length] = 0; + buffer_string[buffer.used] = 0; - *status = fll_execute_arguments_add(string, length, arguments); + *status = fll_execute_arguments_add(buffer, arguments); } if (data_build.setting.search_static && (!is_shared || !data_build.setting.search_exclusive) && F_status_is_error_not(*status)) { - length = fake_build_parameter_library_link_path_s_length + main->path_work_libraries_static.used; + buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_static.used; - char string[length + 1]; + char buffer_string[buffer.used + 1]; - memcpy(string, fake_build_parameter_library_link_path_s, fake_build_parameter_library_link_path_s_length); - memcpy(string + fake_build_parameter_library_link_path_s_length, main->path_work_libraries_static.string, main->path_work_libraries_static.used); + memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, fake_build_parameter_library_link_path_s.used); + memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, main->path_work_libraries_static.string, main->path_work_libraries_static.used); - string[length] = 0; + buffer_string[buffer.used] = 0; - *status = fll_execute_arguments_add(string, length, arguments); + *status = fll_execute_arguments_add(buffer, arguments); } } @@ -103,7 +103,7 @@ extern "C" { if (!data_build.setting.build_libraries.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.build_libraries.array[i].string, data_build.setting.build_libraries.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.build_libraries.array[i], arguments); } // for if (is_shared) { @@ -111,7 +111,7 @@ extern "C" { if (!data_build.setting.build_libraries_shared.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.build_libraries_shared.array[i].string, data_build.setting.build_libraries_shared.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.build_libraries_shared.array[i], arguments); } // for } else { @@ -119,7 +119,7 @@ extern "C" { if (!data_build.setting.build_libraries_static.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.build_libraries_static.array[i].string, data_build.setting.build_libraries_static.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.build_libraries_static.array[i], arguments); } // for } @@ -127,7 +127,7 @@ extern "C" { if (!data_build.setting.flags.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags.array[i].string, data_build.setting.flags.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags.array[i], arguments); } // for if (is_shared) { @@ -135,7 +135,7 @@ extern "C" { if (!data_build.setting.flags_shared.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags_shared.array[i].string, data_build.setting.flags_shared.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_shared.array[i], arguments); } // for } else { @@ -143,7 +143,7 @@ extern "C" { if (!data_build.setting.flags_static.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags_static.array[i].string, data_build.setting.flags_static.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_static.array[i], arguments); } // for } @@ -152,7 +152,7 @@ extern "C" { if (!data_build.setting.flags_library.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags_library.array[i].string, data_build.setting.flags_library.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_library.array[i], arguments); } // for if (is_shared) { @@ -160,7 +160,7 @@ extern "C" { if (!data_build.setting.flags_library_shared.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags_library_shared.array[i].string, data_build.setting.flags_library_shared.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_library_shared.array[i], arguments); } // for } else { @@ -168,7 +168,7 @@ extern "C" { if (!data_build.setting.flags_library_static.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags_library_static.array[i].string, data_build.setting.flags_library_static.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_library_static.array[i], arguments); } // for } } @@ -177,7 +177,7 @@ extern "C" { if (!data_build.setting.flags_program.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags_program.array[i].string, data_build.setting.flags_program.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_program.array[i], arguments); } // for if (is_shared) { @@ -185,7 +185,7 @@ extern "C" { if (!data_build.setting.flags_program_shared.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags_program_shared.array[i].string, data_build.setting.flags_program_shared.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_program_shared.array[i], arguments); } // for } else { @@ -193,7 +193,7 @@ extern "C" { if (!data_build.setting.flags_program_static.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.flags_program_static.array[i].string, data_build.setting.flags_program_static.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_program_static.array[i], arguments); } // for } } @@ -202,7 +202,7 @@ extern "C" { if (!data_build.setting.defines.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines.array[i].string, data_build.setting.defines.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines.array[i], arguments); } // for if (is_shared) { @@ -210,7 +210,7 @@ extern "C" { if (!data_build.setting.defines_shared.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines_shared.array[i].string, data_build.setting.defines_shared.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_shared.array[i], arguments); } // for } else { @@ -218,7 +218,7 @@ extern "C" { if (!data_build.setting.defines_static.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines_static.array[i].string, data_build.setting.defines_static.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_static.array[i], arguments); } // for } @@ -227,7 +227,7 @@ extern "C" { if (!data_build.setting.defines_library.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines_library.array[i].string, data_build.setting.defines_library.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_library.array[i], arguments); } // for if (is_shared) { @@ -235,7 +235,7 @@ extern "C" { if (!data_build.setting.defines_library_shared.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines_library_shared.array[i].string, data_build.setting.defines_library_shared.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_library_shared.array[i], arguments); } // for } else { @@ -243,7 +243,7 @@ extern "C" { if (!data_build.setting.defines_library_static.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines_library_static.array[i].string, data_build.setting.defines_library_static.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_library_static.array[i], arguments); } // for } } @@ -252,7 +252,7 @@ extern "C" { if (!data_build.setting.defines_program.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines_program.array[i].string, data_build.setting.defines_program.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_program.array[i], arguments); } // for if (is_shared) { @@ -260,7 +260,7 @@ extern "C" { if (!data_build.setting.defines_program_shared.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines_program_shared.array[i].string, data_build.setting.defines_program_shared.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_program_shared.array[i], arguments); } // for } else { @@ -268,7 +268,7 @@ extern "C" { if (!data_build.setting.defines_program_static.array[i].used) continue; - *status = fll_execute_arguments_add(data_build.setting.defines_program_static.array[i].string, data_build.setting.defines_program_static.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_program_static.array[i], arguments); } // for } } @@ -277,7 +277,7 @@ extern "C" { if (!main->define.array[i].used) continue; - *status = fll_execute_arguments_add(main->define.array[i].string, main->define.array[i].used, arguments); + *status = fll_execute_arguments_add(main->define.array[i], arguments); } // for } #endif // _di_fake_build_arguments_standard_add_ @@ -383,7 +383,7 @@ extern "C" { if (F_status_is_error(*status)) { if (main->error.verbosity == f_console_verbosity_verbose_e) { for (f_array_length_t j = 0; j < failures.used; ++j) { - fake_print_error_build_operation_file(main, F_status_set_fine(*status), "fl_directory_copy", "copy directory", "to", path_source.string, destination_directory.string, F_true); + fake_print_error_build_operation_file(main, F_status_set_fine(*status), "fl_directory_copy", fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); } // for if (F_status_set_fine(*status) != F_failure) { @@ -393,7 +393,7 @@ extern "C" { break; } else if (main->error.verbosity != f_console_verbosity_quiet_e) { - fake_print_error_build_operation_file(main, F_status_set_fine(*status), "fl_directory_copy", "copy directory", "to", path_source.string, destination_directory.string, F_true); + fake_print_error_build_operation_file(main, F_status_set_fine(*status), "fl_directory_copy", fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); } break; @@ -465,7 +465,7 @@ extern "C" { *status = f_file_copy(path_source.string, destination_file.string, mode, F_file_default_read_size_d, F_false); if (F_status_is_error(*status)) { - fake_print_error_build_operation_file(main, F_status_set_fine(*status), "f_file_copy", "copy", "to", path_source.string, destination_file.string, F_true); + fake_print_error_build_operation_file(main, F_status_set_fine(*status), "f_file_copy", F_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true); break; } @@ -474,7 +474,7 @@ extern "C" { } } else if (F_status_is_error(*status)) { - fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_is", F_true, path_source.string, "create", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_is", F_true, path_source, f_file_operation_create_s, fll_error_file_type_file_e); break; } @@ -501,40 +501,52 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - *status = fll_execute_arguments_add(fake_other_operation_build_s, fake_other_operation_build_s_length, &arguments); + *status = fll_execute_arguments_add(fake_other_operation_build_s, &arguments); // Ensure console color mode is passed to the scripts so that they can also react to color mode. if (F_status_is_error_not(*status) && main->context.mode != F_color_mode_none_d) { - char argument[3] = { f_console_symbol_short_disable_s.string[0], 0, 0 }; + f_string_static_t argument = f_string_static_t_initialize; + argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_dark_s.used; + + char argument_string[argument.used + 1]; + argument_string[argument.used] = 0; + + memcpy(argument_string, f_console_symbol_short_disable_s.string, f_console_symbol_short_disable_s.used); if (main->context.mode == F_color_mode_dark_d) { - argument[1] = f_console_standard_short_dark_s.string[0]; + memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_dark_s.string, f_console_standard_short_dark_s.used); } else if (main->context.mode == F_color_mode_light_d) { - argument[1] = f_console_standard_short_light_s.string[0]; + memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_light_s.string, f_console_standard_short_light_s.used); } else if (main->context.mode == F_color_mode_no_color_d) { - argument[1] = f_console_standard_short_no_color_s.string[0]; + memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_no_color_s.string, f_console_standard_short_no_color_s.used); } - *status = fll_execute_arguments_add(argument, 2, &arguments); + *status = fll_execute_arguments_add(argument, &arguments); } // Ensure verbosity level is passed to the scripts so that they can also react to requested verbosity. if (F_status_is_error_not(*status) && main->error.verbosity != f_console_verbosity_normal_e) { - char argument[3] = { f_console_symbol_short_disable_s.string[0], 0, 0 }; + f_string_static_t argument = f_string_static_t_initialize; + argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_quiet_s.used; + + char argument_string[argument.used + 1]; + argument_string[argument.used] = 0; + + memcpy(argument_string, f_console_symbol_short_disable_s.string, f_console_symbol_short_disable_s.used); - if (main->error.verbosity == f_console_verbosity_quiet_e) { - argument[1] = f_console_standard_short_quiet_s.string[0]; + if (main->context.mode == f_console_verbosity_quiet_e) { + memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_quiet_s.string, f_console_standard_short_quiet_s.used); } - else if (main->error.verbosity == f_console_verbosity_verbose_e) { - argument[1] = f_console_standard_short_verbose_s.string[0]; + else if (main->context.mode == f_console_verbosity_verbose_e) { + memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_verbose_s.string, f_console_standard_short_verbose_s.used); } - else if (main->error.verbosity == f_console_verbosity_debug_e) { - argument[1] = f_console_standard_short_debug_s.string[0]; + else if (main->context.mode == f_console_verbosity_debug_e) { + memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_debug_s.string, f_console_standard_short_debug_s.used); } - *status = fll_execute_arguments_add(argument, 2, &arguments); + *status = fll_execute_arguments_add(argument, &arguments); } if (F_status_is_error(*status)) { @@ -552,10 +564,7 @@ extern "C" { for (f_array_length_t i = 0; i < main->define.used; ++i) { *status = f_string_dynamic_mash(f_string_space_s, main->define.array[i], &defines); - - if (F_status_is_error(*status)) { - break; - } + if (F_status_is_error(*status)) break; } // for if (F_status_is_error(*status)) { @@ -579,7 +588,7 @@ extern "C" { } } - const f_string_t parameters_prefix[] = { + const f_string_static_t parameters_prefix[] = { f_console_symbol_short_enable_s, f_console_symbol_short_enable_s, f_console_symbol_short_enable_s, @@ -589,17 +598,7 @@ extern "C" { f_console_symbol_short_enable_s, }; - const f_array_length_t parameters_prefix_length[] = { - f_console_symbol_short_enable_s.used, - f_console_symbol_short_enable_s.used, - f_console_symbol_short_enable_s.used, - f_console_symbol_short_enable_s.used, - f_console_symbol_short_enable_s.used, - f_console_symbol_short_enable_s.used, - f_console_symbol_short_enable_s.used, - }; - - const f_string_t parameters_name[] = { + const f_string_static_t parameters_name[] = { fake_short_define_s, fake_short_process_s, fake_short_settings_s, @@ -609,37 +608,17 @@ extern "C" { fake_short_path_work_s, }; - const f_array_length_t parameters_name_length[] = { - fake_short_define_s_length, - fake_short_process_s_length, - fake_short_settings_s_length, - fake_short_path_build_s_length, - fake_short_path_data_s_length, - fake_short_path_sources_s_length, - fake_short_path_work_s_length, - }; - - const f_string_t parameters_value[] = { - defines.string, - main->process.string, - main->settings.string, - main->path_build.string, - main->path_data.string, - main->path_sources.string, - main->path_work.string, - }; - - const f_array_length_t parameters_value_length[] = { - defines.used, - main->process.used, - main->settings.used, - main->path_build.used, - main->path_data.used, - main->path_sources.used, - main->path_work.used, + const f_string_static_t parameters_value[] = { + defines, + main->process, + main->settings, + main->path_build, + main->path_data, + main->path_sources, + main->path_work, }; - *status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_prefix_length, parameters_name, parameters_name_length, parameters_value, parameters_value_length, 7, &arguments); + *status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_name, parameters_value, 7, &arguments); f_string_dynamic_resize(0, &defines); @@ -690,7 +669,7 @@ extern "C" { fl_execute_parameter_t parameter = macro_fl_execute_parameter_t_initialize(FL_execute_parameter_option_path_d, 0, &data_build.environment, &signals, 0); - *status = fll_execute_program(path.string, arguments, ¶meter, 0, (void *) &return_code); + *status = fll_execute_program(path, arguments, ¶meter, 0, (void *) &return_code); f_string_dynamics_resize(0, &arguments); @@ -821,7 +800,7 @@ extern "C" { path_sources = main->path_sources_cpp; } } - else if (main->parameters[fake_parameter_path_sources_e].result != f_console_result_additional_e) { + else if (main->parameters.array[fake_parameter_path_sources_e].result != f_console_result_additional_e) { path_sources = data_build.setting.path_sources; } diff --git a/level_3/fake/c/private-common.c b/level_3/fake/c/private-common.c index e8edacf..5804b40 100644 --- a/level_3/fake/c/private-common.c +++ b/level_3/fake/c/private-common.c @@ -7,277 +7,284 @@ extern "C" { #endif #ifndef _di_fake_build_setting_t_ - const f_string_static_t fake_build_setting_name_build_compiler_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_compiler_s, 0, FAKE_build_setting_name_build_compiler_s_length); - const f_string_static_t fake_build_setting_name_build_language_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_language_s, 0, FAKE_build_setting_name_build_language_s_length); - const f_string_static_t fake_build_setting_name_build_libraries_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_libraries_s, 0, FAKE_build_setting_name_build_libraries_s_length); - const f_string_static_t fake_build_setting_name_build_libraries_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_libraries_shared_s, 0, FAKE_build_setting_name_build_libraries_shared_s_length); - const f_string_static_t fake_build_setting_name_build_libraries_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_libraries_static_s, 0, FAKE_build_setting_name_build_libraries_static_s_length); - const f_string_static_t fake_build_setting_name_build_indexer_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_indexer_s, 0, FAKE_build_setting_name_build_indexer_s_length); - const f_string_static_t fake_build_setting_name_build_indexer_arguments_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_indexer_arguments_s, 0, FAKE_build_setting_name_build_indexer_arguments_s_length); - const f_string_static_t fake_build_setting_name_build_script_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_script_s, 0, FAKE_build_setting_name_build_script_s_length); - const f_string_static_t fake_build_setting_name_build_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_shared_s, 0, FAKE_build_setting_name_build_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_headers_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_headers_s, 0, FAKE_build_setting_name_build_sources_headers_s_length); - const f_string_static_t fake_build_setting_name_build_sources_headers_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_headers_shared_s, 0, FAKE_build_setting_name_build_sources_headers_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_headers_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_headers_static_s, 0, FAKE_build_setting_name_build_sources_headers_static_s_length); - const f_string_static_t fake_build_setting_name_build_sources_library_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_library_s, 0, FAKE_build_setting_name_build_sources_library_s_length); - const f_string_static_t fake_build_setting_name_build_sources_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_library_shared_s, 0, FAKE_build_setting_name_build_sources_library_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_library_static_s, 0, FAKE_build_setting_name_build_sources_library_static_s_length); - const f_string_static_t fake_build_setting_name_build_sources_program_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_program_s, 0, FAKE_build_setting_name_build_sources_program_s_length); - const f_string_static_t fake_build_setting_name_build_sources_program_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_program_shared_s, 0, FAKE_build_setting_name_build_sources_program_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_program_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_program_static_s, 0, FAKE_build_setting_name_build_sources_program_static_s_length); - const f_string_static_t fake_build_setting_name_build_sources_script_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_script_s, 0, FAKE_build_setting_name_build_sources_script_s_length); - const f_string_static_t fake_build_setting_name_build_sources_settings_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_settings_s, 0, FAKE_build_setting_name_build_sources_settings_s_length); - const f_string_static_t fake_build_setting_name_build_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_static_s, 0, FAKE_build_setting_name_build_static_s_length); - const f_string_static_t fake_build_setting_name_defines_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_s, 0, FAKE_build_setting_name_defines_s_length); - const f_string_static_t fake_build_setting_name_defines_library_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_library_s, 0, FAKE_build_setting_name_defines_library_s_length); - const f_string_static_t fake_build_setting_name_defines_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_library_shared_s, 0, FAKE_build_setting_name_defines_library_shared_s_length); - const f_string_static_t fake_build_setting_name_defines_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_library_static_s, 0, FAKE_build_setting_name_defines_library_static_s_length); - const f_string_static_t fake_build_setting_name_defines_program_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_program_s, 0, FAKE_build_setting_name_defines_program_s_length); - const f_string_static_t fake_build_setting_name_defines_program_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_program_shared_s, 0, FAKE_build_setting_name_defines_program_shared_s_length); - const f_string_static_t fake_build_setting_name_defines_program_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_program_static_s, 0, FAKE_build_setting_name_defines_program_static_s_length); - const f_string_static_t fake_build_setting_name_defines_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_shared_s, 0, FAKE_build_setting_name_defines_shared_s_length); - const f_string_static_t fake_build_setting_name_defines_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_static_s, 0, FAKE_build_setting_name_defines_static_s_length); - const f_string_static_t fake_build_setting_name_environment_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_environment_s, 0, FAKE_build_setting_name_environment_s_length); - const f_string_static_t fake_build_setting_name_flags_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_s, 0, FAKE_build_setting_name_flags_s_length); - const f_string_static_t fake_build_setting_name_flags_library_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_library_s, 0, FAKE_build_setting_name_flags_library_s_length); - const f_string_static_t fake_build_setting_name_flags_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_library_shared_s, 0, FAKE_build_setting_name_flags_library_shared_s_length); - const f_string_static_t fake_build_setting_name_flags_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_library_static_s, 0, FAKE_build_setting_name_flags_library_static_s_length); - const f_string_static_t fake_build_setting_name_flags_program_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_program_s, 0, FAKE_build_setting_name_flags_program_s_length); - const f_string_static_t fake_build_setting_name_flags_program_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_program_shared_s, 0, FAKE_build_setting_name_flags_program_shared_s_length); - const f_string_static_t fake_build_setting_name_flags_program_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_program_static_s, 0, FAKE_build_setting_name_flags_program_static_s_length); - const f_string_static_t fake_build_setting_name_flags_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_shared_s, 0, FAKE_build_setting_name_flags_shared_s_length); - const f_string_static_t fake_build_setting_name_flags_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_static_s, 0, FAKE_build_setting_name_flags_static_s_length); - const f_string_static_t fake_build_setting_name_modes_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_modes_s, 0, FAKE_build_setting_name_modes_s_length); - const f_string_static_t fake_build_setting_name_modes_default_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_modes_default_s, 0, FAKE_build_setting_name_modes_default_s_length); - const f_string_static_t fake_build_setting_name_path_headers_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_headers_s, 0, FAKE_build_setting_name_path_headers_s_length); - const f_string_static_t fake_build_setting_name_path_headers_preserve_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_headers_preserve_s, 0, FAKE_build_setting_name_path_headers_preserve_s_length); - const f_string_static_t fake_build_setting_name_path_language_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_language_s, 0, FAKE_build_setting_name_path_language_s_length); - const f_string_static_t fake_build_setting_name_path_library_script_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_library_script_s, 0, FAKE_build_setting_name_path_library_script_s_length); - const f_string_static_t fake_build_setting_name_path_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_library_shared_s, 0, FAKE_build_setting_name_path_library_shared_s_length); - const f_string_static_t fake_build_setting_name_path_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_library_static_s, 0, FAKE_build_setting_name_path_library_static_s_length); - const f_string_static_t fake_build_setting_name_path_program_script_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_program_script_s, 0, FAKE_build_setting_name_path_program_script_s_length); - const f_string_static_t fake_build_setting_name_path_program_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_program_shared_s, 0, FAKE_build_setting_name_path_program_shared_s_length); - const f_string_static_t fake_build_setting_name_path_program_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_program_static_s, 0, FAKE_build_setting_name_path_program_static_s_length); - const f_string_static_t fake_build_setting_name_path_sources_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_sources_s, 0, FAKE_build_setting_name_path_sources_s_length); - const f_string_static_t fake_build_setting_name_path_standard_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_standard_s, 0, FAKE_build_setting_name_path_standard_s_length); - const f_string_static_t fake_build_setting_name_process_post_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_process_post_s, 0, FAKE_build_setting_name_process_post_s_length); - const f_string_static_t fake_build_setting_name_process_pre_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_process_pre_s, 0, FAKE_build_setting_name_process_pre_s_length); - const f_string_static_t fake_build_setting_name_project_name_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_project_name_s, 0, FAKE_build_setting_name_project_name_s_length); - const f_string_static_t fake_build_setting_name_search_exclusive_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_search_exclusive_s, 0, FAKE_build_setting_name_search_exclusive_s_length); - const f_string_static_t fake_build_setting_name_search_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_search_shared_s, 0, FAKE_build_setting_name_search_shared_s_length); - const f_string_static_t fake_build_setting_name_search_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_search_static_s, 0, FAKE_build_setting_name_search_static_s_length); - const f_string_static_t fake_build_setting_name_version_file_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_file_s, 0, FAKE_build_setting_name_version_file_s_length); - const f_string_static_t fake_build_setting_name_version_major_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_major_s, 0, FAKE_build_setting_name_version_major_s_length); - const f_string_static_t fake_build_setting_name_version_major_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_major_prefix_s, 0, FAKE_build_setting_name_version_major_prefix_s_length); - const f_string_static_t fake_build_setting_name_version_micro_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_micro_s, 0, FAKE_build_setting_name_version_micro_s_length); - const f_string_static_t fake_build_setting_name_version_micro_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_micro_prefix_s, 0, FAKE_build_setting_name_version_micro_prefix_s_length); - const f_string_static_t fake_build_setting_name_version_minor_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_minor_s, 0, FAKE_build_setting_name_version_minor_s_length); - const f_string_static_t fake_build_setting_name_version_minor_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_minor_prefix_s, 0, FAKE_build_setting_name_version_minor_prefix_s_length); - const f_string_static_t fake_build_setting_name_version_nano_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_nano_s, 0, FAKE_build_setting_name_version_nano_s_length); - const f_string_static_t fake_build_setting_name_version_nano_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_nano_prefix_s, 0, FAKE_build_setting_name_version_nano_prefix_s_length); - const f_string_static_t fake_build_setting_name_version_target_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_target_s, 0, FAKE_build_setting_name_version_target_s_length); + const f_string_static_t fake_build_setting_name_build_compiler_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_compiler_s, 0, FAKE_build_setting_name_build_compiler_s_length); + const f_string_static_t fake_build_setting_name_build_language_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_language_s, 0, FAKE_build_setting_name_build_language_s_length); + const f_string_static_t fake_build_setting_name_build_libraries_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_s, 0, FAKE_build_setting_name_build_libraries_s_length); + const f_string_static_t fake_build_setting_name_build_libraries_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_shared_s, 0, FAKE_build_setting_name_build_libraries_shared_s_length); + const f_string_static_t fake_build_setting_name_build_libraries_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_static_s, 0, FAKE_build_setting_name_build_libraries_static_s_length); + const f_string_static_t fake_build_setting_name_build_indexer_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_indexer_s, 0, FAKE_build_setting_name_build_indexer_s_length); + const f_string_static_t fake_build_setting_name_build_indexer_arguments_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_indexer_arguments_s, 0, FAKE_build_setting_name_build_indexer_arguments_s_length); + const f_string_static_t fake_build_setting_name_build_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_script_s, 0, FAKE_build_setting_name_build_script_s_length); + const f_string_static_t fake_build_setting_name_build_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_shared_s, 0, FAKE_build_setting_name_build_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_headers_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_s, 0, FAKE_build_setting_name_build_sources_headers_s_length); + const f_string_static_t fake_build_setting_name_build_sources_headers_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_shared_s, 0, FAKE_build_setting_name_build_sources_headers_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_headers_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_static_s, 0, FAKE_build_setting_name_build_sources_headers_static_s_length); + const f_string_static_t fake_build_setting_name_build_sources_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_s, 0, FAKE_build_setting_name_build_sources_library_s_length); + const f_string_static_t fake_build_setting_name_build_sources_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_shared_s, 0, FAKE_build_setting_name_build_sources_library_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_static_s, 0, FAKE_build_setting_name_build_sources_library_static_s_length); + const f_string_static_t fake_build_setting_name_build_sources_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_s, 0, FAKE_build_setting_name_build_sources_program_s_length); + const f_string_static_t fake_build_setting_name_build_sources_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_shared_s, 0, FAKE_build_setting_name_build_sources_program_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_static_s, 0, FAKE_build_setting_name_build_sources_program_static_s_length); + const f_string_static_t fake_build_setting_name_build_sources_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_script_s, 0, FAKE_build_setting_name_build_sources_script_s_length); + const f_string_static_t fake_build_setting_name_build_sources_settings_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_settings_s, 0, FAKE_build_setting_name_build_sources_settings_s_length); + const f_string_static_t fake_build_setting_name_build_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_static_s, 0, FAKE_build_setting_name_build_static_s_length); + const f_string_static_t fake_build_setting_name_defines_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_s, 0, FAKE_build_setting_name_defines_s_length); + const f_string_static_t fake_build_setting_name_defines_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_s, 0, FAKE_build_setting_name_defines_library_s_length); + const f_string_static_t fake_build_setting_name_defines_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_shared_s, 0, FAKE_build_setting_name_defines_library_shared_s_length); + const f_string_static_t fake_build_setting_name_defines_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_static_s, 0, FAKE_build_setting_name_defines_library_static_s_length); + const f_string_static_t fake_build_setting_name_defines_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_s, 0, FAKE_build_setting_name_defines_program_s_length); + const f_string_static_t fake_build_setting_name_defines_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_shared_s, 0, FAKE_build_setting_name_defines_program_shared_s_length); + const f_string_static_t fake_build_setting_name_defines_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_static_s, 0, FAKE_build_setting_name_defines_program_static_s_length); + const f_string_static_t fake_build_setting_name_defines_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_shared_s, 0, FAKE_build_setting_name_defines_shared_s_length); + const f_string_static_t fake_build_setting_name_defines_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_static_s, 0, FAKE_build_setting_name_defines_static_s_length); + const f_string_static_t fake_build_setting_name_environment_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_environment_s, 0, FAKE_build_setting_name_environment_s_length); + const f_string_static_t fake_build_setting_name_flags_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_s, 0, FAKE_build_setting_name_flags_s_length); + const f_string_static_t fake_build_setting_name_flags_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_s, 0, FAKE_build_setting_name_flags_library_s_length); + const f_string_static_t fake_build_setting_name_flags_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_shared_s, 0, FAKE_build_setting_name_flags_library_shared_s_length); + const f_string_static_t fake_build_setting_name_flags_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_static_s, 0, FAKE_build_setting_name_flags_library_static_s_length); + const f_string_static_t fake_build_setting_name_flags_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_s, 0, FAKE_build_setting_name_flags_program_s_length); + const f_string_static_t fake_build_setting_name_flags_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_shared_s, 0, FAKE_build_setting_name_flags_program_shared_s_length); + const f_string_static_t fake_build_setting_name_flags_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_static_s, 0, FAKE_build_setting_name_flags_program_static_s_length); + const f_string_static_t fake_build_setting_name_flags_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_shared_s, 0, FAKE_build_setting_name_flags_shared_s_length); + const f_string_static_t fake_build_setting_name_flags_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_static_s, 0, FAKE_build_setting_name_flags_static_s_length); + const f_string_static_t fake_build_setting_name_modes_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_modes_s, 0, FAKE_build_setting_name_modes_s_length); + const f_string_static_t fake_build_setting_name_modes_default_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_modes_default_s, 0, FAKE_build_setting_name_modes_default_s_length); + const f_string_static_t fake_build_setting_name_path_headers_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_headers_s, 0, FAKE_build_setting_name_path_headers_s_length); + const f_string_static_t fake_build_setting_name_path_headers_preserve_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_headers_preserve_s, 0, FAKE_build_setting_name_path_headers_preserve_s_length); + const f_string_static_t fake_build_setting_name_path_language_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_language_s, 0, FAKE_build_setting_name_path_language_s_length); + const f_string_static_t fake_build_setting_name_path_library_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_script_s, 0, FAKE_build_setting_name_path_library_script_s_length); + const f_string_static_t fake_build_setting_name_path_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_shared_s, 0, FAKE_build_setting_name_path_library_shared_s_length); + const f_string_static_t fake_build_setting_name_path_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_static_s, 0, FAKE_build_setting_name_path_library_static_s_length); + const f_string_static_t fake_build_setting_name_path_program_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_script_s, 0, FAKE_build_setting_name_path_program_script_s_length); + const f_string_static_t fake_build_setting_name_path_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_shared_s, 0, FAKE_build_setting_name_path_program_shared_s_length); + const f_string_static_t fake_build_setting_name_path_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_static_s, 0, FAKE_build_setting_name_path_program_static_s_length); + const f_string_static_t fake_build_setting_name_path_sources_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_sources_s, 0, FAKE_build_setting_name_path_sources_s_length); + const f_string_static_t fake_build_setting_name_path_standard_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_standard_s, 0, FAKE_build_setting_name_path_standard_s_length); + const f_string_static_t fake_build_setting_name_process_post_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_process_post_s, 0, FAKE_build_setting_name_process_post_s_length); + const f_string_static_t fake_build_setting_name_process_pre_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_process_pre_s, 0, FAKE_build_setting_name_process_pre_s_length); + const f_string_static_t fake_build_setting_name_project_name_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_project_name_s, 0, FAKE_build_setting_name_project_name_s_length); + const f_string_static_t fake_build_setting_name_search_exclusive_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_exclusive_s, 0, FAKE_build_setting_name_search_exclusive_s_length); + const f_string_static_t fake_build_setting_name_search_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_shared_s, 0, FAKE_build_setting_name_search_shared_s_length); + const f_string_static_t fake_build_setting_name_search_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_static_s, 0, FAKE_build_setting_name_search_static_s_length); + const f_string_static_t fake_build_setting_name_version_file_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_file_s, 0, FAKE_build_setting_name_version_file_s_length); + const f_string_static_t fake_build_setting_name_version_major_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_major_s, 0, FAKE_build_setting_name_version_major_s_length); + const f_string_static_t fake_build_setting_name_version_major_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_major_prefix_s, 0, FAKE_build_setting_name_version_major_prefix_s_length); + const f_string_static_t fake_build_setting_name_version_micro_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_micro_s, 0, FAKE_build_setting_name_version_micro_s_length); + const f_string_static_t fake_build_setting_name_version_micro_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_micro_prefix_s, 0, FAKE_build_setting_name_version_micro_prefix_s_length); + const f_string_static_t fake_build_setting_name_version_minor_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_minor_s, 0, FAKE_build_setting_name_version_minor_s_length); + const f_string_static_t fake_build_setting_name_version_minor_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_minor_prefix_s, 0, FAKE_build_setting_name_version_minor_prefix_s_length); + const f_string_static_t fake_build_setting_name_version_nano_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_nano_s, 0, FAKE_build_setting_name_version_nano_s_length); + const f_string_static_t fake_build_setting_name_version_nano_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_nano_prefix_s, 0, FAKE_build_setting_name_version_nano_prefix_s_length); + const f_string_static_t fake_build_setting_name_version_target_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_target_s, 0, FAKE_build_setting_name_version_target_s_length); - const f_string_static_t fake_build_setting_default_version_s = macro_f_string_static_t_initialize2(FAKE_build_setting_default_version_s, 0, FAKE_build_setting_default_version_s_length); - const f_string_static_t fake_build_setting_default_version_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_default_version_prefix_s, 0, FAKE_build_setting_default_version_prefix_s_length); + const f_string_static_t fake_build_setting_default_version_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_version_s, 0, FAKE_build_setting_default_version_s_length); + const f_string_static_t fake_build_setting_default_version_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_version_prefix_s, 0, FAKE_build_setting_default_version_prefix_s_length); #endif // _di_fake_build_setting_t_ #ifndef _di_fake_build_stage_t_ - const f_string_static_t fake_build_stage_built_s = macro_f_string_static_t_initialize2(FAKE_build_stage_built_s, 0, FAKE_build_stage_built_s_length); - const f_string_static_t fake_build_stage_libraries_script_s = macro_f_string_static_t_initialize2(FAKE_build_stage_libraries_script_s, 0, FAKE_build_stage_libraries_script_s_length); - const f_string_static_t fake_build_stage_libraries_shared_s = macro_f_string_static_t_initialize2(FAKE_build_stage_libraries_shared_s, 0, FAKE_build_stage_libraries_shared_s_length); - const f_string_static_t fake_build_stage_libraries_static_s = macro_f_string_static_t_initialize2(FAKE_build_stage_libraries_static_s, 0, FAKE_build_stage_libraries_static_s_length); - const f_string_static_t fake_build_stage_objects_static_s = macro_f_string_static_t_initialize2(FAKE_build_stage_objects_static_s, 0, FAKE_build_stage_objects_static_s_length); - const f_string_static_t fake_build_stage_process_post_s = macro_f_string_static_t_initialize2(FAKE_build_stage_process_post_s, 0, FAKE_build_stage_process_post_s_length); - const f_string_static_t fake_build_stage_process_pre_s = macro_f_string_static_t_initialize2(FAKE_build_stage_process_pre_s, 0, FAKE_build_stage_process_pre_s_length); - const f_string_static_t fake_build_stage_programs_script_s = macro_f_string_static_t_initialize2(FAKE_build_stage_programs_script_s, 0, FAKE_build_stage_programs_script_s_length); - const f_string_static_t fake_build_stage_programs_shared_s = macro_f_string_static_t_initialize2(FAKE_build_stage_programs_shared_s, 0, FAKE_build_stage_programs_shared_s_length); - const f_string_static_t fake_build_stage_programs_static_s = macro_f_string_static_t_initialize2(FAKE_build_stage_programs_static_s, 0, FAKE_build_stage_programs_static_s_length); - const f_string_static_t fake_build_stage_separate_s = macro_f_string_static_t_initialize2(FAKE_build_stage_separate_s, 0, FAKE_build_stage_separate_s_length); - const f_string_static_t fake_build_stage_skeleton_s = macro_f_string_static_t_initialize2(FAKE_build_stage_skeleton_s, 0, FAKE_build_stage_skeleton_s_length); - const f_string_static_t fake_build_stage_sources_headers_s = macro_f_string_static_t_initialize2(FAKE_build_stage_sources_headers_s, 0, FAKE_build_stage_sources_headers_s_length); - const f_string_static_t fake_build_stage_sources_script_s = macro_f_string_static_t_initialize2(FAKE_build_stage_sources_script_s, 0, FAKE_build_stage_sources_script_s_length); - const f_string_static_t fake_build_stage_sources_settings_s = macro_f_string_static_t_initialize2(FAKE_build_stage_sources_settings_s, 0, FAKE_build_stage_sources_settings_s_length); + const f_string_static_t fake_build_stage_built_s = macro_f_string_static_t_initialize(FAKE_build_stage_built_s, 0, FAKE_build_stage_built_s_length); + const f_string_static_t fake_build_stage_libraries_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_libraries_script_s, 0, FAKE_build_stage_libraries_script_s_length); + const f_string_static_t fake_build_stage_libraries_shared_s = macro_f_string_static_t_initialize(FAKE_build_stage_libraries_shared_s, 0, FAKE_build_stage_libraries_shared_s_length); + const f_string_static_t fake_build_stage_libraries_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_libraries_static_s, 0, FAKE_build_stage_libraries_static_s_length); + const f_string_static_t fake_build_stage_objects_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_objects_static_s, 0, FAKE_build_stage_objects_static_s_length); + const f_string_static_t fake_build_stage_process_post_s = macro_f_string_static_t_initialize(FAKE_build_stage_process_post_s, 0, FAKE_build_stage_process_post_s_length); + const f_string_static_t fake_build_stage_process_pre_s = macro_f_string_static_t_initialize(FAKE_build_stage_process_pre_s, 0, FAKE_build_stage_process_pre_s_length); + const f_string_static_t fake_build_stage_programs_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_programs_script_s, 0, FAKE_build_stage_programs_script_s_length); + const f_string_static_t fake_build_stage_programs_shared_s = macro_f_string_static_t_initialize(FAKE_build_stage_programs_shared_s, 0, FAKE_build_stage_programs_shared_s_length); + const f_string_static_t fake_build_stage_programs_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_programs_static_s, 0, FAKE_build_stage_programs_static_s_length); + const f_string_static_t fake_build_stage_separate_s = macro_f_string_static_t_initialize(FAKE_build_stage_separate_s, 0, FAKE_build_stage_separate_s_length); + const f_string_static_t fake_build_stage_skeleton_s = macro_f_string_static_t_initialize(FAKE_build_stage_skeleton_s, 0, FAKE_build_stage_skeleton_s_length); + const f_string_static_t fake_build_stage_sources_headers_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_headers_s, 0, FAKE_build_stage_sources_headers_s_length); + const f_string_static_t fake_build_stage_sources_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_script_s, 0, FAKE_build_stage_sources_script_s_length); + const f_string_static_t fake_build_stage_sources_settings_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_settings_s, 0, FAKE_build_stage_sources_settings_s_length); #endif // _di_fake_build_stage_t_ #ifndef _di_fake_build_parameter_ - const f_string_static_t fake_build_parameter_library_include_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_include_s, 0, FAKE_build_parameter_library_include_s_length); - const f_string_static_t fake_build_parameter_library_link_file_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_link_file_s, 0, FAKE_build_parameter_library_link_file_s_length); - const f_string_static_t fake_build_parameter_library_link_path_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_link_path_s, 0, FAKE_build_parameter_library_link_path_s_length); - const f_string_static_t fake_build_parameter_library_name_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_name_prefix_s, 0, FAKE_build_parameter_library_name_prefix_s_length); - const f_string_static_t fake_build_parameter_library_name_suffix_shared_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_name_suffix_shared_s, 0, FAKE_build_parameter_library_name_suffix_shared_s_length); - const f_string_static_t fake_build_parameter_library_name_suffix_static_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_name_suffix_static_s, 0, FAKE_build_parameter_library_name_suffix_static_s_length); - const f_string_static_t fake_build_parameter_library_output_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_output_s, 0, FAKE_build_parameter_library_output_s_length); - const f_string_static_t fake_build_parameter_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_shared_s, 0, FAKE_build_parameter_library_shared_s_length); - const f_string_static_t fake_build_parameter_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_static_s, 0, FAKE_build_parameter_library_static_s_length); - const f_string_static_t fake_build_parameter_library_shared_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_shared_prefix_s, 0, FAKE_build_parameter_library_shared_prefix_s_length); + const f_string_static_t fake_build_parameter_library_include_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_include_s, 0, FAKE_build_parameter_library_include_s_length); + const f_string_static_t fake_build_parameter_library_link_file_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_link_file_s, 0, FAKE_build_parameter_library_link_file_s_length); + const f_string_static_t fake_build_parameter_library_link_path_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_link_path_s, 0, FAKE_build_parameter_library_link_path_s_length); + const f_string_static_t fake_build_parameter_library_name_prefix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_prefix_s, 0, FAKE_build_parameter_library_name_prefix_s_length); + const f_string_static_t fake_build_parameter_library_name_suffix_shared_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_suffix_shared_s, 0, FAKE_build_parameter_library_name_suffix_shared_s_length); + const f_string_static_t fake_build_parameter_library_name_suffix_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_suffix_static_s, 0, FAKE_build_parameter_library_name_suffix_static_s_length); + const f_string_static_t fake_build_parameter_library_output_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_output_s, 0, FAKE_build_parameter_library_output_s_length); + const f_string_static_t fake_build_parameter_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_shared_s, 0, FAKE_build_parameter_library_shared_s_length); + const f_string_static_t fake_build_parameter_library_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_static_s, 0, FAKE_build_parameter_library_static_s_length); + const f_string_static_t fake_build_parameter_library_shared_prefix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_shared_prefix_s, 0, FAKE_build_parameter_library_shared_prefix_s_length); - const f_string_static_t fake_build_parameter_object_compile_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_object_compile_s, 0, FAKE_build_parameter_object_compile_s_length); - const f_string_static_t fake_build_parameter_object_name_suffix_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_object_name_suffix_s, 0, FAKE_build_parameter_object_name_suffix_s_length); - const f_string_static_t fake_build_parameter_object_output_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_object_output_s, 0, FAKE_build_parameter_object_output_s_length); - const f_string_static_t fake_build_parameter_object_static_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_object_static_s, 0, FAKE_build_parameter_object_static_s_length); + const f_string_static_t fake_build_parameter_object_compile_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_compile_s, 0, FAKE_build_parameter_object_compile_s_length); + const f_string_static_t fake_build_parameter_object_name_suffix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_name_suffix_s, 0, FAKE_build_parameter_object_name_suffix_s_length); + const f_string_static_t fake_build_parameter_object_output_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_output_s, 0, FAKE_build_parameter_object_output_s_length); + const f_string_static_t fake_build_parameter_object_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_static_s, 0, FAKE_build_parameter_object_static_s_length); #endif // _di_fake_build_parameter_ #ifndef _di_fake_common_ - const f_string_static_t fake_common_setting_bool_yes_s = macro_f_string_static_t_initialize2(FAKE_common_setting_bool_yes_s, 0, FAKE_common_setting_bool_yes_s_length); - const f_string_static_t fake_common_setting_bool_no_s = macro_f_string_static_t_initialize2(FAKE_common_setting_bool_no_s, 0, FAKE_common_setting_bool_no_s_length); - const f_string_static_t fake_common_setting_list_s = macro_f_string_static_t_initialize2(FAKE_common_setting_list_s, 0, FAKE_common_setting_list_s_length); + const f_string_static_t fake_common_file_directory_copy_s = macro_f_string_static_t_initialize(FAKE_common_file_directory_copy_s, 0, FAKE_common_file_directory_copy_s_length); + const f_string_static_t fake_common_file_path_change_to_s = macro_f_string_static_t_initialize(FAKE_common_file_path_change_to_s, 0, FAKE_common_file_path_change_to_s_length); + const f_string_static_t fake_common_file_path_determine_real_s = macro_f_string_static_t_initialize(FAKE_common_file_path_determine_real_s, 0, FAKE_common_file_path_determine_real_s_length); + const f_string_static_t fake_common_file_path_stack_s = macro_f_string_static_t_initialize(FAKE_common_file_path_stack_s, 0, FAKE_common_file_path_stack_s_length); + const f_string_static_t fake_common_file_populate_pre_s = macro_f_string_static_t_initialize(FAKE_common_file_populate_pre_s, 0, FAKE_common_file_populate_pre_s_length); + + const f_string_static_t fake_common_setting_bool_yes_s = macro_f_string_static_t_initialize(FAKE_common_setting_bool_yes_s, 0, FAKE_common_setting_bool_yes_s_length); + const f_string_static_t fake_common_setting_bool_no_s = macro_f_string_static_t_initialize(FAKE_common_setting_bool_no_s, 0, FAKE_common_setting_bool_no_s_length); + + const f_string_static_t fake_common_setting_list_s = macro_f_string_static_t_initialize(FAKE_common_setting_list_s, 0, FAKE_common_setting_list_s_length); #endif // _di_fake_common_ #ifndef _di_fake_make_section_ - const f_string_static_t fake_make_section_main_s = macro_f_string_static_t_initialize2(FAKE_make_section_main_s, 0, FAKE_make_section_main_s_length); - const f_string_static_t fake_make_section_settings_s = macro_f_string_static_t_initialize2(FAKE_make_section_settings_s, 0, FAKE_make_section_settings_s_length); + const f_string_static_t fake_make_section_main_s = macro_f_string_static_t_initialize(FAKE_make_section_main_s, 0, FAKE_make_section_main_s_length); + const f_string_static_t fake_make_section_settings_s = macro_f_string_static_t_initialize(FAKE_make_section_settings_s, 0, FAKE_make_section_settings_s_length); #endif // _di_fake_make_section_ #ifndef _di_fake_make_setting_t_ - const f_string_static_t fake_make_setting_compiler_s = macro_f_string_static_t_initialize2(FAKE_make_setting_compiler_s, 0, FAKE_make_setting_compiler_s_length); - const f_string_static_t fake_make_setting_define_s = macro_f_string_static_t_initialize2(FAKE_make_setting_define_s, 0, FAKE_make_setting_define_s_length); - const f_string_static_t fake_make_setting_environment_s = macro_f_string_static_t_initialize2(FAKE_make_setting_environment_s, 0, FAKE_make_setting_environment_s_length); - const f_string_static_t fake_make_setting_fail_s = macro_f_string_static_t_initialize2(FAKE_make_setting_fail_s, 0, FAKE_make_setting_fail_s_length); - const f_string_static_t fake_make_setting_indexer_s = macro_f_string_static_t_initialize2(FAKE_make_setting_indexer_s, 0, FAKE_make_setting_indexer_s_length); - const f_string_static_t fake_make_setting_indexer_arguments_s = macro_f_string_static_t_initialize2(FAKE_make_setting_indexer_arguments_s, 0, FAKE_make_setting_indexer_arguments_s_length); - const f_string_static_t fake_make_setting_load_build_s = macro_f_string_static_t_initialize2(FAKE_make_setting_load_build_s, 0, FAKE_make_setting_load_build_s_length); - const f_string_static_t fake_make_setting_parameter_s = macro_f_string_static_t_initialize2(FAKE_make_setting_parameter_s, 0, FAKE_make_setting_parameter_s_length); - const f_string_static_t fake_make_setting_return_s = macro_f_string_static_t_initialize2(FAKE_make_setting_return_s, 0, FAKE_make_setting_return_s_length); + const f_string_static_t fake_make_setting_compiler_s = macro_f_string_static_t_initialize(FAKE_make_setting_compiler_s, 0, FAKE_make_setting_compiler_s_length); + const f_string_static_t fake_make_setting_define_s = macro_f_string_static_t_initialize(FAKE_make_setting_define_s, 0, FAKE_make_setting_define_s_length); + const f_string_static_t fake_make_setting_environment_s = macro_f_string_static_t_initialize(FAKE_make_setting_environment_s, 0, FAKE_make_setting_environment_s_length); + const f_string_static_t fake_make_setting_fail_s = macro_f_string_static_t_initialize(FAKE_make_setting_fail_s, 0, FAKE_make_setting_fail_s_length); + const f_string_static_t fake_make_setting_indexer_s = macro_f_string_static_t_initialize(FAKE_make_setting_indexer_s, 0, FAKE_make_setting_indexer_s_length); + const f_string_static_t fake_make_setting_indexer_arguments_s = macro_f_string_static_t_initialize(FAKE_make_setting_indexer_arguments_s, 0, FAKE_make_setting_indexer_arguments_s_length); + const f_string_static_t fake_make_setting_load_build_s = macro_f_string_static_t_initialize(FAKE_make_setting_load_build_s, 0, FAKE_make_setting_load_build_s_length); + const f_string_static_t fake_make_setting_parameter_s = macro_f_string_static_t_initialize(FAKE_make_setting_parameter_s, 0, FAKE_make_setting_parameter_s_length); + const f_string_static_t fake_make_setting_return_s = macro_f_string_static_t_initialize(FAKE_make_setting_return_s, 0, FAKE_make_setting_return_s_length); #endif // _di_fake_make_setting_t_ #ifndef _di_fake_make_operation_ - const f_string_static_t fake_make_operation_and_s = macro_f_string_static_t_initialize2(FAKE_make_operation_and_s, 0, FAKE_make_operation_and_s_length); - const f_string_static_t fake_make_operation_break_s = macro_f_string_static_t_initialize2(FAKE_make_operation_break_s, 0, FAKE_make_operation_break_s_length); - const f_string_static_t fake_make_operation_build_s = macro_f_string_static_t_initialize2(FAKE_make_operation_build_s, 0, FAKE_make_operation_build_s_length); - const f_string_static_t fake_make_operation_clean_s = macro_f_string_static_t_initialize2(FAKE_make_operation_clean_s, 0, FAKE_make_operation_clean_s_length); - const f_string_static_t fake_make_operation_clone_s = macro_f_string_static_t_initialize2(FAKE_make_operation_clone_s, 0, FAKE_make_operation_clone_s_length); - const f_string_static_t fake_make_operation_compile_s = macro_f_string_static_t_initialize2(FAKE_make_operation_compile_s, 0, FAKE_make_operation_compile_s_length); - const f_string_static_t fake_make_operation_copy_s = macro_f_string_static_t_initialize2(FAKE_make_operation_copy_s, 0, FAKE_make_operation_copy_s_length); - const f_string_static_t fake_make_operation_define_s = macro_f_string_static_t_initialize2(FAKE_make_operation_define_s, 0, FAKE_make_operation_define_s_length); - const f_string_static_t fake_make_operation_delete_s = macro_f_string_static_t_initialize2(FAKE_make_operation_delete_s, 0, FAKE_make_operation_delete_s_length); - const f_string_static_t fake_make_operation_deletes_s = macro_f_string_static_t_initialize2(FAKE_make_operation_deletes_s, 0, FAKE_make_operation_deletes_s_length); - const f_string_static_t fake_make_operation_else_s = macro_f_string_static_t_initialize2(FAKE_make_operation_else_s, 0, FAKE_make_operation_else_s_length); - const f_string_static_t fake_make_operation_exit_s = macro_f_string_static_t_initialize2(FAKE_make_operation_exit_s, 0, FAKE_make_operation_exit_s_length); - const f_string_static_t fake_make_operation_fail_s = macro_f_string_static_t_initialize2(FAKE_make_operation_fail_s, 0, FAKE_make_operation_fail_s_length); - const f_string_static_t fake_make_operation_group_s = macro_f_string_static_t_initialize2(FAKE_make_operation_group_s, 0, FAKE_make_operation_group_s_length); - const f_string_static_t fake_make_operation_groups_s = macro_f_string_static_t_initialize2(FAKE_make_operation_groups_s, 0, FAKE_make_operation_groups_s_length); - const f_string_static_t fake_make_operation_if_s = macro_f_string_static_t_initialize2(FAKE_make_operation_if_s, 0, FAKE_make_operation_if_s_length); - const f_string_static_t fake_make_operation_index_s = macro_f_string_static_t_initialize2(FAKE_make_operation_index_s, 0, FAKE_make_operation_index_s_length); - const f_string_static_t fake_make_operation_link_s = macro_f_string_static_t_initialize2(FAKE_make_operation_link_s, 0, FAKE_make_operation_link_s_length); - const f_string_static_t fake_make_operation_mode_s = macro_f_string_static_t_initialize2(FAKE_make_operation_mode_s, 0, FAKE_make_operation_mode_s_length); - const f_string_static_t fake_make_operation_modes_s = macro_f_string_static_t_initialize2(FAKE_make_operation_modes_s, 0, FAKE_make_operation_modes_s_length); - const f_string_static_t fake_make_operation_move_s = macro_f_string_static_t_initialize2(FAKE_make_operation_move_s, 0, FAKE_make_operation_move_s_length); - const f_string_static_t fake_make_operation_operate_s = macro_f_string_static_t_initialize2(FAKE_make_operation_operate_s, 0, FAKE_make_operation_operate_s_length); - const f_string_static_t fake_make_operation_or_s = macro_f_string_static_t_initialize2(FAKE_make_operation_or_s, 0, FAKE_make_operation_or_s_length); - const f_string_static_t fake_make_operation_owner_s = macro_f_string_static_t_initialize2(FAKE_make_operation_owner_s, 0, FAKE_make_operation_owner_s_length); - const f_string_static_t fake_make_operation_owners_s = macro_f_string_static_t_initialize2(FAKE_make_operation_owners_s, 0, FAKE_make_operation_owners_s_length); - const f_string_static_t fake_make_operation_parameter_s = macro_f_string_static_t_initialize2(FAKE_make_operation_parameter_s, 0, FAKE_make_operation_parameter_s_length); - const f_string_static_t fake_make_operation_pop_s = macro_f_string_static_t_initialize2(FAKE_make_operation_pop_s, 0, FAKE_make_operation_pop_s_length); - const f_string_static_t fake_make_operation_print_s = macro_f_string_static_t_initialize2(FAKE_make_operation_print_s, 0, FAKE_make_operation_print_s_length); - const f_string_static_t fake_make_operation_run_s = macro_f_string_static_t_initialize2(FAKE_make_operation_run_s, 0, FAKE_make_operation_run_s_length); - const f_string_static_t fake_make_operation_shell_s = macro_f_string_static_t_initialize2(FAKE_make_operation_shell_s, 0, FAKE_make_operation_shell_s_length); - const f_string_static_t fake_make_operation_skeleton_s = macro_f_string_static_t_initialize2(FAKE_make_operation_skeleton_s, 0, FAKE_make_operation_skeleton_s_length); - const f_string_static_t fake_make_operation_to_s = macro_f_string_static_t_initialize2(FAKE_make_operation_to_s, 0, FAKE_make_operation_to_s_length); - const f_string_static_t fake_make_operation_top_s = macro_f_string_static_t_initialize2(FAKE_make_operation_top_s, 0, FAKE_make_operation_top_s_length); - const f_string_static_t fake_make_operation_touch_s = macro_f_string_static_t_initialize2(FAKE_make_operation_touch_s, 0, FAKE_make_operation_touch_s_length); + const f_string_static_t fake_make_operation_and_s = macro_f_string_static_t_initialize(FAKE_make_operation_and_s, 0, FAKE_make_operation_and_s_length); + const f_string_static_t fake_make_operation_break_s = macro_f_string_static_t_initialize(FAKE_make_operation_break_s, 0, FAKE_make_operation_break_s_length); + const f_string_static_t fake_make_operation_build_s = macro_f_string_static_t_initialize(FAKE_make_operation_build_s, 0, FAKE_make_operation_build_s_length); + const f_string_static_t fake_make_operation_clean_s = macro_f_string_static_t_initialize(FAKE_make_operation_clean_s, 0, FAKE_make_operation_clean_s_length); + const f_string_static_t fake_make_operation_clone_s = macro_f_string_static_t_initialize(FAKE_make_operation_clone_s, 0, FAKE_make_operation_clone_s_length); + const f_string_static_t fake_make_operation_compile_s = macro_f_string_static_t_initialize(FAKE_make_operation_compile_s, 0, FAKE_make_operation_compile_s_length); + const f_string_static_t fake_make_operation_copy_s = macro_f_string_static_t_initialize(FAKE_make_operation_copy_s, 0, FAKE_make_operation_copy_s_length); + const f_string_static_t fake_make_operation_define_s = macro_f_string_static_t_initialize(FAKE_make_operation_define_s, 0, FAKE_make_operation_define_s_length); + const f_string_static_t fake_make_operation_delete_s = macro_f_string_static_t_initialize(FAKE_make_operation_delete_s, 0, FAKE_make_operation_delete_s_length); + const f_string_static_t fake_make_operation_deletes_s = macro_f_string_static_t_initialize(FAKE_make_operation_deletes_s, 0, FAKE_make_operation_deletes_s_length); + const f_string_static_t fake_make_operation_else_s = macro_f_string_static_t_initialize(FAKE_make_operation_else_s, 0, FAKE_make_operation_else_s_length); + const f_string_static_t fake_make_operation_exit_s = macro_f_string_static_t_initialize(FAKE_make_operation_exit_s, 0, FAKE_make_operation_exit_s_length); + const f_string_static_t fake_make_operation_fail_s = macro_f_string_static_t_initialize(FAKE_make_operation_fail_s, 0, FAKE_make_operation_fail_s_length); + const f_string_static_t fake_make_operation_group_s = macro_f_string_static_t_initialize(FAKE_make_operation_group_s, 0, FAKE_make_operation_group_s_length); + const f_string_static_t fake_make_operation_groups_s = macro_f_string_static_t_initialize(FAKE_make_operation_groups_s, 0, FAKE_make_operation_groups_s_length); + const f_string_static_t fake_make_operation_if_s = macro_f_string_static_t_initialize(FAKE_make_operation_if_s, 0, FAKE_make_operation_if_s_length); + const f_string_static_t fake_make_operation_index_s = macro_f_string_static_t_initialize(FAKE_make_operation_index_s, 0, FAKE_make_operation_index_s_length); + const f_string_static_t fake_make_operation_link_s = macro_f_string_static_t_initialize(FAKE_make_operation_link_s, 0, FAKE_make_operation_link_s_length); + const f_string_static_t fake_make_operation_mode_s = macro_f_string_static_t_initialize(FAKE_make_operation_mode_s, 0, FAKE_make_operation_mode_s_length); + const f_string_static_t fake_make_operation_modes_s = macro_f_string_static_t_initialize(FAKE_make_operation_modes_s, 0, FAKE_make_operation_modes_s_length); + const f_string_static_t fake_make_operation_move_s = macro_f_string_static_t_initialize(FAKE_make_operation_move_s, 0, FAKE_make_operation_move_s_length); + const f_string_static_t fake_make_operation_operate_s = macro_f_string_static_t_initialize(FAKE_make_operation_operate_s, 0, FAKE_make_operation_operate_s_length); + const f_string_static_t fake_make_operation_or_s = macro_f_string_static_t_initialize(FAKE_make_operation_or_s, 0, FAKE_make_operation_or_s_length); + const f_string_static_t fake_make_operation_owner_s = macro_f_string_static_t_initialize(FAKE_make_operation_owner_s, 0, FAKE_make_operation_owner_s_length); + const f_string_static_t fake_make_operation_owners_s = macro_f_string_static_t_initialize(FAKE_make_operation_owners_s, 0, FAKE_make_operation_owners_s_length); + const f_string_static_t fake_make_operation_parameter_s = macro_f_string_static_t_initialize(FAKE_make_operation_parameter_s, 0, FAKE_make_operation_parameter_s_length); + const f_string_static_t fake_make_operation_pop_s = macro_f_string_static_t_initialize(FAKE_make_operation_pop_s, 0, FAKE_make_operation_pop_s_length); + const f_string_static_t fake_make_operation_print_s = macro_f_string_static_t_initialize(FAKE_make_operation_print_s, 0, FAKE_make_operation_print_s_length); + const f_string_static_t fake_make_operation_run_s = macro_f_string_static_t_initialize(FAKE_make_operation_run_s, 0, FAKE_make_operation_run_s_length); + const f_string_static_t fake_make_operation_shell_s = macro_f_string_static_t_initialize(FAKE_make_operation_shell_s, 0, FAKE_make_operation_shell_s_length); + const f_string_static_t fake_make_operation_skeleton_s = macro_f_string_static_t_initialize(FAKE_make_operation_skeleton_s, 0, FAKE_make_operation_skeleton_s_length); + const f_string_static_t fake_make_operation_to_s = macro_f_string_static_t_initialize(FAKE_make_operation_to_s, 0, FAKE_make_operation_to_s_length); + const f_string_static_t fake_make_operation_top_s = macro_f_string_static_t_initialize(FAKE_make_operation_top_s, 0, FAKE_make_operation_top_s_length); + const f_string_static_t fake_make_operation_touch_s = macro_f_string_static_t_initialize(FAKE_make_operation_touch_s, 0, FAKE_make_operation_touch_s_length); - const f_string_static_t fake_make_operation_argument_environment_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_environment_s, 0, FAKE_make_operation_argument_environment_s_length); - const f_string_static_t fake_make_operation_argument_failure_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_failure_s, 0, FAKE_make_operation_argument_failure_s_length); - const f_string_static_t fake_make_operation_argument_file_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_file_s, 0, FAKE_make_operation_argument_file_s_length); - const f_string_static_t fake_make_operation_argument_directory_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_directory_s, 0, FAKE_make_operation_argument_directory_s_length); - const f_string_static_t fake_make_operation_argument_error_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_error_s, 0, FAKE_make_operation_argument_error_s_length); - const f_string_static_t fake_make_operation_argument_exit_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_exit_s, 0, FAKE_make_operation_argument_exit_s_length); - const f_string_static_t fake_make_operation_argument_has_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_has_s, 0, FAKE_make_operation_argument_has_s_length); - const f_string_static_t fake_make_operation_argument_ignore_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_ignore_s, 0, FAKE_make_operation_argument_ignore_s_length); - const f_string_static_t fake_make_operation_argument_is_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_is_s, 0, FAKE_make_operation_argument_is_s_length); - const f_string_static_t fake_make_operation_argument_parameter_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_parameter_s, 0, FAKE_make_operation_argument_parameter_s_length); - const f_string_static_t fake_make_operation_argument_point_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_point_s, 0, FAKE_make_operation_argument_point_s_length); - const f_string_static_t fake_make_operation_argument_recursive_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_recursive_s, 0, FAKE_make_operation_argument_recursive_s_length); - const f_string_static_t fake_make_operation_argument_success_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_success_s, 0, FAKE_make_operation_argument_success_s_length); - const f_string_static_t fake_make_operation_argument_target_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_target_s, 0, FAKE_make_operation_argument_target_s_length); - const f_string_static_t fake_make_operation_argument_warn_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_warn_s, 0, FAKE_make_operation_argument_warn_s_length); + const f_string_static_t fake_make_operation_argument_environment_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_environment_s, 0, FAKE_make_operation_argument_environment_s_length); + const f_string_static_t fake_make_operation_argument_failure_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_failure_s, 0, FAKE_make_operation_argument_failure_s_length); + const f_string_static_t fake_make_operation_argument_file_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_file_s, 0, FAKE_make_operation_argument_file_s_length); + const f_string_static_t fake_make_operation_argument_directory_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_directory_s, 0, FAKE_make_operation_argument_directory_s_length); + const f_string_static_t fake_make_operation_argument_error_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_error_s, 0, FAKE_make_operation_argument_error_s_length); + const f_string_static_t fake_make_operation_argument_exit_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_exit_s, 0, FAKE_make_operation_argument_exit_s_length); + const f_string_static_t fake_make_operation_argument_has_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_has_s, 0, FAKE_make_operation_argument_has_s_length); + const f_string_static_t fake_make_operation_argument_ignore_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_ignore_s, 0, FAKE_make_operation_argument_ignore_s_length); + const f_string_static_t fake_make_operation_argument_is_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_is_s, 0, FAKE_make_operation_argument_is_s_length); + const f_string_static_t fake_make_operation_argument_parameter_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_parameter_s, 0, FAKE_make_operation_argument_parameter_s_length); + const f_string_static_t fake_make_operation_argument_point_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_point_s, 0, FAKE_make_operation_argument_point_s_length); + const f_string_static_t fake_make_operation_argument_recursive_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_recursive_s, 0, FAKE_make_operation_argument_recursive_s_length); + const f_string_static_t fake_make_operation_argument_success_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_success_s, 0, FAKE_make_operation_argument_success_s_length); + const f_string_static_t fake_make_operation_argument_target_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_target_s, 0, FAKE_make_operation_argument_target_s_length); + const f_string_static_t fake_make_operation_argument_warn_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_warn_s, 0, FAKE_make_operation_argument_warn_s_length); - const f_string_static_t fake_make_operation_argument_if_defined_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_defined_s, 0, FAKE_make_operation_argument_if_defined_s_length); - const f_string_static_t fake_make_operation_argument_if_equal_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_equal_s, 0, FAKE_make_operation_argument_if_equal_s_length); - const f_string_static_t fake_make_operation_argument_if_equal_not_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_equal_not_s, 0, FAKE_make_operation_argument_if_equal_not_s_length); - const f_string_static_t fake_make_operation_argument_if_exists_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_exists_s, 0, FAKE_make_operation_argument_if_exists_s_length); - const f_string_static_t fake_make_operation_argument_if_failure_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_failure_s, 0, FAKE_make_operation_argument_if_failure_s_length); - const f_string_static_t fake_make_operation_argument_if_greater_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_greater_s, 0, FAKE_make_operation_argument_if_greater_s_length); - const f_string_static_t fake_make_operation_argument_if_greater_equal_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_greater_equal_s, 0, FAKE_make_operation_argument_if_greater_equal_s_length); - const f_string_static_t fake_make_operation_argument_if_group_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_group_s, 0, FAKE_make_operation_argument_if_group_s_length); - const f_string_static_t fake_make_operation_argument_if_is_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_is_s, 0, FAKE_make_operation_argument_if_is_s_length); - const f_string_static_t fake_make_operation_argument_if_is_for_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_is_for_s, 0, FAKE_make_operation_argument_if_is_for_s_length); - const f_string_static_t fake_make_operation_argument_if_less_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_less_s, 0, FAKE_make_operation_argument_if_less_s_length); - const f_string_static_t fake_make_operation_argument_if_less_equal_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_less_equal_s, 0, FAKE_make_operation_argument_if_less_equal_s_length); - const f_string_static_t fake_make_operation_argument_if_mode_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_mode_s, 0, FAKE_make_operation_argument_if_mode_s_length); - const f_string_static_t fake_make_operation_argument_if_not_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_not_s, 0, FAKE_make_operation_argument_if_not_s_length); - const f_string_static_t fake_make_operation_argument_if_owner_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_owner_s, 0, FAKE_make_operation_argument_if_owner_s_length); - const f_string_static_t fake_make_operation_argument_if_success_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_success_s, 0, FAKE_make_operation_argument_if_success_s_length); + const f_string_static_t fake_make_operation_argument_if_defined_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_defined_s, 0, FAKE_make_operation_argument_if_defined_s_length); + const f_string_static_t fake_make_operation_argument_if_equal_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_equal_s, 0, FAKE_make_operation_argument_if_equal_s_length); + const f_string_static_t fake_make_operation_argument_if_equal_not_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_equal_not_s, 0, FAKE_make_operation_argument_if_equal_not_s_length); + const f_string_static_t fake_make_operation_argument_if_exists_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_exists_s, 0, FAKE_make_operation_argument_if_exists_s_length); + const f_string_static_t fake_make_operation_argument_if_failure_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_failure_s, 0, FAKE_make_operation_argument_if_failure_s_length); + const f_string_static_t fake_make_operation_argument_if_greater_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_greater_s, 0, FAKE_make_operation_argument_if_greater_s_length); + const f_string_static_t fake_make_operation_argument_if_greater_equal_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_greater_equal_s, 0, FAKE_make_operation_argument_if_greater_equal_s_length); + const f_string_static_t fake_make_operation_argument_if_group_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_group_s, 0, FAKE_make_operation_argument_if_group_s_length); + const f_string_static_t fake_make_operation_argument_if_is_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_is_s, 0, FAKE_make_operation_argument_if_is_s_length); + const f_string_static_t fake_make_operation_argument_if_is_for_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_is_for_s, 0, FAKE_make_operation_argument_if_is_for_s_length); + const f_string_static_t fake_make_operation_argument_if_less_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_less_s, 0, FAKE_make_operation_argument_if_less_s_length); + const f_string_static_t fake_make_operation_argument_if_less_equal_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_less_equal_s, 0, FAKE_make_operation_argument_if_less_equal_s_length); + const f_string_static_t fake_make_operation_argument_if_mode_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_mode_s, 0, FAKE_make_operation_argument_if_mode_s_length); + const f_string_static_t fake_make_operation_argument_if_not_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_not_s, 0, FAKE_make_operation_argument_if_not_s_length); + const f_string_static_t fake_make_operation_argument_if_owner_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_owner_s, 0, FAKE_make_operation_argument_if_owner_s_length); + const f_string_static_t fake_make_operation_argument_if_success_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_success_s, 0, FAKE_make_operation_argument_if_success_s_length); #endif // _di_fake_make_operation_ #ifndef _di_fake_make_parameter_t_ - const f_string_static_t fake_make_parameter_iki_option_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_iki_option_s, 0, FAKE_make_parameter_iki_option_s_length); - const f_string_static_t fake_make_parameter_iki_value_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_iki_value_s, 0, FAKE_make_parameter_iki_value_s_length); + const f_string_static_t fake_make_parameter_iki_option_s = macro_f_string_static_t_initialize(FAKE_make_parameter_iki_option_s, 0, FAKE_make_parameter_iki_option_s_length); + const f_string_static_t fake_make_parameter_iki_value_s = macro_f_string_static_t_initialize(FAKE_make_parameter_iki_value_s, 0, FAKE_make_parameter_iki_value_s_length); - const f_string_static_t fake_make_parameter_variable_build_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_build_s, 0, FAKE_make_parameter_variable_build_s_length); - const f_string_static_t fake_make_parameter_variable_color_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_color_s, 0, FAKE_make_parameter_variable_color_s_length); - const f_string_static_t fake_make_parameter_variable_data_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_data_s, 0, FAKE_make_parameter_variable_data_s_length); - const f_string_static_t fake_make_parameter_variable_define_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_define_s, 0, FAKE_make_parameter_variable_define_s_length); - const f_string_static_t fake_make_parameter_variable_fakefile_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_fakefile_s, 0, FAKE_make_parameter_variable_fakefile_s_length); - const f_string_static_t fake_make_parameter_variable_mode_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_mode_s, 0, FAKE_make_parameter_variable_mode_s_length); - const f_string_static_t fake_make_parameter_variable_process_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_process_s, 0, FAKE_make_parameter_variable_process_s_length); - const f_string_static_t fake_make_parameter_variable_return_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_return_s, 0, FAKE_make_parameter_variable_return_s_length); - const f_string_static_t fake_make_parameter_variable_settings_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_settings_s, 0, FAKE_make_parameter_variable_settings_s_length); - const f_string_static_t fake_make_parameter_variable_sources_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_sources_s, 0, FAKE_make_parameter_variable_sources_s_length); - const f_string_static_t fake_make_parameter_variable_verbosity_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_verbosity_s, 0, FAKE_make_parameter_variable_verbosity_s_length); - const f_string_static_t fake_make_parameter_variable_work_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_work_s, 0, FAKE_make_parameter_variable_work_s_length); + const f_string_static_t fake_make_parameter_variable_build_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_build_s, 0, FAKE_make_parameter_variable_build_s_length); + const f_string_static_t fake_make_parameter_variable_color_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_color_s, 0, FAKE_make_parameter_variable_color_s_length); + const f_string_static_t fake_make_parameter_variable_data_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_data_s, 0, FAKE_make_parameter_variable_data_s_length); + const f_string_static_t fake_make_parameter_variable_define_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_define_s, 0, FAKE_make_parameter_variable_define_s_length); + const f_string_static_t fake_make_parameter_variable_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_fakefile_s, 0, FAKE_make_parameter_variable_fakefile_s_length); + const f_string_static_t fake_make_parameter_variable_mode_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_mode_s, 0, FAKE_make_parameter_variable_mode_s_length); + const f_string_static_t fake_make_parameter_variable_process_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_process_s, 0, FAKE_make_parameter_variable_process_s_length); + const f_string_static_t fake_make_parameter_variable_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_return_s, 0, FAKE_make_parameter_variable_return_s_length); + const f_string_static_t fake_make_parameter_variable_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_settings_s, 0, FAKE_make_parameter_variable_settings_s_length); + const f_string_static_t fake_make_parameter_variable_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_sources_s, 0, FAKE_make_parameter_variable_sources_s_length); + const f_string_static_t fake_make_parameter_variable_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_verbosity_s, 0, FAKE_make_parameter_variable_verbosity_s_length); + const f_string_static_t fake_make_parameter_variable_work_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_work_s, 0, FAKE_make_parameter_variable_work_s_length); - const f_string_static_t fake_make_parameter_variable_option_build_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_build_s, 0, FAKE_make_parameter_variable_build_s_length); - const f_string_static_t fake_make_parameter_variable_option_color_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_color_s, 0, FAKE_make_parameter_variable_option_color_s_length); - const f_string_static_t fake_make_parameter_variable_option_data_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_data_s, 0, FAKE_make_parameter_variable_option_data_s_length); - const f_string_static_t fake_make_parameter_variable_option_define_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_define_s, 0, FAKE_make_parameter_variable_option_define_s_length); - const f_string_static_t fake_make_parameter_variable_option_fakefile_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_fakefile_s, 0, FAKE_make_parameter_variable_option_fakefile_s_length); - const f_string_static_t fake_make_parameter_variable_option_mode_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_mode_s, 0, FAKE_make_parameter_variable_option_mode_s_length); - const f_string_static_t fake_make_parameter_variable_option_process_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_process_s, 0, FAKE_make_parameter_variable_option_process_s_length); - const f_string_static_t fake_make_parameter_variable_option_return_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_return_s, 0, FAKE_make_parameter_variable_option_return_s_length); - const f_string_static_t fake_make_parameter_variable_option_settings_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_settings_s, 0, FAKE_make_parameter_variable_option_settings_s_length); - const f_string_static_t fake_make_parameter_variable_option_sources_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_sources_s, 0, FAKE_make_parameter_variable_option_sources_s_length); - const f_string_static_t fake_make_parameter_variable_option_verbosity_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_verbosity_s, 0, FAKE_make_parameter_variable_option_verbosity_s_length); - const f_string_static_t fake_make_parameter_variable_option_work_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_work_s, 0, FAKE_make_parameter_variable_option_work_s_length); + const f_string_static_t fake_make_parameter_variable_option_build_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_build_s, 0, FAKE_make_parameter_variable_build_s_length); + const f_string_static_t fake_make_parameter_variable_option_color_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_color_s, 0, FAKE_make_parameter_variable_option_color_s_length); + const f_string_static_t fake_make_parameter_variable_option_data_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_data_s, 0, FAKE_make_parameter_variable_option_data_s_length); + const f_string_static_t fake_make_parameter_variable_option_define_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_define_s, 0, FAKE_make_parameter_variable_option_define_s_length); + const f_string_static_t fake_make_parameter_variable_option_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_fakefile_s, 0, FAKE_make_parameter_variable_option_fakefile_s_length); + const f_string_static_t fake_make_parameter_variable_option_mode_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_mode_s, 0, FAKE_make_parameter_variable_option_mode_s_length); + const f_string_static_t fake_make_parameter_variable_option_process_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_process_s, 0, FAKE_make_parameter_variable_option_process_s_length); + const f_string_static_t fake_make_parameter_variable_option_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_return_s, 0, FAKE_make_parameter_variable_option_return_s_length); + const f_string_static_t fake_make_parameter_variable_option_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_settings_s, 0, FAKE_make_parameter_variable_option_settings_s_length); + const f_string_static_t fake_make_parameter_variable_option_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_sources_s, 0, FAKE_make_parameter_variable_option_sources_s_length); + const f_string_static_t fake_make_parameter_variable_option_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_verbosity_s, 0, FAKE_make_parameter_variable_option_verbosity_s_length); + const f_string_static_t fake_make_parameter_variable_option_work_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_work_s, 0, FAKE_make_parameter_variable_option_work_s_length); - const f_string_static_t fake_make_parameter_variable_value_build_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_build_s, 0, FAKE_make_parameter_variable_value_build_s_length); - const f_string_static_t fake_make_parameter_variable_value_color_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_color_s, 0, FAKE_make_parameter_variable_value_color_s_length); - const f_string_static_t fake_make_parameter_variable_value_data_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_data_s, 0, FAKE_make_parameter_variable_value_data_s_length); - const f_string_static_t fake_make_parameter_variable_value_define_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_define_s, 0, FAKE_make_parameter_variable_value_define_s_length); - const f_string_static_t fake_make_parameter_variable_value_fakefile_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_fakefile_s, 0, FAKE_make_parameter_variable_value_fakefile_s_length); - const f_string_static_t fake_make_parameter_variable_value_mode_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_mode_s, 0, FAKE_make_parameter_variable_value_mode_s_length); - const f_string_static_t fake_make_parameter_variable_value_process_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_process_s, 0, FAKE_make_parameter_variable_value_process_s_length); - const f_string_static_t fake_make_parameter_variable_value_return_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_return_s, 0, FAKE_make_parameter_variable_value_return_s_length); - const f_string_static_t fake_make_parameter_variable_value_settings_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_settings_s, 0, FAKE_make_parameter_variable_value_settings_s_length); - const f_string_static_t fake_make_parameter_variable_value_sources_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_sources_s, 0, FAKE_make_parameter_variable_value_sources_s_length); - const f_string_static_t fake_make_parameter_variable_value_verbosity_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_verbosity_s, 0, FAKE_make_parameter_variable_value_verbosity_s_length); - const f_string_static_t fake_make_parameter_variable_value_work_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_work_s, 0, FAKE_make_parameter_variable_value_work_s_length); + const f_string_static_t fake_make_parameter_variable_value_build_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_build_s, 0, FAKE_make_parameter_variable_value_build_s_length); + const f_string_static_t fake_make_parameter_variable_value_color_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_color_s, 0, FAKE_make_parameter_variable_value_color_s_length); + const f_string_static_t fake_make_parameter_variable_value_data_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_data_s, 0, FAKE_make_parameter_variable_value_data_s_length); + const f_string_static_t fake_make_parameter_variable_value_define_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_define_s, 0, FAKE_make_parameter_variable_value_define_s_length); + const f_string_static_t fake_make_parameter_variable_value_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_fakefile_s, 0, FAKE_make_parameter_variable_value_fakefile_s_length); + const f_string_static_t fake_make_parameter_variable_value_mode_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_mode_s, 0, FAKE_make_parameter_variable_value_mode_s_length); + const f_string_static_t fake_make_parameter_variable_value_process_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_process_s, 0, FAKE_make_parameter_variable_value_process_s_length); + const f_string_static_t fake_make_parameter_variable_value_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_return_s, 0, FAKE_make_parameter_variable_value_return_s_length); + const f_string_static_t fake_make_parameter_variable_value_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_settings_s, 0, FAKE_make_parameter_variable_value_settings_s_length); + const f_string_static_t fake_make_parameter_variable_value_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_sources_s, 0, FAKE_make_parameter_variable_value_sources_s_length); + const f_string_static_t fake_make_parameter_variable_value_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_verbosity_s, 0, FAKE_make_parameter_variable_value_verbosity_s_length); + const f_string_static_t fake_make_parameter_variable_value_work_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_work_s, 0, FAKE_make_parameter_variable_value_work_s_length); #endif // _di_fake_make_parameter_t_ #ifndef _di_fake_skeleton_content_ - const f_string_static_t fake_make_skeleton_content_defines_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_defines_s, 0, FAKE_make_skeleton_content_defines_s_length); - const f_string_static_t fake_make_skeleton_content_dependencies_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_dependencies_s, 0, FAKE_make_skeleton_content_dependencies_s_length); - const f_string_static_t fake_make_skeleton_content_fakefile_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_fakefile_s, 0, FAKE_make_skeleton_content_fakefile_s_length); - const f_string_static_t fake_make_skeleton_content_process_post_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_process_post_s, 0, FAKE_make_skeleton_content_process_post_s_length); - const f_string_static_t fake_make_skeleton_content_process_pre_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_process_pre_s, 0, FAKE_make_skeleton_content_process_pre_s_length); - const f_string_static_t fake_make_skeleton_content_settings_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_settings_s, 0, FAKE_make_skeleton_content_settings_s_length); + const f_string_static_t fake_make_skeleton_content_defines_s = macro_f_string_static_t_initialize(FAKE_make_skeleton_content_defines_s, 0, FAKE_make_skeleton_content_defines_s_length); + const f_string_static_t fake_make_skeleton_content_dependencies_s = macro_f_string_static_t_initialize(FAKE_make_skeleton_content_dependencies_s, 0, FAKE_make_skeleton_content_dependencies_s_length); + const f_string_static_t fake_make_skeleton_content_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_skeleton_content_fakefile_s, 0, FAKE_make_skeleton_content_fakefile_s_length); + const f_string_static_t fake_make_skeleton_content_process_post_s = macro_f_string_static_t_initialize(FAKE_make_skeleton_content_process_post_s, 0, FAKE_make_skeleton_content_process_post_s_length); + const f_string_static_t fake_make_skeleton_content_process_pre_s = macro_f_string_static_t_initialize(FAKE_make_skeleton_content_process_pre_s, 0, FAKE_make_skeleton_content_process_pre_s_length); + const f_string_static_t fake_make_skeleton_content_settings_s = macro_f_string_static_t_initialize(FAKE_make_skeleton_content_settings_s, 0, FAKE_make_skeleton_content_settings_s_length); #endif // _di_fake_skeleton_content_ #ifndef _di_fake_make_context_ - const f_string_static_t fake_make_context_reset_s = macro_f_string_static_t_initialize2(FAKE_make_context_reset_s, 0, FAKE_make_context_reset_s_length); - const f_string_static_t fake_make_context_warning_s = macro_f_string_static_t_initialize2(FAKE_make_context_warning_s, 0, FAKE_make_context_warning_s_length); - const f_string_static_t fake_make_context_error_s = macro_f_string_static_t_initialize2(FAKE_make_context_error_s, 0, FAKE_make_context_error_s_length); - const f_string_static_t fake_make_context_title_s = macro_f_string_static_t_initialize2(FAKE_make_context_title_s, 0, FAKE_make_context_title_s_length); - const f_string_static_t fake_make_context_notable_s = macro_f_string_static_t_initialize2(FAKE_make_context_notable_s, 0, FAKE_make_context_notable_s_length); - const f_string_static_t fake_make_context_important_s = macro_f_string_static_t_initialize2(FAKE_make_context_important_s, 0, FAKE_make_context_important_s_length); - const f_string_static_t fake_make_context_standout_s = macro_f_string_static_t_initialize2(FAKE_make_context_standout_s, 0, FAKE_make_context_standout_s_length); - const f_string_static_t fake_make_context_success_s = macro_f_string_static_t_initialize2(FAKE_make_context_success_s, 0, FAKE_make_context_success_s_length); - const f_string_static_t fake_make_context_normal_s = macro_f_string_static_t_initialize2(FAKE_make_context_normal_s, 0, FAKE_make_context_normal_s_length); + const f_string_static_t fake_make_context_reset_s = macro_f_string_static_t_initialize(FAKE_make_context_reset_s, 0, FAKE_make_context_reset_s_length); + const f_string_static_t fake_make_context_warning_s = macro_f_string_static_t_initialize(FAKE_make_context_warning_s, 0, FAKE_make_context_warning_s_length); + const f_string_static_t fake_make_context_error_s = macro_f_string_static_t_initialize(FAKE_make_context_error_s, 0, FAKE_make_context_error_s_length); + const f_string_static_t fake_make_context_title_s = macro_f_string_static_t_initialize(FAKE_make_context_title_s, 0, FAKE_make_context_title_s_length); + const f_string_static_t fake_make_context_notable_s = macro_f_string_static_t_initialize(FAKE_make_context_notable_s, 0, FAKE_make_context_notable_s_length); + const f_string_static_t fake_make_context_important_s = macro_f_string_static_t_initialize(FAKE_make_context_important_s, 0, FAKE_make_context_important_s_length); + const f_string_static_t fake_make_context_standout_s = macro_f_string_static_t_initialize(FAKE_make_context_standout_s, 0, FAKE_make_context_standout_s_length); + const f_string_static_t fake_make_context_success_s = macro_f_string_static_t_initialize(FAKE_make_context_success_s, 0, FAKE_make_context_success_s_length); + const f_string_static_t fake_make_context_normal_s = macro_f_string_static_t_initialize(FAKE_make_context_normal_s, 0, FAKE_make_context_normal_s_length); #endif // _di_fake_make_context_ #ifndef _di_fake_file_data_build_strings_ - const f_string_static_t fake_file_data_build_process_post_s = macro_f_string_static_t_initialize2(FAKE_file_data_build_process_post_s, 0, FAKE_file_data_build_process_post_s_length); - const f_string_static_t fake_file_data_build_process_pre_s = macro_f_string_static_t_initialize2(FAKE_file_data_build_process_pre_s, 0, FAKE_file_data_build_process_pre_s_length); + const f_string_static_t fake_file_data_build_process_post_s = macro_f_string_static_t_initialize(FAKE_file_data_build_process_post_s, 0, FAKE_file_data_build_process_post_s_length); + const f_string_static_t fake_file_data_build_process_pre_s = macro_f_string_static_t_initialize(FAKE_file_data_build_process_pre_s, 0, FAKE_file_data_build_process_pre_s_length); #endif // _di_fake_file_data_build_strings_ #ifndef _di_fake_signal_received_ diff --git a/level_3/fake/c/private-common.h b/level_3/fake/c/private-common.h index 00d6015..d9ca21e 100644 --- a/level_3/fake/c/private-common.h +++ b/level_3/fake/c/private-common.h @@ -617,6 +617,9 @@ extern "C" { * - large: An allocation step used for buffers that are anticipated to have large buffers. * - small: An allocation step used for buffers that are anticipated to have small buffers. * + * fake_common_file_*: + * - directory_copy: A string referring to a file directory copy operation. + * * fake_common_setting_bool_*: * - yes: A representation of yes or true. * - no: A representation of no or false. @@ -628,18 +631,37 @@ extern "C" { #define fake_common_allocation_large_d 256 #define fake_common_allocation_small_d 16 + #define FAKE_common_file_directory_copy_s "copy directory" + #define FAKE_common_file_path_change_to_s "change path to" + #define FAKE_common_file_path_determine_real_s "determine real path of" + #define FAKE_common_file_path_stack_s "path stack" + #define FAKE_common_file_populate_pre_s "pre-populate" + #define FAKE_common_setting_bool_yes_s "yes" #define FAKE_common_setting_bool_no_s "no" #define FAKE_common_setting_list_s "list" + #define FAKE_common_file_directory_copy_s_length 14 + #define FAKE_common_file_path_change_to_s_length 14 + #define FAKE_common_file_path_determine_real_s_length 22 + #define FAKE_common_file_path_stack_s_length 10 + #define FAKE_common_file_populate_pre_s_length 12 + #define FAKE_common_setting_bool_yes_s_length 3 #define FAKE_common_setting_bool_no_s_length 2 #define FAKE_common_setting_list_s_length 4 + extern const f_string_static_t fake_common_file_directory_copy_s; + extern const f_string_static_t fake_common_file_path_change_to_s; + extern const f_string_static_t fake_common_file_path_determine_real_s; + extern const f_string_static_t fake_common_file_path_stack_s; + extern const f_string_static_t fake_common_file_populate_pre_s; + extern const f_string_static_t fake_common_setting_bool_yes_s; extern const f_string_static_t fake_common_setting_bool_no_s; + extern const f_string_static_t fake_common_setting_list_s; #define fake_common_initial_buffer_max_d 131072 // 128k max default initial buffer size. @@ -1010,6 +1032,30 @@ extern "C" { #define FAKE_make_parameter_variable_verbosity_s "verbosity" #define FAKE_make_parameter_variable_work_s "work" + #define FAKE_make_parameter_variable_option_build_s FAKE_make_parameter_variable_build_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_color_s FAKE_make_parameter_variable_color_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_data_s FAKE_make_parameter_variable_data_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_define_s FAKE_make_parameter_variable_define_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_fakefile_s FAKE_make_parameter_variable_fakefile_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_mode_s FAKE_make_parameter_variable_mode_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_process_s FAKE_make_parameter_variable_process_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_settings_s FAKE_make_parameter_variable_settings_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_sources_s FAKE_make_parameter_variable_sources_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_verbosity_s FAKE_make_parameter_variable_verbosity_s FAKE_make_parameter_iki_option_s + #define FAKE_make_parameter_variable_option_work_s FAKE_make_parameter_variable_work_s FAKE_make_parameter_iki_option_s + + #define FAKE_make_parameter_variable_value_build_s FAKE_make_parameter_variable_build_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_color_s FAKE_make_parameter_variable_color_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_data_s FAKE_make_parameter_variable_data_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_define_s FAKE_make_parameter_variable_define_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_fakefile_s FAKE_make_parameter_variable_fakefile_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_mode_s FAKE_make_parameter_variable_mode_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_process_s FAKE_make_parameter_variable_process_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_settings_s FAKE_make_parameter_variable_settings_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_sources_s FAKE_make_parameter_variable_sources_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_verbosity_s FAKE_make_parameter_variable_verbosity_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_variable_value_work_s FAKE_make_parameter_variable_work_s FAKE_make_parameter_iki_value_s + #define FAKE_make_parameter_iki_option_s_length 7 #define FAKE_make_parameter_iki_value_s_length 6 @@ -1026,6 +1072,30 @@ extern "C" { #define FAKE_make_parameter_variable_verbosity_s_length 9 #define FAKE_make_parameter_variable_work_s_length 4 + #define FAKE_make_parameter_variable_option_build_s_length FAKE_make_parameter_variable_build_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_color_s_length FAKE_make_parameter_variable_color_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_data_s_length FAKE_make_parameter_variable_data_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_define_s_length FAKE_make_parameter_variable_define_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_fakefile_s_length FAKE_make_parameter_variable_fakefile_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_mode_s_length FAKE_make_parameter_variable_mode_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_process_s_length FAKE_make_parameter_variable_process_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_settings_s_length FAKE_make_parameter_variable_settings_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_sources_s_length FAKE_make_parameter_variable_sources_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_verbosity_s_length FAKE_make_parameter_variable_verbosity_s_length + FAKE_make_parameter_iki_option_s_length + #define FAKE_make_parameter_variable_option_work_s_length FAKE_make_parameter_variable_work_s_length + FAKE_make_parameter_iki_option_s_length + + #define FAKE_make_parameter_variable_value_build_s_length FAKE_make_parameter_variable_build_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_color_s_length FAKE_make_parameter_variable_color_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_data_s_length FAKE_make_parameter_variable_data_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_define_s_length FAKE_make_parameter_variable_define_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_fakefile_s_length FAKE_make_parameter_variable_fakefile_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_mode_s_length FAKE_make_parameter_variable_mode_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_process_s_length FAKE_make_parameter_variable_process_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_settings_s_length FAKE_make_parameter_variable_settings_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_sources_s_length FAKE_make_parameter_variable_sources_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_verbosity_s_length FAKE_make_parameter_variable_verbosity_s_length + FAKE_make_parameter_iki_value_s_length + #define FAKE_make_parameter_variable_value_work_s_length FAKE_make_parameter_variable_work_s_length + FAKE_make_parameter_iki_value_s_length + extern const f_string_static_t fake_make_parameter_iki_option_s; extern const f_string_static_t fake_make_parameter_iki_value_s; diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index 492be6e..7baaa9b 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -46,7 +46,7 @@ extern "C" { fl_execute_parameter_t parameter = macro_fl_execute_parameter_t_initialize(0, 0, &environment, &signals, 0); - *status = fll_execute_program(program.string, arguments, ¶meter, 0, (void *) &return_code); + *status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); if (fake_signal_received(main)) { *status = F_status_set_error(F_interrupt); @@ -89,7 +89,7 @@ extern "C" { #endif // _di_fake_execute_ #ifndef _di_fake_file_buffer_ - f_status_t fake_file_buffer(fake_main_t * const main, const f_string_t path_file, f_string_dynamic_t *buffer) { + f_status_t fake_file_buffer(fake_main_t * const main, const f_string_static_t path_file, f_string_dynamic_t *buffer) { f_file_t file = f_file_t_initialize; f_string_t name_function = "f_file_exists"; @@ -99,14 +99,14 @@ extern "C" { return F_status_set_error(F_interrupt); } - status = f_file_exists(path_file); + status = f_file_exists(path_file.string); if (status == F_true) { { f_array_length_t size_file = 0; name_function = "f_file_size"; - status = f_file_size(path_file, F_true, &size_file); + status = f_file_size(path_file.string, F_true, &size_file); if (F_status_is_error_not(status)) { if (size_file > fake_common_initial_buffer_max_d) { @@ -191,19 +191,19 @@ extern "C" { for (uint8_t i = 0; i < 3; ++i) { - if (main->parameters[parameters_id[i]].result == f_console_result_found_e) { + if (main->parameters.array[parameters_id[i]].result == f_console_result_found_e) { fake_print_error_parameter_missing_value(main, parameters_name[i]); return F_status_set_error(F_parameter); } - else if (main->parameters[parameters_id[i]].result == f_console_result_additional_e) { - if (main->parameters[parameters_id[i]].locations.used > 1) { + else if (main->parameters.array[parameters_id[i]].result == f_console_result_additional_e) { + if (main->parameters.array[parameters_id[i]].locations.used > 1) { fake_print_error_parameter_too_many(main, parameters_name[i]); return F_status_set_error(F_parameter); } - f_array_length_t location = main->parameters[parameters_id[i]].values.array[0]; + f_array_length_t location = main->parameters.array[parameters_id[i]].values.array[0]; f_array_length_t length = strnlen(arguments->argv[location], F_console_parameter_size_d); if (length > 0) { @@ -300,7 +300,7 @@ extern "C" { } // for } - if (main->parameters[fake_parameter_define_e].result == f_console_result_found_e) { + if (main->parameters.array[fake_parameter_define_e].result == f_console_result_found_e) { fake_print_error_parameter_missing_value(main, fake_long_define_s); return F_status_set_error(F_parameter); @@ -337,19 +337,19 @@ extern "C" { for (uint8_t i = 0; i < 4; ++i) { - if (main->parameters[parameters_id[i]].result == f_console_result_found_e) { + if (main->parameters.array[parameters_id[i]].result == f_console_result_found_e) { fake_print_error_parameter_missing_value(main, parameters_name[i]); return F_status_set_error(F_parameter); } - else if (main->parameters[parameters_id[i]].result == f_console_result_additional_e) { - if (main->parameters[parameters_id[i]].values.used > 1) { + else if (main->parameters.array[parameters_id[i]].result == f_console_result_additional_e) { + if (main->parameters.array[parameters_id[i]].values.used > 1) { fake_print_error_parameter_too_many(main, parameters_name[i]); return F_status_set_error(F_parameter); } - status = fl_console_parameter_to_string_dynamic_directory(arguments->argv[main->parameters[parameters_id[i]].values.array[0]], parameters_value[i]); + status = fl_console_parameter_to_string_dynamic_directory(arguments->argv[main->parameters.array[parameters_id[i]].values.array[0]], parameters_value[i]); if (F_status_is_error(status)) { if (fll_error_print(main->error, F_status_set_fine(status), "fl_console_parameter_to_string_dynamic_directory", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) { @@ -387,8 +387,8 @@ extern "C" { } // for } - if (main->parameters[fake_parameter_define_e].result == f_console_result_additional_e) { - status = fll_program_parameter_additional_rip(arguments->argv, main->parameters[fake_parameter_define_e].values, &main->define); + if (main->parameters.array[fake_parameter_define_e].result == f_console_result_additional_e) { + status = fll_program_parameter_additional_rip(arguments->argv, main->parameters.array[fake_parameter_define_e].values, &main->define); if (F_status_is_error(status)) { if (fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) { @@ -405,12 +405,12 @@ extern "C" { } } - if (main->parameters[fake_parameter_mode_e].result == f_console_result_found_e) { + if (main->parameters.array[fake_parameter_mode_e].result == f_console_result_found_e) { fake_print_error_parameter_missing_value(main, fake_long_mode_s); return F_status_set_error(F_parameter); } - else if (main->parameters[fake_parameter_mode_e].result == f_console_result_additional_e) { - status = fll_program_parameter_additional_rip(arguments->argv, main->parameters[fake_parameter_mode_e].values, &main->mode); + else if (main->parameters.array[fake_parameter_mode_e].result == f_console_result_additional_e) { + status = fll_program_parameter_additional_rip(arguments->argv, main->parameters.array[fake_parameter_mode_e].values, &main->mode); if (F_status_is_error(status)) { if (fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) { diff --git a/level_3/fake/c/private-fake.h b/level_3/fake/c/private-fake.h index 2ef5091..fe6095d 100644 --- a/level_3/fake/c/private-fake.h +++ b/level_3/fake/c/private-fake.h @@ -56,7 +56,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_file_buffer_ - extern f_status_t fake_file_buffer(fake_main_t * const main, const f_string_t path_file, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; + extern f_status_t fake_file_buffer(fake_main_t * const main, const f_string_static_t path_file, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; #endif // _di_fake_file_buffer_ /** diff --git a/level_3/fake/c/private-make-load_parameters.c b/level_3/fake/c/private-make-load_parameters.c index c8d1f33..5813c63 100644 --- a/level_3/fake/c/private-make-load_parameters.c +++ b/level_3/fake/c/private-make-load_parameters.c @@ -31,10 +31,10 @@ extern "C" { } if (data_make->main->context.mode == F_color_mode_no_color_d) { - if (data_make->main->parameters[fake_parameter_no_color_e].type == f_console_type_normal_e) { + if (data_make->main->parameters.array[fake_parameter_no_color_e].type == f_console_type_normal_e) { *status = f_string_dynamic_append(f_console_symbol_short_enable_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } - else if (data_make->main->parameters[fake_parameter_no_color_e].type == f_console_type_inverse_e) { + else if (data_make->main->parameters.array[fake_parameter_no_color_e].type == f_console_type_inverse_e) { *status = f_string_dynamic_append(f_console_symbol_short_disable_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } @@ -43,10 +43,10 @@ extern "C" { } } else if (data_make->main->context.mode == F_color_mode_dark_d) { - if (data_make->main->parameters[fake_parameter_dark_e].type == f_console_type_normal_e) { + if (data_make->main->parameters.array[fake_parameter_dark_e].type == f_console_type_normal_e) { *status = f_string_dynamic_append(f_console_symbol_short_enable_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } - else if (data_make->main->parameters[fake_parameter_dark_e].type == f_console_type_inverse_e) { + else if (data_make->main->parameters.array[fake_parameter_dark_e].type == f_console_type_inverse_e) { *status = f_string_dynamic_append(f_console_symbol_short_disable_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } @@ -55,10 +55,10 @@ extern "C" { } } else { - if (data_make->main->parameters[fake_parameter_light_e].type == f_console_type_normal_e) { + if (data_make->main->parameters.array[fake_parameter_light_e].type == f_console_type_normal_e) { *status = f_string_dynamic_append(f_console_symbol_short_enable_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } - else if (data_make->main->parameters[fake_parameter_light_e].type == f_console_type_inverse_e) { + else if (data_make->main->parameters.array[fake_parameter_light_e].type == f_console_type_inverse_e) { *status = f_string_dynamic_append(f_console_symbol_short_disable_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } @@ -95,10 +95,10 @@ extern "C" { } if (data_make->main->error.verbosity == f_console_verbosity_quiet_e) { - if (data_make->main->parameters[fake_parameter_verbosity_quiet_e].type == f_console_type_normal_e) { + if (data_make->main->parameters.array[fake_parameter_verbosity_quiet_e].type == f_console_type_normal_e) { *status = f_string_dynamic_append(f_console_symbol_short_enable_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } - else if (data_make->main->parameters[fake_parameter_verbosity_quiet_e].type == f_console_type_inverse_e) { + else if (data_make->main->parameters.array[fake_parameter_verbosity_quiet_e].type == f_console_type_inverse_e) { *status = f_string_dynamic_append(f_console_symbol_short_disable_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } @@ -107,10 +107,10 @@ extern "C" { } } else if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) { - if (data_make->main->parameters[fake_parameter_verbosity_verbose_e].type == f_console_type_normal_e) { + if (data_make->main->parameters.array[fake_parameter_verbosity_verbose_e].type == f_console_type_normal_e) { *status = f_string_dynamic_append(f_console_symbol_short_enable_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } - else if (data_make->main->parameters[fake_parameter_verbosity_verbose_e].type == f_console_type_inverse_e) { + else if (data_make->main->parameters.array[fake_parameter_verbosity_verbose_e].type == f_console_type_inverse_e) { *status = f_string_dynamic_append(f_console_symbol_short_disable_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } @@ -119,10 +119,10 @@ extern "C" { } } else { - if (data_make->main->parameters[fake_parameter_verbosity_debug_e].type == f_console_type_normal_e) { + if (data_make->main->parameters.array[fake_parameter_verbosity_debug_e].type == f_console_type_normal_e) { *status = f_string_dynamic_append(f_console_symbol_short_enable_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } - else if (data_make->main->parameters[fake_parameter_verbosity_debug_e].type == f_console_type_inverse_e) { + else if (data_make->main->parameters.array[fake_parameter_verbosity_debug_e].type == f_console_type_inverse_e) { *status = f_string_dynamic_append(f_console_symbol_short_disable_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } @@ -152,8 +152,8 @@ extern "C" { }; const f_console_parameter_t *console[] = { - &data_make->main->parameters[fake_parameter_define_e], - &data_make->main->parameters[fake_parameter_mode_e], + &data_make->main->parameters.array[fake_parameter_define_e], + &data_make->main->parameters.array[fake_parameter_mode_e], }; const f_string_dynamics_t *source[] = { @@ -271,13 +271,13 @@ extern "C" { }; const f_console_parameter_t *console[] = { - &data_make->main->parameters[fake_parameter_fakefile_e], - &data_make->main->parameters[fake_parameter_path_build_e], - &data_make->main->parameters[fake_parameter_path_data_e], - &data_make->main->parameters[fake_parameter_path_sources_e], - &data_make->main->parameters[fake_parameter_path_work_e], - &data_make->main->parameters[fake_parameter_process_e], - &data_make->main->parameters[fake_parameter_settings_e], + &data_make->main->parameters.array[fake_parameter_fakefile_e], + &data_make->main->parameters.array[fake_parameter_path_build_e], + &data_make->main->parameters.array[fake_parameter_path_data_e], + &data_make->main->parameters.array[fake_parameter_path_sources_e], + &data_make->main->parameters.array[fake_parameter_path_work_e], + &data_make->main->parameters.array[fake_parameter_process_e], + &data_make->main->parameters.array[fake_parameter_settings_e], }; const f_string_dynamic_t *source[] = { diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index 10b3408..b4f4a44 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -152,9 +152,9 @@ extern "C" { return; } - const f_string_static_t vocabulary_context = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_context_s, F_iki_vocabulary_0002_context_s_length); - const f_string_static_t vocabulary_define = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_define_s, F_iki_vocabulary_0002_define_s_length); - const f_string_static_t vocabulary_parameter = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_parameter_s, F_iki_vocabulary_0002_parameter_s_length); + const f_string_static_t vocabulary_context = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_context_s, F_iki_vocabulary_0002_context_s_length); + const f_string_static_t vocabulary_define = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_define_s, F_iki_vocabulary_0002_define_s_length); + const f_string_static_t vocabulary_parameter = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_parameter_s, F_iki_vocabulary_0002_parameter_s_length); const f_string_range_t range_context = macro_f_string_range_t_initialize(F_iki_vocabulary_0002_context_s_length); const f_string_range_t range_define = macro_f_string_range_t_initialize(F_iki_vocabulary_0002_define_s_length); diff --git a/level_3/fake/c/private-make-operate_process.c b/level_3/fake/c/private-make-operate_process.c index 9c79cc4..ca8b6a5 100644 --- a/level_3/fake/c/private-make-operate_process.c +++ b/level_3/fake/c/private-make-operate_process.c @@ -155,10 +155,10 @@ extern "C" { if (state_process->operation == fake_make_operation_type_define_e) { if (arguments.used > 1) { - *status = f_environment_set(arguments.array[0].string, arguments.array[1].string, F_true); + *status = f_environment_set(arguments.array[0], arguments.array[1], F_true); } else { - *status = f_environment_set(arguments.array[0].string, f_string_empty_s.string, F_true); + *status = f_environment_set(arguments.array[0], f_string_empty_s, F_true); } if (F_status_is_error(*status)) { @@ -559,7 +559,7 @@ extern "C" { fl_execute_parameter_t parameter = macro_fl_execute_parameter_t_initialize(as_shell ? 0 : FL_execute_parameter_option_path_d, 0, &data_make->environment, &signals, 0); - status = fll_execute_program(program.string, arguments, ¶meter, 0, (void *) &return_code); + status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); if (fake_signal_received(data_make->main)) { return F_status_set_error(F_interrupt); diff --git a/level_3/fake/c/private-make-operate_process_type.c b/level_3/fake/c/private-make-operate_process_type.c index 02fb628..6bc7365 100644 --- a/level_3/fake/c/private-make-operate_process_type.c +++ b/level_3/fake/c/private-make-operate_process_type.c @@ -282,7 +282,7 @@ extern "C" { if (F_status_is_error(status_file)) { status = status_file; - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]); continue; } @@ -366,17 +366,17 @@ extern "C" { data_make->main->path_sources.used, F_true, data_make->main->path_work.used, - data_make->main->parameters[fake_parameter_path_build_e].result == f_console_result_additional_e, - data_make->main->parameters[fake_parameter_light_e].result == f_console_result_found_e || data_make->main->parameters[fake_parameter_dark_e].result == f_console_result_found_e || data_make->main->parameters[fake_parameter_no_color_e].result == f_console_result_found_e, - data_make->main->parameters[fake_parameter_path_data_e].result == f_console_result_additional_e, - data_make->main->parameters[fake_parameter_define_e].result == f_console_result_additional_e, - data_make->main->parameters[fake_parameter_fakefile_e].result == f_console_result_additional_e, - data_make->main->parameters[fake_parameter_mode_e].result == f_console_result_additional_e, - data_make->main->parameters[fake_parameter_process_e].result == f_console_result_additional_e, - data_make->main->parameters[fake_parameter_settings_e].result == f_console_result_additional_e, - data_make->main->parameters[fake_parameter_path_sources_e].result == f_console_result_additional_e, - data_make->main->parameters[fake_parameter_verbosity_quiet_e].result == f_console_result_found_e || data_make->main->parameters[fake_parameter_verbosity_normal_e].result == f_console_result_found_e || data_make->main->parameters[fake_parameter_verbosity_verbose_e].result == f_console_result_found_e || data_make->main->parameters[fake_parameter_verbosity_debug_e].result == f_console_result_found_e, - data_make->main->parameters[fake_parameter_path_work_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_path_build_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_light_e].result == f_console_result_found_e || data_make->main->parameters.array[fake_parameter_dark_e].result == f_console_result_found_e || data_make->main->parameters.array[fake_parameter_no_color_e].result == f_console_result_found_e, + data_make->main->parameters.array[fake_parameter_path_data_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_define_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_fakefile_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_mode_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_process_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_settings_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_path_sources_e].result == f_console_result_additional_e, + data_make->main->parameters.array[fake_parameter_verbosity_quiet_e].result == f_console_result_found_e || data_make->main->parameters.array[fake_parameter_verbosity_normal_e].result == f_console_result_found_e || data_make->main->parameters.array[fake_parameter_verbosity_verbose_e].result == f_console_result_found_e || data_make->main->parameters.array[fake_parameter_verbosity_debug_e].result == f_console_result_found_e, + data_make->main->parameters.array[fake_parameter_path_work_e].result == f_console_result_additional_e, data_make->parameter_value.build.used, data_make->parameter_value.color.used, data_make->parameter_value.data.used, @@ -396,7 +396,7 @@ extern "C" { if (if_not) { for (f_array_length_t i = 3; i < arguments.used; ++i) { - if (f_environment_exists(arguments.array[i].string) == F_true) { + if (f_environment_exists(arguments.array[i]) == F_true) { state_process->condition_result = fake_condition_result_false_e; break; @@ -406,7 +406,7 @@ extern "C" { else { for (f_array_length_t i = 2; i < arguments.used; ++i) { - if (f_environment_exists(arguments.array[i].string) != F_true) { + if (f_environment_exists(arguments.array[i].) != F_true) { state_process->condition_result = fake_condition_result_false_e; break; @@ -487,7 +487,7 @@ extern "C" { if (F_status_is_error(status)) { state_process->condition_result = fake_condition_result_error_e; - fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_exists", F_true, arguments.array[i].string, "find", fll_error_file_type_file_e); + fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_exists", F_true, arguments.array[i].string, f_file_operation_find_s, fll_error_file_type_file_e); break; } @@ -1100,7 +1100,7 @@ extern "C" { if (F_status_is_error(status_file)) { status = status_file; - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]); continue; } @@ -1236,7 +1236,7 @@ extern "C" { status = f_path_change(data_make->path.stack.array[data_make->path.stack.used - 1].string); if (F_status_is_error(status)) { - fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", data_make->path.stack.array[data_make->path.stack.used - 1].string); + fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", data_make->path.stack.array[data_make->path.stack.used - 1]); return 0; } @@ -1266,7 +1266,7 @@ extern "C" { status = fake_make_assure_inside_project(data_make, arguments.array[0]); if (F_status_is_error(status)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[0].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[0]); if (F_status_set_fine(status) == F_false) { status = F_status_set_error(F_failure); @@ -1278,13 +1278,13 @@ extern "C" { status = f_path_change(arguments.array[0].string); if (F_status_is_error(status)) { - fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", arguments.array[0].string); + fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", arguments.array[0]); } else { status = f_string_dynamics_increase_by(F_memory_default_allocation_small_d, &data_make->path.stack); if (F_status_set_fine(status) == F_array_too_large) { - fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_array_too_large, "f_string_dynamics_increase_by", "path stack"); + fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_array_too_large, "f_string_dynamics_increase_by", fake_common_file_path_stack_s_length); return status; } @@ -1335,7 +1335,7 @@ extern "C" { status = f_path_change_at(data_make->path.top.id); if (F_status_is_error(status)) { - fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", arguments.array[0].string); + fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", arguments.array[0]); return status; } diff --git a/level_3/fake/c/private-make-operate_validate.c b/level_3/fake/c/private-make-operate_validate.c index b094001..21f655b 100644 --- a/level_3/fake/c/private-make-operate_validate.c +++ b/level_3/fake/c/private-make-operate_validate.c @@ -102,7 +102,7 @@ extern "C" { *status = F_status_set_error(status_file); } else if (F_status_is_error(status_file)) { - fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_file_is", F_true, path_file, "find", fll_error_file_type_file_e); + fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_file_is", F_true, path_file, f_file_operation_find_s, fll_error_file_type_file_e); *status = status_file; } else if (!status_file) { @@ -158,7 +158,7 @@ extern "C" { *status = fake_make_assure_inside_project(data_make, arguments.array[i]); if (F_status_is_error(*status)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]); if (F_status_set_fine(*status) == F_false) { *status = F_status_set_error(F_failure); @@ -202,7 +202,7 @@ extern "C" { *status = F_status_set_error(F_failure); } else if (F_status_is_error(status_file)) { - fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[arguments.used - 1].string, "find", fll_error_file_type_directory_e); + fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[arguments.used - 1].string, f_file_operation_find_s, fll_error_file_type_directory_e); *status = F_status_set_error(F_failure); } } @@ -269,7 +269,7 @@ extern "C" { *status = fake_make_assure_inside_project(data_make, arguments.array[i]); if (F_status_is_error(*status)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]); if (F_status_set_fine(*status) == F_false) { *status = F_status_set_error(F_failure); @@ -391,7 +391,7 @@ extern "C" { *status = fake_make_assure_inside_project(data_make, arguments.array[i]); if (F_status_is_error(*status)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]); if (F_status_set_fine(*status) == F_false) { *status = F_status_set_error(F_failure); @@ -549,7 +549,7 @@ extern "C" { } else if (F_status_is_error(status_file)) { if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) { - fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, arguments.array[i].string, "find", fll_error_file_type_directory_e); + fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, arguments.array[i].string, f_file_operation_find_s, fll_error_file_type_directory_e); } *status = status_file; @@ -949,7 +949,7 @@ extern "C" { status_file = fake_make_assure_inside_project(data_make, arguments.array[i]); if (F_status_is_error(status_file)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status_file), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status_file), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]); if (F_status_is_error_not(*status)) { if (F_status_set_fine(status_file) == F_false) { @@ -970,7 +970,7 @@ extern "C" { } if (F_status_is_error(status_file)) { - fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_file_exists", F_true, arguments.array[i].string, "find", fll_error_file_type_file_e); + fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_file_exists", F_true, arguments.array[i].string, f_file_operation_find_s, fll_error_file_type_file_e); if (F_status_is_error_not(*status)) { *status = F_status_set_error(status_file); @@ -1064,7 +1064,7 @@ extern "C" { *status = fake_make_assure_inside_project(data_make, arguments.array[0]); if (F_status_is_error(*status)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[0].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[0]); if (F_status_set_fine(*status) == F_false) { *status = F_status_set_error(F_failure); @@ -1074,7 +1074,7 @@ extern "C" { *status = fake_make_assure_inside_project(data_make, arguments.array[1]); if (F_status_is_error(*status)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[1].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[1]); if (F_status_set_fine(*status) == F_false) { *status = F_status_set_error(F_failure); @@ -1097,7 +1097,7 @@ extern "C" { *status = fake_make_assure_inside_project(data_make, arguments.array[i]); if (F_status_is_error(*status)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]); if (F_status_set_fine(*status) == F_false) { *status = F_status_set_error(F_failure); @@ -1315,7 +1315,7 @@ extern "C" { } else if (F_status_is_error(status_file)) { if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) { - fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, data_make->main->file_data_build_fakefile.string, "find", fll_error_file_type_file_e); + fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, data_make->main->file_data_build_fakefile.string, f_file_operation_find_s, fll_error_file_type_file_e); } *status = status_file; @@ -1373,7 +1373,7 @@ extern "C" { *status = fake_make_assure_inside_project(data_make, arguments.array[i]); if (F_status_is_error(*status)) { - fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string); + fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]); if (F_status_set_fine(*status) == F_false) { *status = F_status_set_error(F_failure); diff --git a/level_3/fake/c/private-print.c b/level_3/fake/c/private-print.c index 72223b3..86a0b3f 100644 --- a/level_3/fake/c/private-print.c +++ b/level_3/fake/c/private-print.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fake_print_error_build_operation_file_ - bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_static_t operation, const f_string_t how, const f_string_t source, const f_string_t destination, const bool fallback) { + bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) { if (status == F_file_found_not) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -19,20 +19,7 @@ extern "C" { fl_print_format("%q%[%QFailed to find '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, f_file_exists(source) == F_true ? destination : source, main->error.notable); - } - - fl_print_format("%[while trying to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context); - - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -50,14 +37,7 @@ extern "C" { fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, function, main->error.notable); fl_print_format("%[() to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -73,13 +53,13 @@ extern "C" { fl_print_format("%q%[%QInvalid name for '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); + if (source.used) { + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, source, main->error.notable); } - if (destination) { + if (destination.used) { fl_print_format("%[' or '%]", main->error.to.stream, main->error.context, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, destination, main->error.notable); } fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -96,14 +76,7 @@ extern "C" { fl_print_format("%q%[%QUnable to allocate memory, while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -119,14 +92,7 @@ extern "C" { fl_print_format("%q%[%QOverflow while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -142,14 +108,7 @@ extern "C" { fl_print_format("%q%[%QInvalid directory while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -165,14 +124,7 @@ extern "C" { fl_print_format("%q%[%QAccess denied while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -188,14 +140,7 @@ extern "C" { fl_print_format("%q%[%QLoop while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -211,14 +156,7 @@ extern "C" { fl_print_format("%q%[%QProhibited by system while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -234,14 +172,7 @@ extern "C" { fl_print_format("%q%[%QFailed to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%[' due to an invalid directory in the path.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -257,14 +188,7 @@ extern "C" { fl_print_format("%q%[%QFailed to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -281,14 +205,7 @@ extern "C" { fl_print_format("%[%ui%]", main->error.to.stream, main->error.notable, status, main->error.notable); fl_print_format("%[) occurred while trying to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context); - if (source) { - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable); - } - - if (destination) { - fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, destination, main->error.notable); - } + fake_print_error_build_operation_file_message(main, operation, source, destination, how); fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -299,6 +216,25 @@ extern "C" { } #endif // _di_fake_print_error_build_operation_file_ +#ifndef _di_fake_print_error_build_operation_file_message_ + void fake_print_error_build_operation_file_message(fake_main_t * const main, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how) { + + if (source.used) { + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, source, main->error.notable); + } + + fl_print_format("%[while trying to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context); + + if (destination.used) { + fl_print_format("%[' %Q '%]", main->error.to.stream, main->error.context, how, main->error.context); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, destination, main->error.notable); + } + else if (source.used) { + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, source, main->error.notable); + } + } +#endif // #ifndef _di_fake_print_error_build_operation_file_message_ + #ifndef _di_fake_print_error_fss bool fake_print_error_fss(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_t path_file, const f_string_range_t range, const bool fallback) { @@ -309,7 +245,7 @@ extern "C" { fl_print_format("%q%[%QOccurred on invalid UTF-8 character at stop position (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable); fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); fl_print_format("%[').%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); funlockfile(main->error.to.stream); @@ -325,7 +261,7 @@ extern "C" { fl_print_format("%q%[%QOccurred on invalid UTF-8 character at %s (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, status == F_complete_not_utf_eos ? "end of string" : "stop point of string", main->error.context); fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable); fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); fl_print_format("%[').%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); funlockfile(main->error.to.stream); @@ -341,7 +277,7 @@ extern "C" { fl_print_format("%q%[%QOccurred on invalid UTF-8 character at stop point of string (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable); fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable); fl_print_format("%[').%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); funlockfile(main->error.to.stream); @@ -356,7 +292,7 @@ extern "C" { fl_print_format("%q%[UNKNOWN %Q(%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); fl_print_format("%[%ui%]", main->error.to.stream, main->error.notable, status, main->error.notable); fl_print_format("%[) in function '%]", main->error.to.stream, main->error.context, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, function, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, function, main->error.notable); fl_print_format("%[().%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); funlockfile(main->error.to.stream); @@ -440,7 +376,7 @@ extern "C" { #endif // _di_fake_print_message_section_operation_failed_ #ifndef _di_fake_print_message_section_operation_path_outside_ - void fake_print_message_section_operation_path_outside(fake_main_t * const main, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_t path) { + void fake_print_message_section_operation_path_outside(fake_main_t * const main, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path) { if (main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return; @@ -448,11 +384,11 @@ extern "C" { if (F_status_set_fine(status) == F_false) { fl_print_format("%q%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable); fl_print_format("%[' is outside the project root.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); } else { - fll_error_file_print(main->error, F_status_set_fine(status), function, F_true, path, "determine real path of", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), function, F_true, path, fake_common_file_path_determine_real_s, fll_error_file_type_file_e); } funlockfile(main->error.to.stream); @@ -460,7 +396,7 @@ extern "C" { #endif // _di_fake_print_message_section_operation_path_outside_ #ifndef _di_fake_print_message_section_operation_path_stack_max_ - void fake_print_message_section_operation_path_stack_max(fake_main_t * const main, fl_print_t print, const f_status_t status, const f_string_t function, const f_string_t path) { + void fake_print_message_section_operation_path_stack_max(fake_main_t * const main, fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path) { if (main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return; @@ -468,7 +404,7 @@ extern "C" { flockfile(main->error.to.stream); fl_print_format("%q%[%QMaximum stack size reached while processing path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path, main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable); fl_print_format("%['", main->error.to.stream, main->error.context); if (function) { @@ -481,7 +417,7 @@ extern "C" { funlockfile(main->error.to.stream); } else { - fll_error_file_print(print, status, function, F_true, path, "change path to", fll_error_file_type_directory_e); + fll_error_file_print(print, status, function, F_true, path, fake_common_file_path_change_to_s, fll_error_file_type_directory_e); } } #endif // _di_fake_print_message_section_operation_path_stack_max_ @@ -522,7 +458,7 @@ extern "C" { flockfile(main->error.to.stream); - fl_print_format("%q%[%SThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); + fl_print_format("%q%[%QThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, operation_name, main->error.notable); fl_print_format("%[' from section '%]", main->error.to.stream, main->error.context, buffer, main->error.context); fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, section_name, main->error.notable); diff --git a/level_3/fake/c/private-print.h b/level_3/fake/c/private-print.h index 4543084..b284235 100644 --- a/level_3/fake/c/private-print.h +++ b/level_3/fake/c/private-print.h @@ -25,14 +25,11 @@ extern "C" { * The operation performed. * @param source * The operation source. - * Set to 0 to disable. * @param destination * The operation destination, if applicable. - * Requires source to be non-zero. - * Set to 0 to disable. + * Set destination.used to 0 to disable. * @param how * The how the operation is perform, such as "to" in "copy" source "to" destination. - * Requires source and destination to be non-zero. * @param fallback * Set to F_true to print the fallback error message for unknown errors. * @@ -44,12 +41,39 @@ extern "C" { * @see funlockfile() * * @see fl_print_format() + * + * @see fake_print_error_build_operation_file_message(); */ #ifndef _di_fake_print_error_operation_file_ - extern bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_static_t operation, const f_string_t source, const f_string_t destination, const f_string_t how, const bool fallback) F_attribute_visibility_internal_d; + extern bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) F_attribute_visibility_internal_d; #endif // _di_fake_print_error_operation_file_ /** + * Helper function for printing build operation file error messages. + * + * This prints the "copy source to destination" part of the message. + * + * @param main + * The main program data. + * @param operation + * The operation performed. + * @param source + * The operation source. + * @param destination + * The operation destination, if applicable. + * Set destination.used to 0 to disable. + * @param how + * The how the operation is perform, such as "to" in "copy" source "to" destination. + * + * @see fl_print_format() + * + * @see fake_print_error_build_operation_file() + */ +#ifndef _di_fake_print_error_build_operation_file_message_ + extern void fake_print_error_build_operation_file_message(fake_main_t * const main, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how) F_attribute_visibility_internal_d; +#endif // _di_fake_print_error_build_operation_file_message_ + +/** * Print FSS error messages. * * @param main @@ -180,7 +204,7 @@ extern "C" { * @see fll_error_file_print() */ #ifndef _di_fake_print_message_section_operation_path_outside_ - extern void fake_print_message_section_operation_path_outside(fake_main_t * const main, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_t path) F_attribute_visibility_internal_d; + extern void fake_print_message_section_operation_path_outside(fake_main_t * const main, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path) F_attribute_visibility_internal_d; #endif // _fake_print_message_section_operation_path_outside_ /** @@ -205,7 +229,7 @@ extern "C" { * @see fll_error_file_print() */ #ifndef _di_fake_print_message_section_operation_path_stack_max_ - extern void fake_print_message_section_operation_path_stack_max(fake_main_t * const main, fl_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) F_attribute_visibility_internal_d; + extern void fake_print_message_section_operation_path_stack_max(fake_main_t * const main, fl_print_t error, const f_status_t status, const f_string_t function, const f_string_static_t path) F_attribute_visibility_internal_d; #endif // _di_fake_print_message_section_operation_path_stack_max_ /** diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index bcf53a8..8c1f68a 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -136,7 +136,7 @@ extern "C" { funlockfile(main->error.to.stream); } else { - fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_create", F_true, path.string, "create", fll_error_file_type_directory_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_create", F_true, path, f_file_operation_create_s, fll_error_file_type_directory_e); } return status; @@ -147,7 +147,7 @@ extern "C" { } } else if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_exists", F_true, path.string, "create", fll_error_file_type_directory_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_exists", F_true, path, f_file_operation_create_s, fll_error_file_type_directory_e); return status; } @@ -213,7 +213,7 @@ extern "C" { funlockfile(main->error.to.stream); } else { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_create", F_true, path.string, "create", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_create", F_true, path, f_file_operation_create_s, fll_error_file_type_file_e); } return status; @@ -232,7 +232,7 @@ extern "C" { status = f_file_open(path.string, 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, path.string, "pre-populate", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, path, fake_common_file_populate_pre_s, fll_error_file_type_file_e); return status; } @@ -240,7 +240,7 @@ extern "C" { status = f_file_write(file, content, 0); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_write", F_true, path.string, "pre-populate", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_write", F_true, path, fake_common_file_populate_pre_s, fll_error_file_type_file_e); f_file_stream_close(F_true, &file); return status; @@ -254,7 +254,7 @@ extern "C" { } } else if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_is", F_true, path.string, "create", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_is", F_true, path, f_file_operation_create_s, fll_error_file_type_file_e); return status; } diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index bafc08a..5a73b8c 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -13,12 +13,12 @@ extern "C" { #endif #ifndef _di_firewall_program_version_ - const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize2(FIREWALL_program_version_s, 0, FIREWALL_program_version_s_length); + const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_program_version_s, 0, FIREWALL_program_version_s_length); #endif // _di_firewall_program_version_ #ifndef _di_firewall_program_name_ - const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize2(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length); - const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize2(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length); + const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length); + const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length); #endif // _di_firewall_program_name_ #ifndef _di_firewall_print_help_ @@ -58,82 +58,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, firewall_total_parameters_d); + f_console_parameter_t parameters[] = firewall_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = firewall_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { firewall_parameter_no_color_e, firewall_parameter_light_e, firewall_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { firewall_parameter_no_color_e, firewall_parameter_light_e, firewall_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - firewall_main_delete(main); + if (F_status_is_error(status)) { + firewall_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { firewall_parameter_verbosity_quiet_e, firewall_parameter_verbosity_normal_e, firewall_parameter_verbosity_verbose_e, firewall_parameter_verbosity_debug_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - f_console_parameter_id_t choice = 0; - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { firewall_parameter_verbosity_quiet_e, firewall_parameter_verbosity_normal_e, firewall_parameter_verbosity_verbose_e, firewall_parameter_verbosity_debug_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + f_console_parameter_id_t choice = 0; - if (F_status_is_error(status)) { - firewall_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + firewall_main_delete(main); - if (choice == firewall_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == firewall_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == firewall_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == firewall_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == firewall_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == firewall_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == firewall_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == firewall_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[firewall_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[firewall_parameter_help_e].result == f_console_result_found_e) { firewall_print_help(main->output.to, main->context); firewall_main_delete(main); @@ -141,7 +143,7 @@ extern "C" { return F_none; } - if (main->parameters[firewall_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[firewall_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, firewall_version_s); firewall_main_delete(main); @@ -153,14 +155,14 @@ extern "C" { bool found_command = F_false; unsigned int command = 0; - if (main->parameters[firewall_parameter_command_start_e].result == f_console_result_found_e) { + if (main->parameters.array[firewall_parameter_command_start_e].result == f_console_result_found_e) { command = firewall_parameter_command_start_e; found_command = F_true; } - if (main->parameters[firewall_parameter_command_stop_e].result == f_console_result_found_e) { + if (main->parameters.array[firewall_parameter_command_stop_e].result == f_console_result_found_e) { if (found_command) { - if (main->parameters[command].values.array[0] > main->parameters[firewall_parameter_command_stop_e].values.array[0]) { + if (main->parameters.array[command].values.array[0] > main->parameters.array[firewall_parameter_command_stop_e].values.array[0]) { command = firewall_parameter_command_stop_e; } } @@ -170,9 +172,9 @@ extern "C" { } } - if (main->parameters[firewall_parameter_command_restart_e].result == f_console_result_found_e) { + if (main->parameters.array[firewall_parameter_command_restart_e].result == f_console_result_found_e) { if (found_command) { - if (main->parameters[command].values.array[0] > main->parameters[firewall_parameter_command_restart_e].values.array[0]) { + if (main->parameters.array[command].values.array[0] > main->parameters.array[firewall_parameter_command_restart_e].values.array[0]) { command = firewall_parameter_command_restart_e; } } @@ -182,9 +184,9 @@ extern "C" { } } - if (main->parameters[firewall_parameter_command_lock_e].result == f_console_result_found_e) { + if (main->parameters.array[firewall_parameter_command_lock_e].result == f_console_result_found_e) { if (found_command) { - if (main->parameters[command].values.array[0] > main->parameters[firewall_parameter_command_lock_e].values.array[0]) { + if (main->parameters.array[command].values.array[0] > main->parameters.array[firewall_parameter_command_lock_e].values.array[0]) { command = firewall_parameter_command_lock_e; } } @@ -194,9 +196,9 @@ extern "C" { } } - if (main->parameters[firewall_parameter_command_show_e].result == f_console_result_found_e) { + if (main->parameters.array[firewall_parameter_command_show_e].result == f_console_result_found_e) { if (found_command) { - if (main->parameters[command].values.array[0] > main->parameters[firewall_parameter_command_show_e].values.array[0]) { + if (main->parameters.array[command].values.array[0] > main->parameters.array[firewall_parameter_command_show_e].values.array[0]) { command = firewall_parameter_command_show_e; } } @@ -287,7 +289,7 @@ extern "C" { parameters.array[4].used = 9; parameters.array[5].used = 6; - status = fll_execute_program((f_string_t) firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code); + status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -318,7 +320,7 @@ extern "C" { parameters.array[4].used = 9; parameters.array[5].used = 6; - status = fll_execute_program((f_string_t) firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code); + status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -345,7 +347,7 @@ extern "C" { parameters.array[2].used = 9; parameters.array[3].used = 6; - status = fll_execute_program((f_string_t) firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code); + status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -770,12 +772,7 @@ extern "C" { #ifndef _di_firewall_main_delete_ f_status_t firewall_main_delete(firewall_main_t * const main) { - for (f_array_length_t i = 0; i < firewall_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_string_dynamics_resize(0, &main->chains); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 8f9c5ca..35e5e5f 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -302,7 +302,7 @@ extern "C" { #ifndef _di_firewall_main_t_ typedef struct { - f_console_parameter_t parameters[firewall_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -321,7 +321,7 @@ extern "C" { #define firewall_main_t_initialize \ { \ - firewall_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index a2cee60..fc93b82 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -30,7 +30,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal f_array_length_t repeat = 2; f_array_length_t r = 0; - f_string_t current_tool = firewall_tool_iptables_s; + f_string_static_t current_tool = firewall_tool_iptables_s; f_array_length_t current_tool_length = firewall_tool_iptables_s_length; f_array_length_t direction = firewall_direction_none_id_e; @@ -782,7 +782,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal firewall_print_debug_tool(main->warning, current_tool, arguments); - status = fll_execute_program((f_string_t) current_tool, arguments, 0, 0, (void *) &return_code); + status = fll_execute_program(current_tool, arguments, 0, 0, (void *) &return_code); // Immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -1142,7 +1142,7 @@ f_status_t firewall_create_custom_chains(firewall_main_t * const main, firewall_ f_status_t firewall_delete_chains(firewall_main_t * const main) { - const f_string_t tools[2] = { firewall_tool_iptables_s, firewall_tool_ip6tables_s }; + const f_string_static_t tools[2] = { firewall_tool_iptables_s, firewall_tool_ip6tables_s }; f_status_t status = F_none; for (f_array_length_t i = 0; i < 2; ++i) { diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index 399eaf6..8411abe 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -8,12 +8,12 @@ extern "C" { #endif #ifndef _di_fss_basic_list_program_version_ - const f_string_static_t fss_basic_list_program_version_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_program_version_s, 0, FSS_BASIC_LIST_program_version_s_length); + const f_string_static_t fss_basic_list_program_version_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_program_version_s, 0, FSS_BASIC_LIST_program_version_s_length); #endif // _di_fss_basic_list_program_version_ #ifndef _di_fss_basic_list_program_name_ - const f_string_static_t fss_basic_list_program_name_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_program_name_s, 0, FSS_BASIC_LIST_program_name_s_length); - const f_string_static_t fss_basic_list_program_name_long_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_program_name_long_s, 0, FSS_BASIC_LIST_program_name_long_s_length); + const f_string_static_t fss_basic_list_program_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_program_name_s, 0, FSS_BASIC_LIST_program_name_s_length); + const f_string_static_t fss_basic_list_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_program_name_long_s, 0, FSS_BASIC_LIST_program_name_long_s_length); #endif // _di_fss_basic_list_program_name_ #ifndef _di_fss_basic_list_read_print_help_ @@ -131,82 +131,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_basic_list_total_parameters_d); + f_console_parameter_t parameters[] = fss_basic_list_read_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_basic_list_read_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_basic_list_read_parameter_no_color_e, fss_basic_list_read_parameter_light_e, fss_basic_list_read_parameter_dark_e }; - const f_console_parameter_ids_t choices = { ids, 3 }; + { + f_console_parameter_id_t ids[3] = { fss_basic_list_read_parameter_no_color_e, fss_basic_list_read_parameter_light_e, fss_basic_list_read_parameter_dark_e }; + const f_console_parameter_ids_t choices = { ids, 3 }; - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_basic_list_read_main_delete(main); + if (F_status_is_error(status)) { + fss_basic_list_read_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_basic_list_read_parameter_verbosity_quiet_e, fss_basic_list_read_parameter_verbosity_normal_e, fss_basic_list_read_parameter_verbosity_verbose_e, fss_basic_list_read_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_basic_list_read_parameter_verbosity_quiet_e, fss_basic_list_read_parameter_verbosity_normal_e, fss_basic_list_read_parameter_verbosity_verbose_e, fss_basic_list_read_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fss_basic_list_read_main_delete(main); - - return status; - } + if (F_status_is_error(status)) { + fss_basic_list_read_main_delete(main); - if (choice == fss_basic_list_read_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_basic_list_read_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_basic_list_read_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_basic_list_read_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_basic_list_read_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_basic_list_read_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_basic_list_read_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_basic_list_read_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_basic_list_read_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_basic_list_read_parameter_help_e].result == f_console_result_found_e) { fss_basic_list_read_print_help(main->output.to, main->context); fss_basic_list_read_main_delete(main); @@ -214,7 +216,7 @@ extern "C" { return status; } - if (main->parameters[fss_basic_list_read_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_basic_list_program_version_s); fss_basic_list_read_main_delete(main); @@ -268,7 +270,7 @@ extern "C" { for (f_array_length_t i = 0; i < 6; ++i) { - if (main->parameters[parameter_code[i]].result == f_console_result_found_e) { + if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -284,7 +286,7 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_basic_list_read_parameter_columns_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_basic_list_read_parameter_columns_e].result == f_console_result_found_e) { const f_array_length_t parameter_code[] = { fss_basic_list_read_parameter_depth_e, fss_basic_list_read_parameter_line_e, @@ -311,7 +313,7 @@ extern "C" { for (f_array_length_t i = 0; i < 5; ++i) { - if (main->parameters[parameter_code[i]].result == parameter_match[i]) { + if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -329,8 +331,8 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) { - if (main->parameters[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -343,7 +345,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_list_read_parameter_line_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_basic_list_read_parameter_line_e].result == f_console_result_additional_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -358,7 +360,7 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[fss_basic_list_read_parameter_delimit_e].result == f_console_result_additional_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_basic_list_read_parameter_delimit_e].result == f_console_result_additional_e) { f_array_length_t location = 0; f_array_length_t length = 0; uint16_t signal_check = 0; @@ -366,7 +368,7 @@ extern "C" { // Set the value to 0 to allow for detecting mode based on what is provided. data.delimit_mode = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_read_parameter_delimit_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_read_parameter_delimit_e].values.used; ++i) { if (!((++signal_check) % fss_basic_list_read_signal_check_d)) { if (fss_basic_list_read_signal_received(main)) { @@ -378,7 +380,7 @@ extern "C" { signal_check = 0; } - location = main->parameters[fss_basic_list_read_parameter_delimit_e].values.array[i]; + location = main->parameters.array[fss_basic_list_read_parameter_delimit_e].values.array[i]; length = strnlen(arguments->argv[location], F_console_parameter_size_d); if (!length) { @@ -505,7 +507,7 @@ extern "C" { // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file. if (F_status_is_error_not(status) && data.depths.array[0].depth > 0) { - if (main->parameters[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) { fss_basic_list_read_print_zero(main); } @@ -515,7 +517,7 @@ extern "C" { return F_none; } - if (F_status_is_error_not(status) && main->parameters[fss_basic_list_read_parameter_select_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_basic_list_read_parameter_select_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -588,7 +590,7 @@ extern "C" { status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); break; } @@ -670,12 +672,7 @@ extern "C" { #ifndef _di_fss_basic_list_read_main_delete_ f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main) { - for (f_array_length_t i = 0; i < fss_basic_list_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); macro_f_color_context_t_delete_simple(main->context); diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.h b/level_3/fss_basic_list_read/c/fss_basic_list_read.h index 4656a0b..d6de141 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.h @@ -224,7 +224,7 @@ extern "C" { #ifndef _di_fss_basic_list_read_main_t_ typedef struct { - f_console_parameter_t parameters[fss_basic_list_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -240,7 +240,7 @@ extern "C" { #define fss_basic_list_read_main_t_initialize \ { \ - fss_basic_list_read_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_basic_list_read/c/private-print.c b/level_3/fss_basic_list_read/c/private-print.c index a4d533e..3a9b2b9 100644 --- a/level_3/fss_basic_list_read/c/private-print.c +++ b/level_3/fss_basic_list_read/c/private-print.c @@ -65,7 +65,7 @@ extern "C" { #ifndef _di_fss_basic_list_read_print_content_ignore_ void fss_basic_list_read_print_content_ignore(fss_basic_list_read_main_t * const main) { - if (main->parameters[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_basic_list_read_pipe_content_ignore_s, main->output.to.stream); } } @@ -74,11 +74,11 @@ extern "C" { #ifndef _di_fss_basic_list_read_print_object_end_ void fss_basic_list_read_print_object_end(fss_basic_list_read_main_t * const main) { - if (main->parameters[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_basic_list_read_pipe_content_start_s, main->output.to.stream); } else { - if (main->parameters[fss_basic_list_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_content_e].result == f_console_result_found_e) { f_print_character(f_fss_basic_list_open_s.string[0], main->output.to.stream); f_print_character(f_fss_basic_list_open_end_s.string[0], main->output.to.stream); } @@ -92,7 +92,7 @@ extern "C" { #ifndef _di_fss_basic_list_read_print_set_end_ void fss_basic_list_read_print_set_end(fss_basic_list_read_main_t * const main) { - if (main->parameters[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_basic_list_read_pipe_content_end_s, main->output.to.stream); } } diff --git a/level_3/fss_basic_list_read/c/private-read.c b/level_3/fss_basic_list_read/c/private-read.c index 65f4cf3..4b10d51 100644 --- a/level_3/fss_basic_list_read/c/private-read.c +++ b/level_3/fss_basic_list_read/c/private-read.c @@ -63,8 +63,8 @@ extern "C" { { f_array_length_t depth_size = 1; - if (main->parameters[fss_basic_list_read_parameter_depth_e].result == f_console_result_additional_e) { - depth_size = main->parameters[fss_basic_list_read_parameter_depth_e].values.used; + if (main->parameters.array[fss_basic_list_read_parameter_depth_e].result == f_console_result_additional_e) { + depth_size = main->parameters.array[fss_basic_list_read_parameter_depth_e].values.used; } if (depth_size > data->depths.size) { @@ -102,11 +102,11 @@ extern "C" { macro_f_string_dynamic_t_clear(data->depths.array[i].value_name); - if (!main->parameters[fss_basic_list_read_parameter_depth_e].values.used) { + if (!main->parameters.array[fss_basic_list_read_parameter_depth_e].values.used) { position_depth = 0; } else { - position_depth = main->parameters[fss_basic_list_read_parameter_depth_e].values.array[i]; + position_depth = main->parameters.array[fss_basic_list_read_parameter_depth_e].values.array[i]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth])); @@ -119,18 +119,18 @@ extern "C" { } } - if (main->parameters[fss_basic_list_read_parameter_at_e].result == f_console_result_additional_e) { - for (; position_at < main->parameters[fss_basic_list_read_parameter_at_e].values.used; ++position_at) { + if (main->parameters.array[fss_basic_list_read_parameter_at_e].result == f_console_result_additional_e) { + for (; position_at < main->parameters.array[fss_basic_list_read_parameter_at_e].values.used; ++position_at) { - if (main->parameters[fss_basic_list_read_parameter_at_e].values.array[position_at] < position_depth) { + if (main->parameters.array[fss_basic_list_read_parameter_at_e].values.array[position_at] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_basic_list_read_parameter_at_e].values.array[position_at] > main->parameters[fss_basic_list_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_basic_list_read_parameter_at_e].values.array[position_at] > main->parameters.array[fss_basic_list_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_at = main->parameters[fss_basic_list_read_parameter_at_e].values.array[position_at]; + data->depths.array[i].index_at = main->parameters.array[fss_basic_list_read_parameter_at_e].values.array[position_at]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at])); @@ -144,20 +144,20 @@ extern "C" { } // for } - if (main->parameters[fss_basic_list_read_parameter_name_e].result == f_console_result_additional_e) { - for (; position_name < main->parameters[fss_basic_list_read_parameter_name_e].values.used; ++position_name) { + if (main->parameters.array[fss_basic_list_read_parameter_name_e].result == f_console_result_additional_e) { + for (; position_name < main->parameters.array[fss_basic_list_read_parameter_name_e].values.used; ++position_name) { - if (main->parameters[fss_basic_list_read_parameter_name_e].values.array[position_name] < position_depth) { + if (main->parameters.array[fss_basic_list_read_parameter_name_e].values.array[position_name] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_basic_list_read_parameter_name_e].values.array[position_name] > main->parameters[fss_basic_list_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_basic_list_read_parameter_name_e].values.array[position_name] > main->parameters.array[fss_basic_list_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_name = main->parameters[fss_basic_list_read_parameter_name_e].values.array[position_name]; + data->depths.array[i].index_name = main->parameters.array[fss_basic_list_read_parameter_name_e].values.array[position_name]; - if (main->parameters[fss_basic_list_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_trim_e].result == f_console_result_found_e) { status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name); } else { @@ -165,7 +165,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), main->parameters[fss_basic_list_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); + fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_basic_list_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); return status; } @@ -257,7 +257,7 @@ extern "C" { if (F_status_is_error(status)) { const f_string_t file_name = fss_basic_list_read_file_identify(input.start, data->files); - fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true, file_name, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); return status; } @@ -283,8 +283,8 @@ extern "C" { #ifndef _di_fss_basic_list_read_load_number_ f_status_t fss_basic_list_read_load_number(fss_basic_list_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) { - if (main->parameters[parameter].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1]; + if (main->parameters.array[parameter].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number); @@ -310,7 +310,7 @@ extern "C" { // This standard does not support multiple content groups. if ((data->option & fss_basic_list_read_data_option_select_d) && data->select) { - if (main->parameters[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->output.to.stream); fss_basic_list_read_print_zero(main); @@ -668,53 +668,53 @@ extern "C" { f_status_t status = F_none; - if (main->parameters[fss_basic_list_read_parameter_at_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_list_read_parameter_at_e].result == f_console_result_additional_e) { data->option |= fss_basic_list_read_data_option_at_d; } - if (main->parameters[fss_basic_list_read_parameter_columns_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_columns_e].result == f_console_result_found_e) { data->option |= fss_basic_list_read_data_option_columns_d; } - if (main->parameters[fss_basic_list_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_content_e].result == f_console_result_found_e) { data->option |= fss_basic_list_read_data_option_content_d; } - if (main->parameters[fss_basic_list_read_parameter_empty_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_empty_e].result == f_console_result_found_e) { data->option |= fss_basic_list_read_data_option_empty_d; } - if (main->parameters[fss_basic_list_read_parameter_line_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_list_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_basic_list_read_data_option_line_d; status = fss_basic_list_read_load_number(main, fss_basic_list_read_parameter_line_e, fss_basic_list_read_long_line_s, arguments, &data->line); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_basic_list_read_parameter_name_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_list_read_parameter_name_e].result == f_console_result_additional_e) { data->option |= fss_basic_list_read_data_option_name_d; } - if (main->parameters[fss_basic_list_read_parameter_object_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_object_e].result == f_console_result_found_e) { data->option |= fss_basic_list_read_data_option_object_d; } - if (main->parameters[fss_basic_list_read_parameter_raw_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_raw_e].result == f_console_result_found_e) { data->option |= fss_basic_list_read_data_option_raw_d; } - if (main->parameters[fss_basic_list_read_parameter_select_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_list_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_basic_list_read_data_option_select_d; status = fss_basic_list_read_load_number(main, fss_basic_list_read_parameter_select_e, fss_basic_list_read_long_select_s, arguments, &data->select); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) { data->option |= fss_basic_list_read_data_option_total_d; } - if (main->parameters[fss_basic_list_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_read_parameter_trim_e].result == f_console_result_found_e) { data->option |= fss_basic_list_read_data_option_trim_d; } diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index ea9df2c..c17adf0 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_fss_basic_list_write_program_version_ - const f_string_static_t fss_basic_list_write_program_version_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_WRITE_program_version_s, 0, FSS_BASIC_LIST_WRITE_program_version_s_length); + const f_string_static_t fss_basic_list_write_program_version_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_program_version_s, 0, FSS_BASIC_LIST_WRITE_program_version_s_length); #endif // _di_fss_basic_list_write_program_version_ #ifndef _di_fss_basic_list_write_program_name_ - const f_string_static_t fss_basic_list_write_program_name_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_WRITE_program_name_s, 0, FSS_BASIC_LIST_WRITE_program_name_s_length); - const f_string_static_t fss_basic_list_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_WRITE_program_name_long_s, 0, FSS_BASIC_LIST_WRITE_program_name_long_s_length); + const f_string_static_t fss_basic_list_write_program_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_program_name_s, 0, FSS_BASIC_LIST_WRITE_program_name_s_length); + const f_string_static_t fss_basic_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_program_name_long_s, 0, FSS_BASIC_LIST_WRITE_program_name_long_s_length); #endif // _di_fss_basic_list_write_program_name_ #ifndef _di_fss_basic_list_write_print_help_ @@ -70,82 +70,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_basic_list_write_total_parameters_d); + f_console_parameter_t parameters[] = fss_basic_list_write_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_basic_list_write_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_basic_list_write_parameter_no_color_e, fss_basic_list_write_parameter_light_e, fss_basic_list_write_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_basic_list_write_parameter_no_color_e, fss_basic_list_write_parameter_light_e, fss_basic_list_write_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_basic_list_write_main_delete(main); + if (F_status_is_error(status)) { + fss_basic_list_write_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_basic_list_write_parameter_verbosity_quiet_e, fss_basic_list_write_parameter_verbosity_normal_e, fss_basic_list_write_parameter_verbosity_verbose_e, fss_basic_list_write_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_basic_list_write_parameter_verbosity_quiet_e, fss_basic_list_write_parameter_verbosity_normal_e, fss_basic_list_write_parameter_verbosity_verbose_e, fss_basic_list_write_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fss_basic_list_write_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + fss_basic_list_write_main_delete(main); - if (choice == fss_basic_list_write_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_basic_list_write_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_basic_list_write_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_basic_list_write_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_basic_list_write_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_basic_list_write_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_basic_list_write_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_basic_list_write_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_basic_list_write_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_basic_list_write_parameter_help_e].result == f_console_result_found_e) { fss_basic_list_write_print_help(main->output.to, main->context); fss_basic_list_write_main_delete(main); @@ -153,7 +155,7 @@ extern "C" { return status; } - if (main->parameters[fss_basic_list_write_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_write_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_basic_list_write_program_version_s); fss_basic_list_write_main_delete(main); @@ -170,8 +172,8 @@ extern "C" { output.size_write = main->output.to.size_write; if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_list_write_parameter_file_e].result == f_console_result_additional_e) { - if (main->parameters[fss_basic_list_write_parameter_file_e].values.used > 1) { + if (main->parameters.array[fss_basic_list_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_list_write_parameter_file_e].values.used > 1) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -185,40 +187,40 @@ extern "C" { status = F_status_set_error(F_parameter); } else { - const f_array_length_t location = main->parameters[fss_basic_list_write_parameter_file_e].values.array[0]; + const f_array_length_t location = main->parameters.array[fss_basic_list_write_parameter_file_e].values.array[0]; output.id = -1; output.stream = 0; status = f_file_stream_open(arguments->argv[location], 0, &output); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], f_file_operation_open_s, fll_error_file_type_file_e); } } } - else if (main->parameters[fss_basic_list_write_parameter_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_basic_list_write_parameter_file_e].result == f_console_result_found_e) { fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_file_s); status = F_status_set_error(F_parameter); } } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_list_write_parameter_object_e].locations.used || main->parameters[fss_basic_list_write_parameter_content_e].locations.used) { - if (main->parameters[fss_basic_list_write_parameter_object_e].locations.used) { - if (main->parameters[fss_basic_list_write_parameter_object_e].locations.used != main->parameters[fss_basic_list_write_parameter_object_e].values.used) { + if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used || main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used) { + if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used != main->parameters.array[fss_basic_list_write_parameter_object_e].values.used) { fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_list_write_parameter_content_e].locations.used != main->parameters[fss_basic_list_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used != main->parameters.array[fss_basic_list_write_parameter_content_e].values.used) { fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_list_write_parameter_object_e].locations.used != main->parameters[fss_basic_list_write_parameter_content_e].locations.used && main->parameters[fss_basic_list_write_parameter_partial_e].result == f_console_result_none_e) { + else if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used != main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used && main->parameters.array[fss_basic_list_write_parameter_partial_e].result == f_console_result_none_e) { fss_basic_list_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_list_write_parameter_content_e].locations.used && main->parameters[fss_basic_list_write_parameter_partial_e].locations.used) { - if (main->parameters[fss_basic_list_write_parameter_content_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used && main->parameters.array[fss_basic_list_write_parameter_partial_e].locations.used) { + if (main->parameters.array[fss_basic_list_write_parameter_content_e].result == f_console_result_additional_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -238,17 +240,17 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_list_write_parameter_content_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_list_write_parameter_content_e].result == f_console_result_additional_e) { f_array_length_t location_object = 0; f_array_length_t location_content = 0; f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object_e].locations.used; ++i) { - location_object = main->parameters[fss_basic_list_write_parameter_object_e].locations.array[i]; - location_content = main->parameters[fss_basic_list_write_parameter_content_e].locations.array[i]; - location_sub_object = main->parameters[fss_basic_list_write_parameter_object_e].locations_sub.array[i]; - location_sub_content = main->parameters[fss_basic_list_write_parameter_content_e].locations_sub.array[i]; + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used; ++i) { + location_object = main->parameters.array[fss_basic_list_write_parameter_object_e].locations.array[i]; + location_content = main->parameters.array[fss_basic_list_write_parameter_content_e].locations.array[i]; + location_sub_object = main->parameters.array[fss_basic_list_write_parameter_object_e].locations_sub.array[i]; + location_sub_content = main->parameters.array[fss_basic_list_write_parameter_content_e].locations_sub.array[i]; if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -271,12 +273,12 @@ extern "C" { } } } - else if (main->parameters[fss_basic_list_write_parameter_content_e].locations.used) { - if (main->parameters[fss_basic_list_write_parameter_content_e].locations.used != main->parameters[fss_basic_list_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used != main->parameters.array[fss_basic_list_write_parameter_content_e].values.used) { fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (!main->parameters[fss_basic_list_write_parameter_partial_e].locations.used) { + else if (!main->parameters.array[fss_basic_list_write_parameter_partial_e].locations.used) { fss_basic_list_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } @@ -299,7 +301,7 @@ extern "C" { } if (F_status_is_error_not(status) && main->process_pipe) { - if (main->parameters[fss_basic_list_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_write_parameter_partial_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -316,7 +318,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_list_write_parameter_prepend_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_write_parameter_prepend_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -329,8 +331,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_list_write_parameter_prepend_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_basic_list_write_parameter_prepend_e].values.array[main->parameters[fss_basic_list_write_parameter_prepend_e].values.used - 1]; + else if (main->parameters.array[fss_basic_list_write_parameter_prepend_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_basic_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_basic_list_write_parameter_prepend_e].values.used - 1]; const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d); if (length) { @@ -379,7 +381,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_list_write_parameter_ignore_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_write_parameter_ignore_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -392,9 +394,9 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_list_write_parameter_ignore_e].result == f_console_result_additional_e) { - const f_array_length_t total_locations = main->parameters[fss_basic_list_write_parameter_ignore_e].locations.used; - const f_array_length_t total_arguments = main->parameters[fss_basic_list_write_parameter_ignore_e].values.used; + else if (main->parameters.array[fss_basic_list_write_parameter_ignore_e].result == f_console_result_additional_e) { + const f_array_length_t total_locations = main->parameters.array[fss_basic_list_write_parameter_ignore_e].locations.used; + const f_array_length_t total_arguments = main->parameters.array[fss_basic_list_write_parameter_ignore_e].values.used; if (total_locations * 2 > total_arguments) { flockfile(main->error.to.stream); @@ -413,14 +415,14 @@ extern "C" { f_fss_quote_t quote = F_fss_delimit_quote_double_s; if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_list_write_parameter_double_e].result == f_console_result_found_e) { - if (main->parameters[fss_basic_list_write_parameter_single_e].result == f_console_result_found_e) { - if (main->parameters[fss_basic_list_write_parameter_double_e].location < main->parameters[fss_basic_list_write_parameter_single_e].location) { + if (main->parameters.array[fss_basic_list_write_parameter_double_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_write_parameter_single_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_write_parameter_double_e].location < main->parameters.array[fss_basic_list_write_parameter_single_e].location) { quote = F_fss_delimit_quote_single_s; } } } - else if (main->parameters[fss_basic_list_write_parameter_single_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_basic_list_write_parameter_single_e].result == f_console_result_found_e) { quote = F_fss_delimit_quote_single_s; } } @@ -448,10 +450,10 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_list_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_write_parameter_partial_e].result == f_console_result_found_e) { - if (main->parameters[fss_basic_list_write_parameter_object_e].result == f_console_result_additional_e) { - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object_e].values.used; ++i) { + if (main->parameters.array[fss_basic_list_write_parameter_object_e].result == f_console_result_additional_e) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_object_e].values.used; ++i) { if (fss_basic_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -459,7 +461,7 @@ extern "C" { break; } - object.string = arguments->argv[main->parameters[fss_basic_list_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_basic_list_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; @@ -468,7 +470,7 @@ extern "C" { } // for } else { - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_content_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_content_e].values.used; ++i) { if (fss_basic_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -476,7 +478,7 @@ extern "C" { break; } - content.string = arguments->argv[main->parameters[fss_basic_list_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_basic_list_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -486,7 +488,7 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_object_e].values.used; ++i) { if (fss_basic_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -494,11 +496,11 @@ extern "C" { break; } - object.string = arguments->argv[main->parameters[fss_basic_list_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_basic_list_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; - content.string = arguments->argv[main->parameters[fss_basic_list_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_basic_list_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -517,7 +519,7 @@ extern "C" { funlockfile(main->error.to.stream); } } - else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters[fss_basic_list_write_parameter_file_e].result == f_console_result_none_e) { + else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters.array[fss_basic_list_write_parameter_file_e].result == f_console_result_none_e) { // Ensure there is always a newline at the end, unless in quiet mode. fll_print_dynamic(f_string_eol_s, main->output.to.stream); @@ -536,7 +538,7 @@ extern "C" { content.size = 0; } - if (main->parameters[fss_basic_list_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_list_write_parameter_file_e].result == f_console_result_additional_e) { if (output.id != -1) { f_file_stream_close(F_true, &output); } @@ -561,12 +563,7 @@ extern "C" { #ifndef _di_fss_basic_list_write_main_delete_ f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main) { - for (f_array_length_t i = 0; i < fss_basic_list_write_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.h b/level_3/fss_basic_list_write/c/fss_basic_list_write.h index 2dca490..0e04219 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.h +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.h @@ -157,7 +157,7 @@ extern "C" { #ifndef _di_fss_basic_list_write_main_t_ typedef struct { - f_console_parameter_t parameters[fss_basic_list_write_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -175,7 +175,7 @@ extern "C" { #define fss_basic_list_write_main_t_initialize \ { \ - fss_basic_list_write_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_basic_list_write/c/private-write.c b/level_3/fss_basic_list_write/c/private-write.c index 85cad31..1b60879 100644 --- a/level_3/fss_basic_list_write/c/private-write.c +++ b/level_3/fss_basic_list_write/c/private-write.c @@ -81,7 +81,7 @@ extern "C" { } if (content) { - if (main->parameters[fss_basic_list_write_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_list_write_parameter_trim_e].result == f_console_result_found_e) { complete = f_fss_complete_full_trim_e; } else { diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 6adfc15..d36eba2 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -8,12 +8,12 @@ extern "C" { #endif #ifndef _di_fss_basic_read_program_version_ - const f_string_static_t fss_basic_read_program_version_s = macro_f_string_static_t_initialize2(FSS_BASIC_READ_program_version_s, 0, FSS_BASIC_READ_program_version_s_length); + const f_string_static_t fss_basic_read_program_version_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_program_version_s, 0, FSS_BASIC_READ_program_version_s_length); #endif // _di_fss_basic_read_program_version_ #ifndef _di_fss_basic_read_program_name_ - const f_string_static_t fss_basic_read_program_name_s = macro_f_string_static_t_initialize2(FSS_BASIC_READ_program_name_s, 0, FSS_BASIC_READ_program_name_s_length); - const f_string_static_t fss_basic_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_BASIC_READ_program_name_long_s, 0, FSS_BASIC_READ_program_name_long_s_length); + const f_string_static_t fss_basic_read_program_name_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_program_name_s, 0, FSS_BASIC_READ_program_name_s_length); + const f_string_static_t fss_basic_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_program_name_long_s, 0, FSS_BASIC_READ_program_name_long_s_length); #endif // _di_fss_basic_read_program_name_ #ifndef _di_fss_basic_read_print_help_ @@ -131,82 +131,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_basic_read_total_parameters_d); + f_console_parameter_t parameters[] = fss_basic_read_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_basic_read_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_basic_read_parameter_no_color_e, fss_basic_read_parameter_light_e, fss_basic_read_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_basic_read_parameter_no_color_e, fss_basic_read_parameter_light_e, fss_basic_read_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_basic_read_main_delete(main); + if (F_status_is_error(status)) { + fss_basic_read_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_basic_read_parameter_verbosity_quiet_e, fss_basic_read_parameter_verbosity_normal_e, fss_basic_read_parameter_verbosity_verbose_e, fss_basic_read_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_basic_read_parameter_verbosity_quiet_e, fss_basic_read_parameter_verbosity_normal_e, fss_basic_read_parameter_verbosity_verbose_e, fss_basic_read_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fss_basic_read_main_delete(main); - - return status; - } + if (F_status_is_error(status)) { + fss_basic_read_main_delete(main); - if (choice == fss_basic_read_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_basic_read_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_basic_read_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_basic_read_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_basic_read_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_basic_read_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_basic_read_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_basic_read_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_basic_read_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_basic_read_parameter_help_e].result == f_console_result_found_e) { fss_basic_read_print_help(main->output.to, main->context); fss_basic_read_main_delete(main); @@ -214,7 +216,7 @@ extern "C" { return status; } - if (main->parameters[fss_basic_read_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_basic_read_program_version_s); fss_basic_read_main_delete(main); @@ -268,7 +270,7 @@ extern "C" { for (f_array_length_t i = 0; i < 6; ++i) { - if (main->parameters[parameter_code[i]].result == f_console_result_found_e) { + if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -284,7 +286,7 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_basic_read_parameter_columns_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_basic_read_parameter_columns_e].result == f_console_result_found_e) { const f_array_length_t parameter_code[] = { fss_basic_read_parameter_depth_e, fss_basic_read_parameter_line_e, @@ -311,7 +313,7 @@ extern "C" { for (f_array_length_t i = 0; i < 5; ++i) { - if (main->parameters[parameter_code[i]].result == parameter_match[i]) { + if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -329,8 +331,8 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) { - if (main->parameters[fss_basic_read_parameter_total_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -343,7 +345,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -358,14 +360,14 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[fss_basic_read_parameter_delimit_e].result == f_console_result_additional_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_basic_read_parameter_delimit_e].result == f_console_result_additional_e) { f_array_length_t location = 0; f_array_length_t length = 0; // Set the value to 0 to allow for detecting mode based on what is provided. data.delimit_mode = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_read_parameter_delimit_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_read_parameter_delimit_e].values.used; ++i) { if (fss_basic_read_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -373,7 +375,7 @@ extern "C" { break; } - location = main->parameters[fss_basic_read_parameter_delimit_e].values.array[i]; + location = main->parameters.array[fss_basic_read_parameter_delimit_e].values.array[i]; length = strnlen(arguments->argv[location], F_console_parameter_size_d); if (!length) { @@ -500,7 +502,7 @@ extern "C" { // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file. if (F_status_is_error_not(status) && data.depths.array[0].depth > 0) { - if (main->parameters[fss_basic_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_total_e].result == f_console_result_found_e) { fss_basic_read_print_zero(main); } @@ -510,7 +512,7 @@ extern "C" { return F_none; } - if (F_status_is_error_not(status) && main->parameters[fss_basic_read_parameter_select_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_basic_read_parameter_select_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -577,7 +579,7 @@ extern "C" { status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); break; } @@ -660,12 +662,7 @@ extern "C" { #ifndef _di_fss_basic_read_main_delete_ f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main) { - for (f_array_length_t i = 0; i < fss_basic_read_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); macro_f_color_context_t_delete_simple(main->context); diff --git a/level_3/fss_basic_read/c/fss_basic_read.h b/level_3/fss_basic_read/c/fss_basic_read.h index 7221c37..56e2397 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -224,7 +224,7 @@ extern "C" { #ifndef _di_fss_basic_read_main_t_ typedef struct { - f_console_parameter_t parameters[fss_basic_read_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -240,7 +240,7 @@ extern "C" { #define fss_basic_read_main_t_initialize \ { \ - fss_basic_read_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_basic_read/c/private-print.c b/level_3/fss_basic_read/c/private-print.c index a42a4db..51d7f2a 100644 --- a/level_3/fss_basic_read/c/private-print.c +++ b/level_3/fss_basic_read/c/private-print.c @@ -74,7 +74,7 @@ extern "C" { #ifndef _di_fss_basic_read_print_object_end_ void fss_basic_read_print_object_end(fss_basic_read_main_t * const main) { - if (main->parameters[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_basic_read_pipe_content_start_s, main->output.to.stream); } else { @@ -94,7 +94,7 @@ extern "C" { #ifndef _di_fss_basic_read_print_set_end_ void fss_basic_read_print_set_end(fss_basic_read_main_t * const main) { - if (main->parameters[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_basic_read_pipe_content_end_s, main->output.to.stream); } else { diff --git a/level_3/fss_basic_read/c/private-read.c b/level_3/fss_basic_read/c/private-read.c index 3079758..625415e 100644 --- a/level_3/fss_basic_read/c/private-read.c +++ b/level_3/fss_basic_read/c/private-read.c @@ -40,8 +40,8 @@ extern "C" { { f_array_length_t depth_size = 1; - if (main->parameters[fss_basic_read_parameter_depth_e].result == f_console_result_additional_e) { - depth_size = main->parameters[fss_basic_read_parameter_depth_e].values.used; + if (main->parameters.array[fss_basic_read_parameter_depth_e].result == f_console_result_additional_e) { + depth_size = main->parameters.array[fss_basic_read_parameter_depth_e].values.used; } if (depth_size > data->depths.size) { @@ -74,11 +74,11 @@ extern "C" { macro_f_string_dynamic_t_clear(data->depths.array[i].value_name); - if (!main->parameters[fss_basic_read_parameter_depth_e].values.used) { + if (!main->parameters.array[fss_basic_read_parameter_depth_e].values.used) { position_depth = 0; } else { - position_depth = main->parameters[fss_basic_read_parameter_depth_e].values.array[i]; + position_depth = main->parameters.array[fss_basic_read_parameter_depth_e].values.array[i]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth])); @@ -91,18 +91,18 @@ extern "C" { } } - if (main->parameters[fss_basic_read_parameter_at_e].result == f_console_result_additional_e) { - for (; position_at < main->parameters[fss_basic_read_parameter_at_e].values.used; ++position_at) { + if (main->parameters.array[fss_basic_read_parameter_at_e].result == f_console_result_additional_e) { + for (; position_at < main->parameters.array[fss_basic_read_parameter_at_e].values.used; ++position_at) { - if (main->parameters[fss_basic_read_parameter_at_e].values.array[position_at] < position_depth) { + if (main->parameters.array[fss_basic_read_parameter_at_e].values.array[position_at] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_basic_read_parameter_at_e].values.array[position_at] > main->parameters[fss_basic_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_basic_read_parameter_at_e].values.array[position_at] > main->parameters.array[fss_basic_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_at = main->parameters[fss_basic_read_parameter_at_e].values.array[position_at]; + data->depths.array[i].index_at = main->parameters.array[fss_basic_read_parameter_at_e].values.array[position_at]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at])); @@ -116,20 +116,20 @@ extern "C" { } // for } - if (main->parameters[fss_basic_read_parameter_name_e].result == f_console_result_additional_e) { - for (; position_name < main->parameters[fss_basic_read_parameter_name_e].values.used; position_name++) { + if (main->parameters.array[fss_basic_read_parameter_name_e].result == f_console_result_additional_e) { + for (; position_name < main->parameters.array[fss_basic_read_parameter_name_e].values.used; position_name++) { - if (main->parameters[fss_basic_read_parameter_name_e].values.array[position_name] < position_depth) { + if (main->parameters.array[fss_basic_read_parameter_name_e].values.array[position_name] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_basic_read_parameter_name_e].values.array[position_name] > main->parameters[fss_basic_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_basic_read_parameter_name_e].values.array[position_name] > main->parameters.array[fss_basic_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_name = main->parameters[fss_basic_read_parameter_name_e].values.array[position_name]; + data->depths.array[i].index_name = main->parameters.array[fss_basic_read_parameter_name_e].values.array[position_name]; - if (main->parameters[fss_basic_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_trim_e].result == f_console_result_found_e) { status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name); } else { @@ -137,7 +137,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), main->parameters[fss_basic_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); + fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_basic_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); return status; } @@ -226,7 +226,7 @@ extern "C" { if (F_status_is_error(status)) { const f_string_t file_name = fss_basic_read_file_identify(input.start, data->files); - fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_read", F_true, file_name, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); return status; } @@ -248,8 +248,8 @@ extern "C" { #ifndef _di_fss_basic_read_load_number_ f_status_t fss_basic_read_load_number(fss_basic_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) { - if (main->parameters[parameter].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1]; + if (main->parameters.array[parameter].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number); @@ -275,7 +275,7 @@ extern "C" { // This standard does not support multiple content groups. if ((data->option & fss_basic_read_data_option_select_d) && data->select) { - if (main->parameters[fss_basic_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->output.to.stream); fss_basic_read_print_zero(main); @@ -544,53 +544,53 @@ extern "C" { f_status_t status = F_none; - if (main->parameters[fss_basic_read_parameter_at_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_read_parameter_at_e].result == f_console_result_additional_e) { data->option |= fss_basic_read_data_option_at_d; } - if (main->parameters[fss_basic_read_parameter_columns_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_columns_e].result == f_console_result_found_e) { data->option |= fss_basic_read_data_option_columns_d; } - if (main->parameters[fss_basic_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_content_e].result == f_console_result_found_e) { data->option |= fss_basic_read_data_option_content_d; } - if (main->parameters[fss_basic_read_parameter_empty_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_empty_e].result == f_console_result_found_e) { data->option |= fss_basic_read_data_option_empty_d; } - if (main->parameters[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_basic_read_data_option_line_d; status = fss_basic_read_load_number(main, fss_basic_read_parameter_line_e, fss_basic_read_long_line_s, arguments, &data->line); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_basic_read_parameter_name_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_read_parameter_name_e].result == f_console_result_additional_e) { data->option |= fss_basic_read_data_option_name_d; } - if (main->parameters[fss_basic_read_parameter_object_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_object_e].result == f_console_result_found_e) { data->option |= fss_basic_read_data_option_object_d; } - if (main->parameters[fss_basic_read_parameter_raw_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_raw_e].result == f_console_result_found_e) { data->option |= fss_basic_read_data_option_raw_d; } - if (main->parameters[fss_basic_read_parameter_select_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_basic_read_data_option_select_d; status = fss_basic_read_load_number(main, fss_basic_read_parameter_select_e, fss_basic_read_long_select_s, arguments, &data->select); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_basic_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_total_e].result == f_console_result_found_e) { data->option |= fss_basic_read_data_option_total_d; } - if (main->parameters[fss_basic_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_read_parameter_trim_e].result == f_console_result_found_e) { data->option |= fss_basic_read_data_option_trim_d; } diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index e5e8109..e54aa8c 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_byte_dump_program_version_ - const f_string_static_t fss_basic_write_program_version_s = macro_f_string_static_t_initialize2(FSS_BASIC_WRITE_program_version_s, 0, FSS_BASIC_WRITE_program_version_s_length); + const f_string_static_t fss_basic_write_program_version_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_program_version_s, 0, FSS_BASIC_WRITE_program_version_s_length); #endif // _di_byte_dump_program_version_ #ifndef _di_byte_dump_program_name_ - const f_string_static_t fss_basic_write_program_name_s = macro_f_string_static_t_initialize2(FSS_BASIC_WRITE_program_name_s, 0, FSS_BASIC_WRITE_program_name_s_length); - const f_string_static_t fss_basic_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_BASIC_WRITE_program_name_long_s, 0, FSS_BASIC_WRITE_program_name_long_s_length); + const f_string_static_t fss_basic_write_program_name_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_program_name_s, 0, FSS_BASIC_WRITE_program_name_s_length); + const f_string_static_t fss_basic_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_program_name_long_s, 0, FSS_BASIC_WRITE_program_name_long_s_length); #endif // _di_byte_dump_program_name_ #ifndef _di_fss_basic_write_print_help_ @@ -70,82 +70,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_basic_write_total_parameters_d); + f_console_parameter_t parameters[] = fss_basic_write_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_basic_write_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_basic_write_parameter_no_color_e, fss_basic_write_parameter_light_e, fss_basic_write_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_basic_write_parameter_no_color_e, fss_basic_write_parameter_light_e, fss_basic_write_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_basic_write_main_delete(main); + if (F_status_is_error(status)) { + fss_basic_write_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_basic_write_parameter_verbosity_quiet_e, fss_basic_write_parameter_verbosity_normal_e, fss_basic_write_parameter_verbosity_verbose_e, fss_basic_write_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_basic_write_parameter_verbosity_quiet_e, fss_basic_write_parameter_verbosity_normal_e, fss_basic_write_parameter_verbosity_verbose_e, fss_basic_write_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fss_basic_write_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + fss_basic_write_main_delete(main); - if (choice == fss_basic_write_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_basic_write_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_basic_write_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_basic_write_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_basic_write_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_basic_write_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_basic_write_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_basic_write_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_basic_write_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_basic_write_parameter_help_e].result == f_console_result_found_e) { fss_basic_write_print_help(main->output.to, main->context); fss_basic_write_main_delete(main); @@ -153,7 +155,7 @@ extern "C" { return status; } - if (main->parameters[fss_basic_write_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_write_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_basic_write_program_version_s); fss_basic_write_main_delete(main); @@ -168,8 +170,8 @@ extern "C" { output.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_write_parameter_file_e].result == f_console_result_additional_e) { - if (main->parameters[fss_basic_write_parameter_file_e].values.used > 1) { + if (main->parameters.array[fss_basic_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_write_parameter_file_e].values.used > 1) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -183,40 +185,40 @@ extern "C" { status = F_status_set_error(F_parameter); } else { - const f_array_length_t location = main->parameters[fss_basic_write_parameter_file_e].values.array[0]; + const f_array_length_t location = main->parameters.array[fss_basic_write_parameter_file_e].values.array[0]; output.id = -1; output.stream = 0; status = f_file_stream_open(arguments->argv[location], 0, &output); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], f_file_operation_open_s, fll_error_file_type_file_e); } } } - else if (main->parameters[fss_basic_write_parameter_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_basic_write_parameter_file_e].result == f_console_result_found_e) { fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_file_s); status = F_status_set_error(F_parameter); } } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_write_parameter_object_e].locations.used || main->parameters[fss_basic_write_parameter_content_e].locations.used) { - if (main->parameters[fss_basic_write_parameter_object_e].locations.used) { - if (main->parameters[fss_basic_write_parameter_object_e].locations.used != main->parameters[fss_basic_write_parameter_object_e].values.used) { + if (main->parameters.array[fss_basic_write_parameter_object_e].locations.used || main->parameters.array[fss_basic_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_basic_write_parameter_object_e].locations.used) { + if (main->parameters.array[fss_basic_write_parameter_object_e].locations.used != main->parameters.array[fss_basic_write_parameter_object_e].values.used) { fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_object_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_write_parameter_content_e].locations.used != main->parameters[fss_basic_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_basic_write_parameter_content_e].locations.used != main->parameters.array[fss_basic_write_parameter_content_e].values.used) { fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_write_parameter_object_e].locations.used != main->parameters[fss_basic_write_parameter_content_e].locations.used && main->parameters[fss_basic_write_parameter_partial_e].result == f_console_result_none_e) { + else if (main->parameters.array[fss_basic_write_parameter_object_e].locations.used != main->parameters.array[fss_basic_write_parameter_content_e].locations.used && main->parameters.array[fss_basic_write_parameter_partial_e].result == f_console_result_none_e) { fss_basic_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_write_parameter_content_e].locations.used && main->parameters[fss_basic_write_parameter_partial_e].locations.used) { - if (main->parameters[fss_basic_write_parameter_content_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_basic_write_parameter_content_e].locations.used && main->parameters.array[fss_basic_write_parameter_partial_e].locations.used) { + if (main->parameters.array[fss_basic_write_parameter_content_e].result == f_console_result_additional_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -236,17 +238,17 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_write_parameter_content_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_write_parameter_content_e].result == f_console_result_additional_e) { f_array_length_t location_object = 0; f_array_length_t location_content = 0; f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object_e].locations.used; ++i) { - location_object = main->parameters[fss_basic_write_parameter_object_e].locations.array[i]; - location_content = main->parameters[fss_basic_write_parameter_content_e].locations.array[i]; - location_sub_object = main->parameters[fss_basic_write_parameter_object_e].locations_sub.array[i]; - location_sub_content = main->parameters[fss_basic_write_parameter_content_e].locations_sub.array[i]; + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].locations.used; ++i) { + location_object = main->parameters.array[fss_basic_write_parameter_object_e].locations.array[i]; + location_content = main->parameters.array[fss_basic_write_parameter_content_e].locations.array[i]; + location_sub_object = main->parameters.array[fss_basic_write_parameter_object_e].locations_sub.array[i]; + location_sub_content = main->parameters.array[fss_basic_write_parameter_content_e].locations_sub.array[i]; if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -269,12 +271,12 @@ extern "C" { } } } - else if (main->parameters[fss_basic_write_parameter_content_e].locations.used) { - if (main->parameters[fss_basic_write_parameter_content_e].locations.used != main->parameters[fss_basic_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_basic_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_basic_write_parameter_content_e].locations.used != main->parameters.array[fss_basic_write_parameter_content_e].values.used) { fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (!main->parameters[fss_basic_write_parameter_partial_e].locations.used) { + else if (!main->parameters.array[fss_basic_write_parameter_partial_e].locations.used) { fss_basic_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } @@ -297,7 +299,7 @@ extern "C" { } if (F_status_is_error_not(status) && main->process_pipe) { - if (main->parameters[fss_basic_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_write_parameter_partial_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -314,7 +316,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_write_parameter_prepend_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_write_parameter_prepend_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -327,14 +329,14 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_write_parameter_prepend_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_basic_write_parameter_prepend_e].values.array[main->parameters[fss_basic_write_parameter_prepend_e].values.used - 1]; + else if (main->parameters.array[fss_basic_write_parameter_prepend_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_basic_write_parameter_prepend_e].values.array[main->parameters.array[fss_basic_write_parameter_prepend_e].values.used - 1]; const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d); // Even though this standard does not utilize this parameter, provide the validation for consistency. if (length) { f_string_range_t range = macro_f_string_range_t_initialize(length); - const f_string_static_t prepend = macro_f_string_static_t_initialize(arguments->argv[index], length); + const f_string_static_t prepend = macro_f_string_static_t_initialize2(arguments->argv[index], length); for (; range.start < length; range.start++) { @@ -375,7 +377,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_write_parameter_ignore_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_write_parameter_ignore_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -388,9 +390,9 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_basic_write_parameter_ignore_e].result == f_console_result_additional_e) { - const f_array_length_t total_locations = main->parameters[fss_basic_write_parameter_ignore_e].locations.used; - const f_array_length_t total_arguments = main->parameters[fss_basic_write_parameter_ignore_e].values.used; + else if (main->parameters.array[fss_basic_write_parameter_ignore_e].result == f_console_result_additional_e) { + const f_array_length_t total_locations = main->parameters.array[fss_basic_write_parameter_ignore_e].locations.used; + const f_array_length_t total_arguments = main->parameters.array[fss_basic_write_parameter_ignore_e].values.used; if (total_locations * 2 > total_arguments) { flockfile(main->error.to.stream); @@ -409,14 +411,14 @@ extern "C" { f_fss_quote_t quote = F_fss_delimit_quote_double_s; if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_write_parameter_double_e].result == f_console_result_found_e) { - if (main->parameters[fss_basic_write_parameter_single_e].result == f_console_result_found_e) { - if (main->parameters[fss_basic_write_parameter_double_e].location < main->parameters[fss_basic_write_parameter_single_e].location) { + if (main->parameters.array[fss_basic_write_parameter_double_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_write_parameter_single_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_write_parameter_double_e].location < main->parameters.array[fss_basic_write_parameter_single_e].location) { quote = F_fss_delimit_quote_single_s; } } } - else if (main->parameters[fss_basic_write_parameter_single_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_basic_write_parameter_single_e].result == f_console_result_found_e) { quote = F_fss_delimit_quote_single_s; } } @@ -444,11 +446,11 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_basic_write_parameter_partial_e].result == f_console_result_found_e) { - if (main->parameters[fss_basic_write_parameter_object_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_write_parameter_object_e].result == f_console_result_additional_e) { content.used = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].values.used; ++i) { if (fss_basic_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -456,7 +458,7 @@ extern "C" { break; } - object.string = arguments->argv[main->parameters[fss_basic_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_basic_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; @@ -467,7 +469,7 @@ extern "C" { else { object.used = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_content_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_content_e].values.used; ++i) { if (fss_basic_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -475,7 +477,7 @@ extern "C" { break; } - content.string = arguments->argv[main->parameters[fss_basic_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_basic_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -485,18 +487,18 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].values.used; ++i) { if (fss_basic_write_signal_received(main)) { status = F_status_set_error(F_interrupt); break; } - object.string = arguments->argv[main->parameters[fss_basic_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_basic_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; - content.string = arguments->argv[main->parameters[fss_basic_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_basic_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -515,7 +517,7 @@ extern "C" { funlockfile(main->error.to.stream); } } - else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters[fss_basic_write_parameter_file_e].result == f_console_result_none_e) { + else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters.array[fss_basic_write_parameter_file_e].result == f_console_result_none_e) { // Ensure there is always a newline at the end, unless in quiet mode. fll_print_dynamic(f_string_eol_s, main->output.to.stream); @@ -534,7 +536,7 @@ extern "C" { content.size = 0; } - if (main->parameters[fss_basic_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_basic_write_parameter_file_e].result == f_console_result_additional_e) { if (output.id != -1) { f_file_stream_close(F_true, &output); } @@ -559,12 +561,7 @@ extern "C" { #ifndef _di_fss_basic_write_main_delete_ f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main) { - for (f_array_length_t i = 0; i < fss_basic_write_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fss_basic_write/c/fss_basic_write.h b/level_3/fss_basic_write/c/fss_basic_write.h index 1d9341e..a869d87 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -158,7 +158,7 @@ extern "C" { #ifndef _di_fss_basic_write_data_ typedef struct { - f_console_parameter_t parameters[fss_basic_write_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -174,7 +174,7 @@ extern "C" { #define fss_basic_write_main_t_initialize \ { \ - fss_basic_write_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_basic_write/c/private-write.c b/level_3/fss_basic_write/c/private-write.c index 533da2e..1c350cd 100644 --- a/level_3/fss_basic_write/c/private-write.c +++ b/level_3/fss_basic_write/c/private-write.c @@ -81,7 +81,7 @@ extern "C" { } if (content) { - if (main->parameters[fss_basic_write_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_basic_write_parameter_trim_e].result == f_console_result_found_e) { complete = f_fss_complete_full_trim_e; } else { diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c index 08ff4a6..7f375e6 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c @@ -8,12 +8,12 @@ extern "C" { #endif #ifndef _di_fss_embedded_list_read_program_version_ - const f_string_static_t fss_embedded_list_read_program_version_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_READ_program_version_s, 0, FSS_EMBEDDED_LIST_READ_program_version_s_length); + const f_string_static_t fss_embedded_list_read_program_version_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_program_version_s, 0, FSS_EMBEDDED_LIST_READ_program_version_s_length); #endif // _di_fss_embedded_list_read_program_version_ #ifndef _di_fss_embedded_list_read_program_name_ - const f_string_static_t fss_embedded_list_read_program_name_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_READ_program_name_s, 0, FSS_EMBEDDED_LIST_READ_program_name_s_length); - const f_string_static_t fss_embedded_list_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_READ_program_name_long_s, 0, FSS_EMBEDDED_LIST_READ_program_name_long_s_length); + const f_string_static_t fss_embedded_list_read_program_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_program_name_s, 0, FSS_EMBEDDED_LIST_READ_program_name_s_length); + const f_string_static_t fss_embedded_list_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_program_name_long_s, 0, FSS_EMBEDDED_LIST_READ_program_name_long_s_length); #endif // _di_fss_embedded_list_read_program_name_ #ifndef _di_fss_embedded_list_read_print_help_ @@ -132,81 +132,83 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_embedded_list_read_total_parameters_d); + f_console_parameter_t parameters[] = fss_embedded_list_read_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_embedded_list_read_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_embedded_list_read_parameter_no_color_e, fss_embedded_list_read_parameter_light_e, fss_embedded_list_read_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_embedded_list_read_parameter_no_color_e, fss_embedded_list_read_parameter_light_e, fss_embedded_list_read_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_embedded_list_read_main_delete(main); - return F_status_set_error(status); - } + if (F_status_is_error(status)) { + fss_embedded_list_read_main_delete(main); + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_embedded_list_read_parameter_verbosity_quiet_e, fss_embedded_list_read_parameter_verbosity_normal_e, fss_embedded_list_read_parameter_verbosity_verbose_e, fss_embedded_list_read_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_embedded_list_read_parameter_verbosity_quiet_e, fss_embedded_list_read_parameter_verbosity_normal_e, fss_embedded_list_read_parameter_verbosity_verbose_e, fss_embedded_list_read_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fss_embedded_list_read_main_delete(main); + if (F_status_is_error(status)) { + fss_embedded_list_read_main_delete(main); - return status; - } - - if (choice == fss_embedded_list_read_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_embedded_list_read_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_embedded_list_read_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_embedded_list_read_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_embedded_list_read_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_embedded_list_read_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_embedded_list_read_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_embedded_list_read_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_embedded_list_read_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_embedded_list_read_parameter_help_e].result == f_console_result_found_e) { fss_embedded_list_read_print_help(main->output.to, main->context); fss_embedded_list_read_main_delete(main); @@ -214,7 +216,7 @@ extern "C" { return F_none; } - if (main->parameters[fss_embedded_list_read_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_embedded_list_read_program_version_s); fss_embedded_list_read_main_delete(main); @@ -222,8 +224,8 @@ extern "C" { return F_none; } - if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { - if (main->parameters[fss_embedded_list_read_parameter_columns_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_columns_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -239,7 +241,7 @@ extern "C" { } if (main->remaining.used > 0 || main->process_pipe) { - if (main->parameters[fss_embedded_list_read_parameter_at_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_at_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -251,7 +253,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_depth_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_depth_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -263,7 +265,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -275,7 +277,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_name_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_name_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -287,7 +289,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_select_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_select_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -299,8 +301,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (main->parameters[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { - if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -315,8 +317,8 @@ extern "C" { } } - if (main->parameters[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { - if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -332,7 +334,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_embedded_list_read_parameter_delimit_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_delimit_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -343,8 +345,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_embedded_list_read_parameter_delimit_e].result == f_console_result_additional_e) { - const f_array_length_t location = main->parameters[fss_embedded_list_read_parameter_delimit_e].values.array[0]; + else if (main->parameters.array[fss_embedded_list_read_parameter_delimit_e].result == f_console_result_additional_e) { + const f_array_length_t location = main->parameters.array[fss_embedded_list_read_parameter_delimit_e].values.array[0]; f_array_length_t length = strnlen(arguments->argv[location], F_console_parameter_size_d); if (length == 0) { @@ -412,7 +414,7 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_select_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_select_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -462,7 +464,7 @@ extern "C" { main->quantity.total = original_size; if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->remaining.array[i]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); break; } @@ -479,7 +481,7 @@ extern "C" { // Skip past empty files. if (!main->quantity.total) { - if (main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { fll_print_format("0%q", main->output.to.stream, f_string_eol_s); } @@ -545,12 +547,7 @@ extern "C" { #ifndef _di_fss_embedded_list_read_main_delete_ f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main) { - for (f_array_length_t i = 0; i < fss_embedded_list_read_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); macro_f_fss_nest_t_delete_simple(main->nest); diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h index 75738e2..8ca572e 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h @@ -205,7 +205,7 @@ extern "C" { #ifndef _di_fss_embedded_list_read_main_t_ typedef struct { - f_console_parameter_t parameters[fss_embedded_list_read_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -228,7 +228,7 @@ extern "C" { #define fss_embedded_list_read_main_t_initialize \ { \ - fss_embedded_list_read_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_embedded_list_read/c/private-print.c b/level_3/fss_embedded_list_read/c/private-print.c index 8bfedeb..2dec272 100644 --- a/level_3/fss_embedded_list_read/c/private-print.c +++ b/level_3/fss_embedded_list_read/c/private-print.c @@ -9,11 +9,11 @@ extern "C" { #ifndef _di_fss_embedded_list_read_print_object_end_ void fss_embedded_list_read_print_object_end(fss_embedded_list_read_main_t * const main) { - if (main->parameters[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_embedded_list_read_pipe_content_start_s, main->output.to.stream); } else { - if (main->parameters[fss_embedded_list_read_parameter_object_e].result == f_console_result_found_e && main->parameters[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_object_e].result == f_console_result_found_e && main->parameters.array[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) { f_print_character(f_fss_embedded_list_open_s.string[0], main->output.to.stream); f_print_character(f_fss_embedded_list_open_end_s.string[0], main->output.to.stream); } @@ -27,7 +27,7 @@ extern "C" { #ifndef _di_fss_embedded_list_read_print_content_ignore_ void fss_embedded_list_read_print_content_ignore(fss_embedded_list_read_main_t * const main) { - if (main->parameters[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_embedded_list_read_pipe_content_ignore_s, main->output.to.stream); } } @@ -36,11 +36,11 @@ extern "C" { #ifndef _di_fss_embedded_list_read_print_set_end_ void fss_embedded_list_read_print_set_end(fss_embedded_list_read_main_t * const main) { - if (main->parameters[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_embedded_list_read_pipe_content_end_s, main->output.to.stream); } else { - if (main->parameters[fss_embedded_list_read_parameter_object_e].result == f_console_result_found_e && main->parameters[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_object_e].result == f_console_result_found_e && main->parameters.array[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) { f_print_character(f_fss_embedded_list_close_s.string[0], main->output.to.stream); f_print_character(f_fss_embedded_list_close_end_s.string[0], main->output.to.stream); } diff --git a/level_3/fss_embedded_list_read/c/private-read.c b/level_3/fss_embedded_list_read/c/private-read.c index 8728436..7098b84 100644 --- a/level_3/fss_embedded_list_read/c/private-read.c +++ b/level_3/fss_embedded_list_read/c/private-read.c @@ -12,7 +12,7 @@ extern "C" { f_status_t status = F_none; - const f_array_length_t values_total = main->parameters[fss_embedded_list_read_parameter_depth_e].values.used + main->parameters[fss_embedded_list_read_parameter_at_e].values.used + main->parameters[fss_embedded_list_read_parameter_name_e].values.used; + const f_array_length_t values_total = main->parameters.array[fss_embedded_list_read_parameter_depth_e].values.used + main->parameters.array[fss_embedded_list_read_parameter_at_e].values.used + main->parameters.array[fss_embedded_list_read_parameter_name_e].values.used; f_array_length_t values_order[values_total]; f_array_length_t values_type[values_total]; @@ -27,24 +27,24 @@ extern "C" { f_array_length_t k = 0; f_array_length_t l = 0; - for (; j < main->parameters[fss_embedded_list_read_parameter_depth_e].values.used; ++j) { + for (; j < main->parameters.array[fss_embedded_list_read_parameter_depth_e].values.used; ++j) { - values_order[i] = main->parameters[fss_embedded_list_read_parameter_depth_e].values.array[j]; + values_order[i] = main->parameters.array[fss_embedded_list_read_parameter_depth_e].values.array[j]; values_type[i++] = fss_embedded_list_read_parameter_depth_e; } // for if (i) { - for (j = 0; j < main->parameters[fss_embedded_list_read_parameter_at_e].values.used; ++j) { + for (j = 0; j < main->parameters.array[fss_embedded_list_read_parameter_at_e].values.used; ++j) { for (k = 0; k < i; ++k) { - if (values_order[k] > main->parameters[fss_embedded_list_read_parameter_at_e].values.array[j]) { + if (values_order[k] > main->parameters.array[fss_embedded_list_read_parameter_at_e].values.array[j]) { for (l = i; l > k; --l) { values_order[l] = values_order[l - 1]; values_type[l] = values_type[l - 1]; } // for - values_order[k] = main->parameters[fss_embedded_list_read_parameter_at_e].values.array[j]; + values_order[k] = main->parameters.array[fss_embedded_list_read_parameter_at_e].values.array[j]; values_type[k] = fss_embedded_list_read_parameter_at_e; i++; @@ -53,31 +53,31 @@ extern "C" { } // for if (k == i) { - values_order[i] = main->parameters[fss_embedded_list_read_parameter_at_e].values.array[j]; + values_order[i] = main->parameters.array[fss_embedded_list_read_parameter_at_e].values.array[j]; values_type[i++] = fss_embedded_list_read_parameter_at_e; } } // for } else { - for (; j < main->parameters[fss_embedded_list_read_parameter_at_e].values.used; ++j) { + for (; j < main->parameters.array[fss_embedded_list_read_parameter_at_e].values.used; ++j) { - values_order[i] = main->parameters[fss_embedded_list_read_parameter_at_e].values.array[j]; + values_order[i] = main->parameters.array[fss_embedded_list_read_parameter_at_e].values.array[j]; values_type[i++] = fss_embedded_list_read_parameter_at_e; } // for } if (i) { - for (j = 0; j < main->parameters[fss_embedded_list_read_parameter_name_e].values.used; ++j) { + for (j = 0; j < main->parameters.array[fss_embedded_list_read_parameter_name_e].values.used; ++j) { for (k = 0; k < i; ++k) { - if (values_order[k] > main->parameters[fss_embedded_list_read_parameter_name_e].values.array[j]) { + if (values_order[k] > main->parameters.array[fss_embedded_list_read_parameter_name_e].values.array[j]) { for (l = i; l > k; --l) { values_order[l] = values_order[l - 1]; values_type[l] = values_type[l - 1]; } // for - values_order[k] = main->parameters[fss_embedded_list_read_parameter_name_e].values.array[j]; + values_order[k] = main->parameters.array[fss_embedded_list_read_parameter_name_e].values.array[j]; values_type[k] = fss_embedded_list_read_parameter_name_e; i++; @@ -86,15 +86,15 @@ extern "C" { } // for if (k == i) { - values_order[i] = main->parameters[fss_embedded_list_read_parameter_name_e].values.array[j]; + values_order[i] = main->parameters.array[fss_embedded_list_read_parameter_name_e].values.array[j]; values_type[i++] = fss_embedded_list_read_parameter_name_e; } } // for } else { - for (; j < main->parameters[fss_embedded_list_read_parameter_name_e].values.used; ++j) { + for (; j < main->parameters.array[fss_embedded_list_read_parameter_name_e].values.used; ++j) { - values_order[i] = main->parameters[fss_embedded_list_read_parameter_name_e].values.array[j]; + values_order[i] = main->parameters.array[fss_embedded_list_read_parameter_name_e].values.array[j]; values_type[i++] = fss_embedded_list_read_parameter_name_e; } // for } @@ -103,8 +103,8 @@ extern "C" { { i = 1; - if (main->parameters[fss_embedded_list_read_parameter_depth_e].result == f_console_result_additional_e) { - i = main->parameters[fss_embedded_list_read_parameter_depth_e].values.used + 1; + if (main->parameters.array[fss_embedded_list_read_parameter_depth_e].result == f_console_result_additional_e) { + i = main->parameters.array[fss_embedded_list_read_parameter_depth_e].values.used + 1; } macro_fss_embedded_list_read_depths_t_resize(status, (*depths), i); @@ -171,7 +171,7 @@ extern "C" { depths->array[depths->used].index_name = values_order[i]; depths->array[depths->used].value_name.used = 0; - if (main->parameters[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { status = fl_string_rip(arguments->argv[values_order[i]], strnlen(arguments->argv[values_order[i]], F_console_parameter_size_d), &depths->array[depths->used].value_name); if (F_status_is_error(status)) { @@ -251,13 +251,13 @@ extern "C" { if (F_status_is_error(status)) { // @todo detect and replace fll_error_file_type_file_e with fll_error_file_type_pipe_e as appropriate. - fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_embedded_list_read", F_true, filename, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_embedded_list_read", F_true, filename, f_file_operation_process_s, fll_error_file_type_file_e); } else if (status == F_data_not_stop || status == F_data_not_eos) { macro_f_fss_nest_t_delete_simple(main->nest); f_string_dynamic_resize(0, &main->buffer); - if (main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { fll_print_format("0%q", main->output.to.stream, f_string_eol_s); return F_none; @@ -287,7 +287,7 @@ extern "C" { // Requested depths cannot be greater than contents depth. if (depths.used > main->nest.used) { - if (main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { fll_print_format("0%q", main->output.to.stream, f_string_eol_s); return F_none; @@ -299,8 +299,8 @@ extern "C" { { f_number_unsigned_t select = 0; - if (main->parameters[fss_embedded_list_read_parameter_select_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_embedded_list_read_parameter_select_e].values.array[main->parameters[fss_embedded_list_read_parameter_select_e].values.used - 1]; + if (main->parameters.array[fss_embedded_list_read_parameter_select_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_embedded_list_read_parameter_select_e].values.array[main->parameters.array[fss_embedded_list_read_parameter_select_e].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[index])); status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &select); @@ -320,8 +320,8 @@ extern "C" { f_array_length_t line = 0; - if (main->parameters[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_embedded_list_read_parameter_line_e].values.array[main->parameters[fss_embedded_list_read_parameter_line_e].values.used - 1]; + if (main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_embedded_list_read_parameter_line_e].values.array[main->parameters.array[fss_embedded_list_read_parameter_line_e].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[index])); status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &line); @@ -338,7 +338,7 @@ extern "C" { const fss_embedded_list_read_skip_t parents = fss_embedded_list_read_skip_t_initialize; - if (main->parameters[fss_embedded_list_read_parameter_raw_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_raw_e].result == f_console_result_found_e) { f_fss_delimits_t except_none = f_fss_delimits_t_initialize; return fss_embedded_list_read_main_process_for_depth(main, arguments, filename, depths, 0, line, parents, &except_none, &except_none); @@ -390,7 +390,7 @@ extern "C" { if (depths.array[depths_index].value_at < items->used && !skip[depths.array[depths_index].value_at]) { if (depths.array[depths_index].index_name) { - if (main->parameters[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { if (fl_string_dynamic_partial_compare_except_trim_dynamic(depths.array[depths_index].value_name, main->buffer, items->array[depths.array[depths_index].value_at].object, except_none, *objects_delimits) != F_equal_to) { skip[depths.array[depths_index].value_at] = F_true; @@ -405,7 +405,7 @@ extern "C" { } } else { - if (main->parameters[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { for (i = 0; i < items->used; ++i) { if (skip[i]) continue; @@ -498,8 +498,8 @@ extern "C" { f_array_length_t i = 0; f_array_length_t j = 0; - if (main->parameters[fss_embedded_list_read_parameter_object_e].result == f_console_result_found_e) { - if (main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_object_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { f_array_length_t total = 0; for (i = 0; i < items->used; ++i) { @@ -515,7 +515,7 @@ extern "C" { f_status_t (*print_object)(const f_string_static_t, const f_string_range_t, const f_array_lengths_t, FILE *) = &f_print_except_dynamic_partial; - if (main->parameters[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { print_object = &fl_print_trim_except_dynamic_partial; } @@ -527,7 +527,7 @@ extern "C" { print_object(main->buffer, items->array[i].object, *objects_delimits, main->output.to.stream); - if (main->parameters[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) { fss_embedded_list_read_print_object_end(main); if (items->array[i].content.used) { @@ -546,11 +546,11 @@ extern "C" { // Process contents. bool include_empty = 0; - if (main->parameters[fss_embedded_list_read_parameter_empty_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_empty_e].result == f_console_result_found_e) { include_empty = 1; } - if (main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) { f_array_length_t total = 0; for (i = 0; i < items->used; ++i) { @@ -584,7 +584,7 @@ extern "C" { return F_none; } - if (main->parameters[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { f_array_length_t line_current = 0; flockfile(main->output.to.stream); @@ -665,7 +665,7 @@ extern "C" { f_print_except_dynamic_partial(main->buffer, items->array[i].content.array[0], *contents_delimits, main->output.to.stream); - if (main->parameters[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_embedded_list_read_pipe_content_end_s, main->output.to.stream); } } // for diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index bcf9f6a..18df544 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_fss_embedded_list_write_program_version_ - const f_string_static_t fss_embedded_list_write_program_version_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_WRITE_program_version_s, 0, FSS_EMBEDDED_LIST_WRITE_program_version_s_length); + const f_string_static_t fss_embedded_list_write_program_version_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_program_version_s, 0, FSS_EMBEDDED_LIST_WRITE_program_version_s_length); #endif // _di_fss_embedded_list_write_program_version_ #ifndef _di_fss_embedded_list_write_program_name_ - const f_string_static_t fss_embedded_list_write_program_name_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_WRITE_program_name_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_s_length); - const f_string_static_t fss_embedded_list_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_WRITE_program_name_long_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_long_s_length); + const f_string_static_t fss_embedded_list_write_program_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_program_name_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_s_length); + const f_string_static_t fss_embedded_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_program_name_long_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_long_s_length); #endif // _di_fss_embedded_list_write_program_name_ #ifndef _di_fss_embedded_list_write_print_help_ @@ -73,82 +73,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_embedded_list_write_total_parameters_d); + f_console_parameter_t parameters[] = fss_embedded_list_write_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_embedded_list_write_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_embedded_list_write_parameter_no_color_e, fss_embedded_list_write_parameter_light_e, fss_embedded_list_write_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_embedded_list_write_parameter_no_color_e, fss_embedded_list_write_parameter_light_e, fss_embedded_list_write_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_embedded_list_write_main_delete(main); + if (F_status_is_error(status)) { + fss_embedded_list_write_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_embedded_list_write_parameter_verbosity_quiet_e, fss_embedded_list_write_parameter_verbosity_normal_e, fss_embedded_list_write_parameter_verbosity_verbose_e, fss_embedded_list_write_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_embedded_list_write_parameter_verbosity_quiet_e, fss_embedded_list_write_parameter_verbosity_normal_e, fss_embedded_list_write_parameter_verbosity_verbose_e, fss_embedded_list_write_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fss_embedded_list_write_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + fss_embedded_list_write_main_delete(main); - if (choice == fss_embedded_list_write_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_embedded_list_write_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_embedded_list_write_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_embedded_list_write_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_embedded_list_write_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_embedded_list_write_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_embedded_list_write_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_embedded_list_write_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_embedded_list_write_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_embedded_list_write_parameter_help_e].result == f_console_result_found_e) { fss_embedded_list_write_print_help(main->output.to, main->context); fss_embedded_list_write_main_delete(main); @@ -156,7 +158,7 @@ extern "C" { return status; } - if (main->parameters[fss_embedded_list_write_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_embedded_list_write_program_version_s); fss_embedded_list_write_main_delete(main); @@ -171,8 +173,8 @@ extern "C" { output.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; if (F_status_is_error_not(status)) { - if (main->parameters[fss_embedded_list_write_parameter_file_e].result == f_console_result_additional_e) { - if (main->parameters[fss_embedded_list_write_parameter_file_e].values.used > 1) { + if (main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_file_e].values.used > 1) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -186,40 +188,40 @@ extern "C" { status = F_status_set_error(F_parameter); } else { - const f_array_length_t location = main->parameters[fss_embedded_list_write_parameter_file_e].values.array[0]; + const f_array_length_t location = main->parameters.array[fss_embedded_list_write_parameter_file_e].values.array[0]; output.id = -1; output.stream = 0; status = f_file_stream_open(arguments->argv[location], 0, &output); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], f_file_operation_open_s, fll_error_file_type_file_e); } } } - else if (main->parameters[fss_embedded_list_write_parameter_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_found_e) { fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string.string, fss_embedded_list_write_long_file_s); status = F_status_set_error(F_parameter); } } if (F_status_is_error_not(status)) { - if (main->parameters[fss_embedded_list_write_parameter_object_e].locations.used || main->parameters[fss_embedded_list_write_parameter_content_e].locations.used) { - if (main->parameters[fss_embedded_list_write_parameter_object_e].locations.used) { - if (main->parameters[fss_embedded_list_write_parameter_object_e].locations.used != main->parameters[fss_embedded_list_write_parameter_object_e].values.used) { + if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used || main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used) { + if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used != main->parameters.array[fss_embedded_list_write_parameter_object_e].values.used) { fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_embedded_list_write_parameter_content_e].locations.used != main->parameters[fss_embedded_list_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used != main->parameters.array[fss_embedded_list_write_parameter_content_e].values.used) { fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_embedded_list_write_parameter_object_e].locations.used != main->parameters[fss_embedded_list_write_parameter_content_e].locations.used && main->parameters[fss_embedded_list_write_parameter_partial_e].result == f_console_result_none_e) { + else if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used != main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used && main->parameters.array[fss_embedded_list_write_parameter_partial_e].result == f_console_result_none_e) { fss_embedded_list_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_embedded_list_write_parameter_content_e].locations.used && main->parameters[fss_embedded_list_write_parameter_partial_e].locations.used) { - if (main->parameters[fss_embedded_list_write_parameter_content_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used && main->parameters.array[fss_embedded_list_write_parameter_partial_e].locations.used) { + if (main->parameters.array[fss_embedded_list_write_parameter_content_e].result == f_console_result_additional_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -239,17 +241,17 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_embedded_list_write_parameter_content_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_content_e].result == f_console_result_additional_e) { f_array_length_t location_object = 0; f_array_length_t location_content = 0; f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object_e].locations.used; ++i) { - location_object = main->parameters[fss_embedded_list_write_parameter_object_e].locations.array[i]; - location_content = main->parameters[fss_embedded_list_write_parameter_content_e].locations.array[i]; - location_sub_object = main->parameters[fss_embedded_list_write_parameter_object_e].locations_sub.array[i]; - location_sub_content = main->parameters[fss_embedded_list_write_parameter_content_e].locations_sub.array[i]; + for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used; ++i) { + location_object = main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.array[i]; + location_content = main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.array[i]; + location_sub_object = main->parameters.array[fss_embedded_list_write_parameter_object_e].locations_sub.array[i]; + location_sub_content = main->parameters.array[fss_embedded_list_write_parameter_content_e].locations_sub.array[i]; if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -272,12 +274,12 @@ extern "C" { } } } - else if (main->parameters[fss_embedded_list_write_parameter_content_e].locations.used) { - if (main->parameters[fss_embedded_list_write_parameter_content_e].locations.used != main->parameters[fss_embedded_list_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used != main->parameters.array[fss_embedded_list_write_parameter_content_e].values.used) { fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (!main->parameters[fss_embedded_list_write_parameter_partial_e].locations.used) { + else if (!main->parameters.array[fss_embedded_list_write_parameter_partial_e].locations.used) { fss_embedded_list_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } @@ -300,7 +302,7 @@ extern "C" { } if (F_status_is_error_not(status) && main->process_pipe) { - if (main->parameters[fss_embedded_list_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_partial_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -317,7 +319,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_embedded_list_write_parameter_prepend_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_prepend_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -330,8 +332,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_embedded_list_write_parameter_prepend_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_embedded_list_write_parameter_prepend_e].values.array[main->parameters[fss_embedded_list_write_parameter_prepend_e].values.used - 1]; + else if (main->parameters.array[fss_embedded_list_write_parameter_prepend_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_embedded_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_embedded_list_write_parameter_prepend_e].values.used - 1]; const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d); if (length) { @@ -380,7 +382,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_embedded_list_write_parameter_ignore_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_ignore_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -393,9 +395,9 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_embedded_list_write_parameter_ignore_e].result == f_console_result_additional_e) { - const f_array_length_t total_locations = main->parameters[fss_embedded_list_write_parameter_ignore_e].locations.used; - const f_array_length_t total_arguments = main->parameters[fss_embedded_list_write_parameter_ignore_e].values.used; + else if (main->parameters.array[fss_embedded_list_write_parameter_ignore_e].result == f_console_result_additional_e) { + const f_array_length_t total_locations = main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.used; + const f_array_length_t total_arguments = main->parameters.array[fss_embedded_list_write_parameter_ignore_e].values.used; if (total_locations * 2 > total_arguments) { flockfile(main->error.to.stream); @@ -414,14 +416,14 @@ extern "C" { f_fss_quote_t quote = F_fss_delimit_quote_double_s; if (F_status_is_error_not(status)) { - if (main->parameters[fss_embedded_list_write_parameter_double_e].result == f_console_result_found_e) { - if (main->parameters[fss_embedded_list_write_parameter_single_e].result == f_console_result_found_e) { - if (main->parameters[fss_embedded_list_write_parameter_double_e].location < main->parameters[fss_embedded_list_write_parameter_single_e].location) { + if (main->parameters.array[fss_embedded_list_write_parameter_double_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_single_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_double_e].location < main->parameters.array[fss_embedded_list_write_parameter_single_e].location) { quote = F_fss_delimit_quote_single_s; } } } - else if (main->parameters[fss_embedded_list_write_parameter_single_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_embedded_list_write_parameter_single_e].result == f_console_result_found_e) { quote = F_fss_delimit_quote_single_s; } } @@ -452,10 +454,10 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_embedded_list_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_partial_e].result == f_console_result_found_e) { - if (main->parameters[fss_embedded_list_write_parameter_object_e].result == f_console_result_additional_e) { - for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object_e].values.used; ++i) { + if (main->parameters.array[fss_embedded_list_write_parameter_object_e].result == f_console_result_additional_e) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_object_e].values.used; ++i) { if (fss_embedded_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -463,7 +465,7 @@ extern "C" { break; } - object.string = arguments->argv[main->parameters[fss_embedded_list_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_embedded_list_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; @@ -472,7 +474,7 @@ extern "C" { } // for } else { - for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_content_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_content_e].values.used; ++i) { if (fss_embedded_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -480,10 +482,10 @@ extern "C" { break; } - status = fss_embedded_list_write_process_parameter_ignore(main, arguments, main->parameters[fss_embedded_list_write_parameter_content_e].locations, i, &ignore); + status = fss_embedded_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore); if (F_status_is_error(status)) break; - content.string = arguments->argv[main->parameters[fss_embedded_list_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_embedded_list_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -493,7 +495,7 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_object_e].values.used; ++i) { if (fss_embedded_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -501,14 +503,14 @@ extern "C" { break; } - status = fss_embedded_list_write_process_parameter_ignore(main, arguments, main->parameters[fss_embedded_list_write_parameter_content_e].locations, i, &ignore); + status = fss_embedded_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore); if (F_status_is_error(status)) break; - object.string = arguments->argv[main->parameters[fss_embedded_list_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_embedded_list_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; - content.string = arguments->argv[main->parameters[fss_embedded_list_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_embedded_list_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -527,7 +529,7 @@ extern "C" { funlockfile(main->error.to.stream); } } - else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters[fss_embedded_list_write_parameter_file_e].result == f_console_result_none_e) { + else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_none_e) { // Ensure there is always a newline at the end, unless in quiet mode. fll_print_dynamic(f_string_eol_s, main->output.to.stream); @@ -547,7 +549,7 @@ extern "C" { content.size = 0; } - if (main->parameters[fss_embedded_list_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_additional_e) { if (output.id != -1) { f_file_stream_close(F_true, &output); } @@ -572,12 +574,7 @@ extern "C" { #ifndef _di_fss_embedded_list_write_main_delete_ f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main) { - for (f_array_length_t i = 0; i < fss_embedded_list_write_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h index d909d50..8e24dc7 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h @@ -158,7 +158,7 @@ extern "C" { #ifndef _di_fss_embedded_list_write_main_t_ typedef struct { - f_console_parameter_t parameters[fss_embedded_list_write_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -176,7 +176,7 @@ extern "C" { #define fss_embedded_list_write_main_t_initialize \ { \ - fss_embedded_list_write_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_embedded_list_write/c/private-write.c b/level_3/fss_embedded_list_write/c/private-write.c index 4042c5c..d3fb686 100644 --- a/level_3/fss_embedded_list_write/c/private-write.c +++ b/level_3/fss_embedded_list_write/c/private-write.c @@ -81,7 +81,7 @@ extern "C" { } if (content) { - if (main->parameters[fss_embedded_list_write_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_embedded_list_write_parameter_trim_e].result == f_console_result_found_e) { complete = f_fss_complete_full_trim_e; } else { @@ -367,13 +367,13 @@ extern "C" { range.start = 0; - for (; i < main->parameters[fss_embedded_list_write_parameter_ignore_e].locations.used; ++i) { + for (; i < main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.used; ++i) { if (fss_embedded_list_write_signal_received(main)) { return F_status_set_error(F_interrupt); } - l = main->parameters[fss_embedded_list_write_parameter_ignore_e].locations.array[i]; + l = main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.array[i]; if (l < contents.array[location]) continue; if (location + 1 < contents.used && l > contents.array[location + 1]) continue; @@ -399,7 +399,7 @@ extern "C" { } } - index = main->parameters[fss_embedded_list_write_parameter_ignore_e].values.array[i * 2]; + index = main->parameters.array[fss_embedded_list_write_parameter_ignore_e].values.array[i * 2]; range.start = 0; range.stop = strnlen(arguments->argv[index], F_console_parameter_size_d) - 1; @@ -419,7 +419,7 @@ extern "C" { ignore->array[ignore->used].start = number; - index = main->parameters[fss_embedded_list_write_parameter_ignore_e].values.array[(i * 2) + 1]; + index = main->parameters.array[fss_embedded_list_write_parameter_ignore_e].values.array[(i * 2) + 1]; range.start = 0; range.stop = strnlen(arguments->argv[index], F_console_parameter_size_d) - 1; diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index f0e8c4a..9d72c8c 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.c @@ -8,12 +8,12 @@ extern "C" { #endif #ifndef _di_fss_extended_list_read_program_version_ - const f_string_static_t fss_extended_list_read_program_version_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_READ_program_version_s, 0, FSS_EXTENDED_LIST_READ_program_version_s_length); + const f_string_static_t fss_extended_list_read_program_version_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_program_version_s, 0, FSS_EXTENDED_LIST_READ_program_version_s_length); #endif // _di_fss_extended_list_read_program_version_ #ifndef _di_fss_extended_list_read_program_name_ - const f_string_static_t fss_extended_list_read_program_name_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_READ_program_name_s, 0, FSS_EXTENDED_LIST_READ_program_name_s_length); - const f_string_static_t fss_extended_list_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_READ_program_name_long_s, 0, FSS_EXTENDED_LIST_READ_program_name_long_s_length); + const f_string_static_t fss_extended_list_read_program_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_program_name_s, 0, FSS_EXTENDED_LIST_READ_program_name_s_length); + const f_string_static_t fss_extended_list_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_program_name_long_s, 0, FSS_EXTENDED_LIST_READ_program_name_long_s_length); #endif // _di_fss_extended_list_read_program_name_ #ifndef _di_fss_extended_list_read_print_help_ @@ -131,82 +131,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_extended_list_read_total_parameters_d); + f_console_parameter_t parameters[] = fss_extended_list_read_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_extended_list_read_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_extended_list_read_parameter_no_color_e, fss_extended_list_read_parameter_light_e, fss_extended_list_read_parameter_dark_e }; - const f_console_parameter_ids_t choices = { ids, 3 }; + { + f_console_parameter_id_t ids[3] = { fss_extended_list_read_parameter_no_color_e, fss_extended_list_read_parameter_light_e, fss_extended_list_read_parameter_dark_e }; + const f_console_parameter_ids_t choices = { ids, 3 }; - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_extended_list_read_main_delete(main); + if (F_status_is_error(status)) { + fss_extended_list_read_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_extended_list_read_parameter_verbosity_quiet_e, fss_extended_list_read_parameter_verbosity_normal_e, fss_extended_list_read_parameter_verbosity_verbose_e, fss_extended_list_read_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_extended_list_read_parameter_verbosity_quiet_e, fss_extended_list_read_parameter_verbosity_normal_e, fss_extended_list_read_parameter_verbosity_verbose_e, fss_extended_list_read_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fss_extended_list_read_main_delete(main); - - return status; - } + if (F_status_is_error(status)) { + fss_extended_list_read_main_delete(main); - if (choice == fss_extended_list_read_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_extended_list_read_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_extended_list_read_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_extended_list_read_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_extended_list_read_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_extended_list_read_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_extended_list_read_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_extended_list_read_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_extended_list_read_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_extended_list_read_parameter_help_e].result == f_console_result_found_e) { fss_extended_list_read_print_help(main->output.to, main->context); fss_extended_list_read_main_delete(main); @@ -214,7 +216,7 @@ extern "C" { return status; } - if (main->parameters[fss_extended_list_read_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_extended_list_read_program_version_s); fss_extended_list_read_main_delete(main); @@ -268,7 +270,7 @@ extern "C" { for (f_array_length_t i = 0; i < 6; ++i) { - if (main->parameters[parameter_code[i]].result == f_console_result_found_e) { + if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -284,7 +286,7 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_extended_list_read_parameter_columns_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_extended_list_read_parameter_columns_e].result == f_console_result_found_e) { const f_array_length_t parameter_code[] = { fss_extended_list_read_parameter_depth_e, fss_extended_list_read_parameter_line_e, @@ -311,7 +313,7 @@ extern "C" { for (f_array_length_t i = 0; i < 5; ++i) { - if (main->parameters[parameter_code[i]].result == parameter_match[i]) { + if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -329,8 +331,8 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) { - if (main->parameters[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -343,7 +345,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -358,14 +360,14 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[fss_extended_list_read_parameter_delimit_e].result == f_console_result_additional_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_extended_list_read_parameter_delimit_e].result == f_console_result_additional_e) { f_array_length_t location = 0; f_array_length_t length = 0; // Set the value to 0 to allow for detecting mode based on what is provided. data.delimit_mode = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_read_parameter_delimit_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.used; ++i) { if (fss_extended_list_read_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -373,7 +375,7 @@ extern "C" { break; } - location = main->parameters[fss_extended_list_read_parameter_delimit_e].values.array[i]; + location = main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.array[i]; length = strnlen(arguments->argv[location], F_console_parameter_size_d); if (!length) { @@ -500,7 +502,7 @@ extern "C" { // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file. if (F_status_is_error_not(status) && data.depths.array[0].depth > 0) { - if (main->parameters[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) { fss_extended_list_read_print_zero(main); } @@ -510,7 +512,7 @@ extern "C" { return F_none; } - if (F_status_is_error_not(status) && main->parameters[fss_extended_list_read_parameter_select_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_extended_list_read_parameter_select_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -578,7 +580,7 @@ extern "C" { status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); break; } @@ -660,12 +662,7 @@ extern "C" { #ifndef _di_fss_extended_list_read_main_delete_ f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main) { - for (f_array_length_t i = 0; i < fss_extended_list_read_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); macro_f_color_context_t_delete_simple(main->context); diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.h b/level_3/fss_extended_list_read/c/fss_extended_list_read.h index 038cf34..0b02f34 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.h @@ -224,7 +224,7 @@ extern "C" { #ifndef _di_fss_extended_list_read_main_t_ typedef struct { - f_console_parameter_t parameters[fss_extended_list_read_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -240,7 +240,7 @@ extern "C" { #define fss_extended_list_read_main_t_initialize \ { \ - fss_extended_list_read_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_extended_list_read/c/private-print.c b/level_3/fss_extended_list_read/c/private-print.c index 69c7098..fef2792 100644 --- a/level_3/fss_extended_list_read/c/private-print.c +++ b/level_3/fss_extended_list_read/c/private-print.c @@ -67,7 +67,7 @@ extern "C" { #ifndef _di_fss_extended_list_read_print_content_ignore_ void fss_extended_list_read_print_content_ignore(fss_extended_list_read_main_t * const main) { - if (main->parameters[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_extended_list_read_pipe_content_ignore, main->output.to.stream); } } @@ -76,7 +76,7 @@ extern "C" { #ifndef _di_fss_extended_list_read_print_object_end_ void fss_extended_list_read_print_object_end(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data) { - if (main->parameters[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_extended_list_read_pipe_content_start, main->output.to.stream); } else { @@ -91,7 +91,7 @@ extern "C" { #ifndef _di_fss_extended_list_read_print_set_end_ void fss_extended_list_read_print_set_end(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data) { - if (main->parameters[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_extended_list_read_pipe_content_end, main->output.to.stream); } else { diff --git a/level_3/fss_extended_list_read/c/private-read.c b/level_3/fss_extended_list_read/c/private-read.c index 789e36e..b3eaed9 100644 --- a/level_3/fss_extended_list_read/c/private-read.c +++ b/level_3/fss_extended_list_read/c/private-read.c @@ -63,8 +63,8 @@ extern "C" { { f_array_length_t depth_size = 1; - if (main->parameters[fss_extended_list_read_parameter_depth_e].result == f_console_result_additional_e) { - depth_size = main->parameters[fss_extended_list_read_parameter_depth_e].values.used; + if (main->parameters.array[fss_extended_list_read_parameter_depth_e].result == f_console_result_additional_e) { + depth_size = main->parameters.array[fss_extended_list_read_parameter_depth_e].values.used; } if (depth_size > data->depths.size) { @@ -97,11 +97,11 @@ extern "C" { macro_f_string_dynamic_t_clear(data->depths.array[i].value_name); - if (!main->parameters[fss_extended_list_read_parameter_depth_e].values.used) { + if (!main->parameters.array[fss_extended_list_read_parameter_depth_e].values.used) { position_depth = 0; } else { - position_depth = main->parameters[fss_extended_list_read_parameter_depth_e].values.array[i]; + position_depth = main->parameters.array[fss_extended_list_read_parameter_depth_e].values.array[i]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth])); @@ -114,18 +114,18 @@ extern "C" { } } - if (main->parameters[fss_extended_list_read_parameter_at_e].result == f_console_result_additional_e) { - for (; position_at < main->parameters[fss_extended_list_read_parameter_at_e].values.used; ++position_at) { + if (main->parameters.array[fss_extended_list_read_parameter_at_e].result == f_console_result_additional_e) { + for (; position_at < main->parameters.array[fss_extended_list_read_parameter_at_e].values.used; ++position_at) { - if (main->parameters[fss_extended_list_read_parameter_at_e].values.array[position_at] < position_depth) { + if (main->parameters.array[fss_extended_list_read_parameter_at_e].values.array[position_at] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_extended_list_read_parameter_at_e].values.array[position_at] > main->parameters[fss_extended_list_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_extended_list_read_parameter_at_e].values.array[position_at] > main->parameters.array[fss_extended_list_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_at = main->parameters[fss_extended_list_read_parameter_at_e].values.array[position_at]; + data->depths.array[i].index_at = main->parameters.array[fss_extended_list_read_parameter_at_e].values.array[position_at]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at])); @@ -139,20 +139,20 @@ extern "C" { } // for } - if (main->parameters[fss_extended_list_read_parameter_name_e].result == f_console_result_additional_e) { - for (; position_name < main->parameters[fss_extended_list_read_parameter_name_e].values.used; ++position_name) { + if (main->parameters.array[fss_extended_list_read_parameter_name_e].result == f_console_result_additional_e) { + for (; position_name < main->parameters.array[fss_extended_list_read_parameter_name_e].values.used; ++position_name) { - if (main->parameters[fss_extended_list_read_parameter_name_e].values.array[position_name] < position_depth) { + if (main->parameters.array[fss_extended_list_read_parameter_name_e].values.array[position_name] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_extended_list_read_parameter_name_e].values.array[position_name] > main->parameters[fss_extended_list_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_extended_list_read_parameter_name_e].values.array[position_name] > main->parameters.array[fss_extended_list_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_name = main->parameters[fss_extended_list_read_parameter_name_e].values.array[position_name]; + data->depths.array[i].index_name = main->parameters.array[fss_extended_list_read_parameter_name_e].values.array[position_name]; - if (main->parameters[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e) { status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name); } else { @@ -160,7 +160,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), main->parameters[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); + fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); return status; } @@ -248,7 +248,7 @@ extern "C" { if (F_status_is_error(status)) { const f_string_t file_name = fss_extended_list_read_file_identify(input.start, data->files); - fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_list_read", F_true, file_name, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_list_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); return status; } @@ -270,8 +270,8 @@ extern "C" { #ifndef _di_fss_extended_list_read_load_number_ f_status_t fss_extended_list_read_load_number(fss_extended_list_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) { - if (main->parameters[parameter].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1]; + if (main->parameters.array[parameter].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number); @@ -297,7 +297,7 @@ extern "C" { // This standard does not support multiple content groups. if ((data->option & fss_extended_list_read_data_option_select_d) && data->select) { - if (main->parameters[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) { fss_extended_list_read_print_zero(main); } @@ -651,53 +651,53 @@ extern "C" { f_status_t status = F_none; - if (main->parameters[fss_extended_list_read_parameter_at_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_list_read_parameter_at_e].result == f_console_result_additional_e) { data->option |= fss_extended_list_read_data_option_at_d; } - if (main->parameters[fss_extended_list_read_parameter_columns_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_columns_e].result == f_console_result_found_e) { data->option |= fss_extended_list_read_data_option_columns_d; } - if (main->parameters[fss_extended_list_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_content_e].result == f_console_result_found_e) { data->option |= fss_extended_list_read_data_option_content_d; } - if (main->parameters[fss_extended_list_read_parameter_empty_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_empty_e].result == f_console_result_found_e) { data->option |= fss_extended_list_read_data_option_empty_d; } - if (main->parameters[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_extended_list_read_data_option_line_d; status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_line_e, fss_extended_list_read_long_line_s, arguments, &data->line); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_extended_list_read_parameter_name_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_list_read_parameter_name_e].result == f_console_result_additional_e) { data->option |= fss_extended_list_read_data_option_name_d; } - if (main->parameters[fss_extended_list_read_parameter_object_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_object_e].result == f_console_result_found_e) { data->option |= fss_extended_list_read_data_option_object_d; } - if (main->parameters[fss_extended_list_read_parameter_raw_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_raw_e].result == f_console_result_found_e) { data->option |= fss_extended_list_read_data_option_raw_d; } - if (main->parameters[fss_extended_list_read_parameter_select_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_list_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_extended_list_read_data_option_select_d; status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_select_e, fss_extended_list_read_long_select_s, arguments, &data->select); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) { data->option |= fss_extended_list_read_data_option_total_d; } - if (main->parameters[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e) { data->option |= fss_extended_list_read_data_option_trim_d; } diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index fc91c0a..0a03ae6 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_fss_extended_list_write_program_version_ - const f_string_static_t fss_extended_list_write_program_version_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_WRITE_program_version_s, 0, FSS_EXTENDED_LIST_WRITE_program_version_s_length); + const f_string_static_t fss_extended_list_write_program_version_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_program_version_s, 0, FSS_EXTENDED_LIST_WRITE_program_version_s_length); #endif // _di_fss_extended_list_write_program_version_ #ifndef _di_fss_extended_list_write_program_name_ - const f_string_static_t fss_extended_list_write_program_name_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_WRITE_program_name_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_s_length); - const f_string_static_t fss_extended_list_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_WRITE_program_name_long_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_long_s_length); + const f_string_static_t fss_extended_list_write_program_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_program_name_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_s_length); + const f_string_static_t fss_extended_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_program_name_long_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_long_s_length); #endif // _di_fss_extended_list_write_program_name_ #ifndef _di_fss_extended_list_write_print_help_ @@ -73,82 +73,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_extended_list_write_total_parameters_d); + f_console_parameter_t parameters[] = fss_extended_list_write_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_extended_list_write_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_extended_list_write_parameter_no_color_e, fss_extended_list_write_parameter_light_e, fss_extended_list_write_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_extended_list_write_parameter_no_color_e, fss_extended_list_write_parameter_light_e, fss_extended_list_write_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_extended_list_write_main_delete(main); + if (F_status_is_error(status)) { + fss_extended_list_write_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_extended_list_write_parameter_verbosity_quiet_e, fss_extended_list_write_parameter_verbosity_normal_e, fss_extended_list_write_parameter_verbosity_verbose_e, fss_extended_list_write_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_extended_list_write_parameter_verbosity_quiet_e, fss_extended_list_write_parameter_verbosity_normal_e, fss_extended_list_write_parameter_verbosity_verbose_e, fss_extended_list_write_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fss_extended_list_write_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + fss_extended_list_write_main_delete(main); - if (choice == fss_extended_list_write_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_extended_list_write_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_extended_list_write_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_extended_list_write_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_extended_list_write_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_extended_list_write_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_extended_list_write_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_extended_list_write_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_extended_list_write_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_extended_list_write_parameter_help_e].result == f_console_result_found_e) { fss_extended_list_write_print_help(main->output.to, main->context); fss_extended_list_write_main_delete(main); @@ -156,7 +158,7 @@ extern "C" { return status; } - if (main->parameters[fss_extended_list_write_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_write_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_extended_list_write_program_version_s); fss_extended_list_write_main_delete(main); @@ -171,8 +173,8 @@ extern "C" { output.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_list_write_parameter_file_e].result == f_console_result_additional_e) { - if (main->parameters[fss_extended_list_write_parameter_file_e].values.used > 1) { + if (main->parameters.array[fss_extended_list_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_list_write_parameter_file_e].values.used > 1) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -186,40 +188,40 @@ extern "C" { status = F_status_set_error(F_parameter); } else { - const f_array_length_t location = main->parameters[fss_extended_list_write_parameter_file_e].values.array[0]; + const f_array_length_t location = main->parameters.array[fss_extended_list_write_parameter_file_e].values.array[0]; output.id = -1; output.stream = 0; status = f_file_stream_open(arguments->argv[location], 0, &output); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], f_file_operation_open_s, fll_error_file_type_file_e); } } } - else if (main->parameters[fss_extended_list_write_parameter_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_extended_list_write_parameter_file_e].result == f_console_result_found_e) { fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_file_s); status = F_status_set_error(F_parameter); } } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_list_write_parameter_object_e].locations.used || main->parameters[fss_extended_list_write_parameter_content_e].locations.used) { - if (main->parameters[fss_extended_list_write_parameter_object_e].locations.used) { - if (main->parameters[fss_extended_list_write_parameter_object_e].locations.used != main->parameters[fss_extended_list_write_parameter_object_e].values.used) { + if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used || main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used) { + if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used != main->parameters.array[fss_extended_list_write_parameter_object_e].values.used) { fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_list_write_parameter_content_e].locations.used != main->parameters[fss_extended_list_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used != main->parameters.array[fss_extended_list_write_parameter_content_e].values.used) { fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_list_write_parameter_object_e].locations.used != main->parameters[fss_extended_list_write_parameter_content_e].locations.used && main->parameters[fss_extended_list_write_parameter_partial_e].result == f_console_result_none_e) { + else if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used != main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_list_write_parameter_partial_e].result == f_console_result_none_e) { fss_extended_list_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_list_write_parameter_content_e].locations.used && main->parameters[fss_extended_list_write_parameter_partial_e].locations.used) { - if (main->parameters[fss_extended_list_write_parameter_content_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_list_write_parameter_partial_e].locations.used) { + if (main->parameters.array[fss_extended_list_write_parameter_content_e].result == f_console_result_additional_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -239,17 +241,17 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_list_write_parameter_content_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_list_write_parameter_content_e].result == f_console_result_additional_e) { f_array_length_t location_object = 0; f_array_length_t location_content = 0; f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object_e].locations.used; ++i) { - location_object = main->parameters[fss_extended_list_write_parameter_object_e].locations.array[i]; - location_content = main->parameters[fss_extended_list_write_parameter_content_e].locations.array[i]; - location_sub_object = main->parameters[fss_extended_list_write_parameter_object_e].locations_sub.array[i]; - location_sub_content = main->parameters[fss_extended_list_write_parameter_content_e].locations_sub.array[i]; + for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used; ++i) { + location_object = main->parameters.array[fss_extended_list_write_parameter_object_e].locations.array[i]; + location_content = main->parameters.array[fss_extended_list_write_parameter_content_e].locations.array[i]; + location_sub_object = main->parameters.array[fss_extended_list_write_parameter_object_e].locations_sub.array[i]; + location_sub_content = main->parameters.array[fss_extended_list_write_parameter_content_e].locations_sub.array[i]; if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -271,12 +273,12 @@ extern "C" { } } } - else if (main->parameters[fss_extended_list_write_parameter_content_e].locations.used) { - if (main->parameters[fss_extended_list_write_parameter_content_e].locations.used != main->parameters[fss_extended_list_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used != main->parameters.array[fss_extended_list_write_parameter_content_e].values.used) { fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (!main->parameters[fss_extended_list_write_parameter_partial_e].locations.used) { + else if (!main->parameters.array[fss_extended_list_write_parameter_partial_e].locations.used) { fss_extended_list_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } @@ -299,7 +301,7 @@ extern "C" { } if (F_status_is_error_not(status) && main->process_pipe) { - if (main->parameters[fss_extended_list_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_write_parameter_partial_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -316,7 +318,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_list_write_parameter_prepend_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_write_parameter_prepend_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -329,8 +331,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_list_write_parameter_prepend_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_extended_list_write_parameter_prepend_e].values.array[main->parameters[fss_extended_list_write_parameter_prepend_e].values.used - 1]; + else if (main->parameters.array[fss_extended_list_write_parameter_prepend_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.used - 1]; const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d); if (length) { @@ -379,7 +381,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_list_write_parameter_ignore_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_write_parameter_ignore_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -392,9 +394,9 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_list_write_parameter_ignore_e].result == f_console_result_additional_e) { - const f_array_length_t total_locations = main->parameters[fss_extended_list_write_parameter_ignore_e].locations.used; - const f_array_length_t total_arguments = main->parameters[fss_extended_list_write_parameter_ignore_e].values.used; + else if (main->parameters.array[fss_extended_list_write_parameter_ignore_e].result == f_console_result_additional_e) { + const f_array_length_t total_locations = main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.used; + const f_array_length_t total_arguments = main->parameters.array[fss_extended_list_write_parameter_ignore_e].values.used; if (total_locations * 2 > total_arguments) { flockfile(main->error.to.stream); @@ -413,14 +415,14 @@ extern "C" { f_fss_quote_t quote = F_fss_delimit_quote_double_s; if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_list_write_parameter_double_e].result == f_console_result_found_e) { - if (main->parameters[fss_extended_list_write_parameter_single_e].result == f_console_result_found_e) { - if (main->parameters[fss_extended_list_write_parameter_double_e].location < main->parameters[fss_extended_list_write_parameter_single_e].location) { + if (main->parameters.array[fss_extended_list_write_parameter_double_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_write_parameter_single_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_write_parameter_double_e].location < main->parameters.array[fss_extended_list_write_parameter_single_e].location) { quote = F_fss_delimit_quote_single_s; } } } - else if (main->parameters[fss_extended_list_write_parameter_single_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_extended_list_write_parameter_single_e].result == f_console_result_found_e) { quote = F_fss_delimit_quote_single_s; } } @@ -451,10 +453,10 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_list_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_write_parameter_partial_e].result == f_console_result_found_e) { - if (main->parameters[fss_extended_list_write_parameter_object_e].result == f_console_result_additional_e) { - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object_e].values.used; ++i) { + if (main->parameters.array[fss_extended_list_write_parameter_object_e].result == f_console_result_additional_e) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_object_e].values.used; ++i) { if (fss_extended_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -462,7 +464,7 @@ extern "C" { break; } - object.string = arguments->argv[main->parameters[fss_extended_list_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_extended_list_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; @@ -471,7 +473,7 @@ extern "C" { } // for } else { - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_content_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_content_e].values.used; ++i) { if (fss_extended_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -479,10 +481,10 @@ extern "C" { break; } - status = fss_extended_list_write_process_parameter_ignore(main, arguments, main->parameters[fss_extended_list_write_parameter_content_e].locations, i, &ignore); + status = fss_extended_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore); if (F_status_is_error(status)) break; - content.string = arguments->argv[main->parameters[fss_extended_list_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_extended_list_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -492,7 +494,7 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_object_e].values.used; ++i) { if (fss_extended_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); @@ -500,14 +502,14 @@ extern "C" { break; } - status = fss_extended_list_write_process_parameter_ignore(main, arguments, main->parameters[fss_extended_list_write_parameter_content_e].locations, i, &ignore); + status = fss_extended_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore); if (F_status_is_error(status)) break; - object.string = arguments->argv[main->parameters[fss_extended_list_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_extended_list_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; - content.string = arguments->argv[main->parameters[fss_extended_list_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_extended_list_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -526,7 +528,7 @@ extern "C" { funlockfile(main->error.to.stream); } } - else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters[fss_extended_list_write_parameter_file_e].result == f_console_result_none_e) { + else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters.array[fss_extended_list_write_parameter_file_e].result == f_console_result_none_e) { // Ensure there is always a newline at the end, unless in quiet mode. fll_print_dynamic(f_string_eol_s, main->output.to.stream); @@ -546,7 +548,7 @@ extern "C" { content.size = 0; } - if (main->parameters[fss_extended_list_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_list_write_parameter_file_e].result == f_console_result_additional_e) { if (output.id != -1) { f_file_stream_close(F_true, &output); } @@ -571,12 +573,7 @@ extern "C" { #ifndef _di_fss_extended_list_write_main_delete_ f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main) { - for (f_array_length_t i = 0; i < fss_extended_list_write_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.h b/level_3/fss_extended_list_write/c/fss_extended_list_write.h index 61c592a..dc8f067 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.h +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.h @@ -158,7 +158,7 @@ extern "C" { #ifndef _di_fss_extended_list_write_main_t_ typedef struct { - f_console_parameter_t parameters[fss_extended_list_write_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -176,7 +176,7 @@ extern "C" { #define fss_extended_list_write_main_t_initialize \ { \ - fss_extended_list_write_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_extended_list_write/c/private-write.c b/level_3/fss_extended_list_write/c/private-write.c index 63c1f28..46252ee 100644 --- a/level_3/fss_extended_list_write/c/private-write.c +++ b/level_3/fss_extended_list_write/c/private-write.c @@ -81,7 +81,7 @@ extern "C" { } if (content) { - if (main->parameters[fss_extended_list_write_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_list_write_parameter_trim_e].result == f_console_result_found_e) { complete = f_fss_complete_full_trim_e; } else { @@ -364,13 +364,13 @@ extern "C" { range.start = 0; - for (; i < main->parameters[fss_extended_list_write_parameter_ignore_e].locations.used; ++i) { + for (; i < main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.used; ++i) { if (fss_extended_list_write_signal_received(main)) { return F_status_set_error(F_interrupt); } - l = main->parameters[fss_extended_list_write_parameter_ignore_e].locations.array[i]; + l = main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.array[i]; if (l < contents.array[location]) continue; if (location + 1 < contents.used && l > contents.array[location + 1]) continue; @@ -396,7 +396,7 @@ extern "C" { } } - index = main->parameters[fss_extended_list_write_parameter_ignore_e].values.array[i * 2]; + index = main->parameters.array[fss_extended_list_write_parameter_ignore_e].values.array[i * 2]; range.start = 0; range.stop = strnlen(arguments->argv[index], F_console_parameter_size_d) - 1; @@ -416,7 +416,7 @@ extern "C" { ignore->array[ignore->used].start = number; - index = main->parameters[fss_extended_list_write_parameter_ignore_e].values.array[(i * 2) + 1]; + index = main->parameters.array[fss_extended_list_write_parameter_ignore_e].values.array[(i * 2) + 1]; range.start = 0; range.stop = strnlen(arguments->argv[index], F_console_parameter_size_d) - 1; diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index f743753..546e9fe 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -8,12 +8,12 @@ extern "C" { #endif #ifndef _di_fss_extended_read_program_version_ - const f_string_static_t fss_extended_read_program_version_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_READ_program_version_s, 0, FSS_EXTENDED_READ_program_version_s_length); + const f_string_static_t fss_extended_read_program_version_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_program_version_s, 0, FSS_EXTENDED_READ_program_version_s_length); #endif // _di_fss_extended_read_program_version_ #ifndef _di_fss_extended_read_program_name_ - const f_string_static_t fss_extended_read_program_name_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_READ_program_name_s, 0, FSS_EXTENDED_READ_program_name_s_length); - const f_string_static_t fss_extended_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_READ_program_name_long_s, 0, FSS_EXTENDED_READ_program_name_long_s_length); + const f_string_static_t fss_extended_read_program_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_program_name_s, 0, FSS_EXTENDED_READ_program_name_s_length); + const f_string_static_t fss_extended_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_program_name_long_s, 0, FSS_EXTENDED_READ_program_name_long_s_length); #endif // _di_fss_extended_read_program_name_ #ifndef _di_fss_extended_read_print_help_ @@ -131,82 +131,84 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_extended_read_total_parameters_d); + f_console_parameter_t parameters[] = fss_extended_read_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_extended_read_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_extended_read_parameter_no_color_e, fss_extended_read_parameter_light_e, fss_extended_read_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_extended_read_parameter_no_color_e, fss_extended_read_parameter_light_e, fss_extended_read_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_extended_read_main_delete(main); + if (F_status_is_error(status)) { + fss_extended_read_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_extended_read_parameter_verbosity_quiet_e, fss_extended_read_parameter_verbosity_normal_e, fss_extended_read_parameter_verbosity_verbose_e, fss_extended_read_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_extended_read_parameter_verbosity_quiet_e, fss_extended_read_parameter_verbosity_normal_e, fss_extended_read_parameter_verbosity_verbose_e, fss_extended_read_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fss_extended_read_main_delete(main); - - return status; - } + if (F_status_is_error(status)) { + fss_extended_read_main_delete(main); - if (choice == fss_extended_read_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_extended_read_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_extended_read_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_extended_read_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_extended_read_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_extended_read_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_extended_read_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_extended_read_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_extended_read_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_extended_read_parameter_help_e].result == f_console_result_found_e) { fss_extended_read_print_help(main->output.to, main->context); fss_extended_read_main_delete(main); @@ -214,7 +216,7 @@ extern "C" { return status; } - if (main->parameters[fss_extended_read_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_extended_read_program_version_s); fss_extended_read_main_delete(main); @@ -268,7 +270,7 @@ extern "C" { for (f_array_length_t i = 0; i < 6; ++i) { - if (main->parameters[parameter_code[i]].result == f_console_result_found_e) { + if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -283,7 +285,7 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_extended_read_parameter_columns_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_columns_e].result == f_console_result_found_e) { const f_array_length_t parameter_code[] = { fss_extended_read_parameter_depth_e, fss_extended_read_parameter_line_e, @@ -310,7 +312,7 @@ extern "C" { for (f_array_length_t i = 0; i < 5; ++i) { - if (main->parameters[parameter_code[i]].result == parameter_match[i]) { + if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -327,8 +329,8 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) { - if (main->parameters[fss_extended_read_parameter_total_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -341,7 +343,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -356,7 +358,7 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[fss_extended_read_parameter_delimit_e].result == f_console_result_additional_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_delimit_e].result == f_console_result_additional_e) { f_array_length_t location = 0; f_array_length_t length = 0; uint16_t signal_check = 0; @@ -364,7 +366,7 @@ extern "C" { // Set the value to 0 to allow for detecting mode based on what is provided. data.delimit_mode = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_extended_read_parameter_delimit_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_read_parameter_delimit_e].values.used; ++i) { if (!((++signal_check) % fss_extended_read_signal_check_d)) { if (fss_extended_read_signal_received(main)) { @@ -375,7 +377,7 @@ extern "C" { signal_check = 0; } - location = main->parameters[fss_extended_read_parameter_delimit_e].values.array[i]; + location = main->parameters.array[fss_extended_read_parameter_delimit_e].values.array[i]; length = strnlen(arguments->argv[location], F_console_parameter_size_d); if (!length) { @@ -502,7 +504,7 @@ extern "C" { // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file. if (F_status_is_error_not(status) && data.depths.array[0].depth > 0) { - if (main->parameters[fss_extended_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_total_e].result == f_console_result_found_e) { fss_extended_read_print_zero(main); } @@ -512,7 +514,7 @@ extern "C" { return F_none; } - if (F_status_is_error_not(status) && main->parameters[fss_extended_read_parameter_select_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_select_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -584,7 +586,7 @@ extern "C" { status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); break; } @@ -667,12 +669,7 @@ extern "C" { #ifndef _di_fss_extended_read_main_delete_ f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main) { - for (f_array_length_t i = 0; i < fss_extended_read_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); macro_f_color_context_t_delete_simple(main->context); diff --git a/level_3/fss_extended_read/c/fss_extended_read.h b/level_3/fss_extended_read/c/fss_extended_read.h index d28fa02..406d946 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -225,7 +225,7 @@ extern "C" { #ifndef _di_fss_extended_read_main_t_ typedef struct { - f_console_parameter_t parameters[fss_extended_read_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -241,7 +241,7 @@ extern "C" { #define fss_extended_read_main_t_initialize \ { \ - fss_extended_read_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_extended_read/c/private-print.c b/level_3/fss_extended_read/c/private-print.c index c2e30da..5fef7be 100644 --- a/level_3/fss_extended_read/c/private-print.c +++ b/level_3/fss_extended_read/c/private-print.c @@ -156,7 +156,7 @@ extern "C" { #ifndef _di_fss_extended_read_print_content_end_ void fss_extended_read_print_content_end(fss_extended_read_main_t * const main) { - if (main->parameters[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_extended_read_pipe_content_start_s, main->output.to.stream); } else { @@ -168,7 +168,7 @@ extern "C" { #ifndef _di_fss_extended_read_print_object_end_ void fss_extended_read_print_object_end(fss_extended_read_main_t * const main) { - if (main->parameters[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_extended_read_pipe_content_end_s, main->output.to.stream); } else { @@ -188,7 +188,7 @@ extern "C" { #ifndef _di_fss_extended_read_print_set_end_ void fss_extended_read_print_set_end(fss_extended_read_main_t * const main) { - if (main->parameters[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_extended_read_pipe_content_end_s, main->output.to.stream); } else { diff --git a/level_3/fss_extended_read/c/private-read.c b/level_3/fss_extended_read/c/private-read.c index d6b9644..f19c9dc 100644 --- a/level_3/fss_extended_read/c/private-read.c +++ b/level_3/fss_extended_read/c/private-read.c @@ -67,8 +67,8 @@ extern "C" { { f_array_length_t depth_size = 1; - if (main->parameters[fss_extended_read_parameter_depth_e].result == f_console_result_additional_e) { - depth_size = main->parameters[fss_extended_read_parameter_depth_e].values.used; + if (main->parameters.array[fss_extended_read_parameter_depth_e].result == f_console_result_additional_e) { + depth_size = main->parameters.array[fss_extended_read_parameter_depth_e].values.used; } if (depth_size > data->depths.size) { @@ -106,11 +106,11 @@ extern "C" { macro_f_string_dynamic_t_clear(data->depths.array[i].value_name); - if (!main->parameters[fss_extended_read_parameter_depth_e].values.used) { + if (!main->parameters.array[fss_extended_read_parameter_depth_e].values.used) { position_depth = 0; } else { - position_depth = main->parameters[fss_extended_read_parameter_depth_e].values.array[i]; + position_depth = main->parameters.array[fss_extended_read_parameter_depth_e].values.array[i]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth])); @@ -123,18 +123,18 @@ extern "C" { } } - if (main->parameters[fss_extended_read_parameter_at_e].result == f_console_result_additional_e) { - for (; position_at < main->parameters[fss_extended_read_parameter_at_e].values.used; ++position_at) { + if (main->parameters.array[fss_extended_read_parameter_at_e].result == f_console_result_additional_e) { + for (; position_at < main->parameters.array[fss_extended_read_parameter_at_e].values.used; ++position_at) { - if (main->parameters[fss_extended_read_parameter_at_e].values.array[position_at] < position_depth) { + if (main->parameters.array[fss_extended_read_parameter_at_e].values.array[position_at] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_extended_read_parameter_at_e].values.array[position_at] > main->parameters[fss_extended_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_extended_read_parameter_at_e].values.array[position_at] > main->parameters.array[fss_extended_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_at = main->parameters[fss_extended_read_parameter_at_e].values.array[position_at]; + data->depths.array[i].index_at = main->parameters.array[fss_extended_read_parameter_at_e].values.array[position_at]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at])); @@ -148,20 +148,20 @@ extern "C" { } // for } - if (main->parameters[fss_extended_read_parameter_name_e].result == f_console_result_additional_e) { - for (; position_name < main->parameters[fss_extended_read_parameter_name_e].values.used; position_name++) { + if (main->parameters.array[fss_extended_read_parameter_name_e].result == f_console_result_additional_e) { + for (; position_name < main->parameters.array[fss_extended_read_parameter_name_e].values.used; position_name++) { - if (main->parameters[fss_extended_read_parameter_name_e].values.array[position_name] < position_depth) { + if (main->parameters.array[fss_extended_read_parameter_name_e].values.array[position_name] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_extended_read_parameter_name_e].values.array[position_name] > main->parameters[fss_extended_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_extended_read_parameter_name_e].values.array[position_name] > main->parameters.array[fss_extended_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_name = main->parameters[fss_extended_read_parameter_name_e].values.array[position_name]; + data->depths.array[i].index_name = main->parameters.array[fss_extended_read_parameter_name_e].values.array[position_name]; - if (main->parameters[fss_extended_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e) { status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name); } else { @@ -169,7 +169,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), main->parameters[fss_extended_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); + fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); return status; } @@ -263,7 +263,7 @@ extern "C" { if (F_status_is_error(status)) { const f_string_t file_name = fss_extended_read_file_identify(input.start, data->files); - fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, file_name, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); return status; } @@ -285,8 +285,8 @@ extern "C" { #ifndef _di_fss_extended_read_load_number_ f_status_t fss_extended_read_load_number(fss_extended_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) { - if (main->parameters[parameter].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1]; + if (main->parameters.array[parameter].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number); @@ -581,53 +581,53 @@ extern "C" { f_status_t status = F_none; - if (main->parameters[fss_extended_read_parameter_at_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_read_parameter_at_e].result == f_console_result_additional_e) { data->option |= fss_extended_read_data_option_at_d; } - if (main->parameters[fss_extended_read_parameter_columns_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_columns_e].result == f_console_result_found_e) { data->option |= fss_extended_read_data_option_columns_d; } - if (main->parameters[fss_extended_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_content_e].result == f_console_result_found_e) { data->option |= fss_extended_read_data_option_content_d; } - if (main->parameters[fss_extended_read_parameter_empty_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_empty_e].result == f_console_result_found_e) { data->option |= fss_extended_read_data_option_empty_d; } - if (main->parameters[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_extended_read_data_option_line_d; status = fss_extended_read_load_number(main, fss_extended_read_parameter_line_e, fss_extended_read_long_line_s, arguments, &data->line); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_extended_read_parameter_name_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_read_parameter_name_e].result == f_console_result_additional_e) { data->option |= fss_extended_read_data_option_name_d; } - if (main->parameters[fss_extended_read_parameter_object_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_object_e].result == f_console_result_found_e) { data->option |= fss_extended_read_data_option_object_d; } - if (main->parameters[fss_extended_read_parameter_raw_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_raw_e].result == f_console_result_found_e) { data->option |= fss_extended_read_data_option_raw_d; } - if (main->parameters[fss_extended_read_parameter_select_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_extended_read_data_option_select_d; status = fss_extended_read_load_number(main, fss_extended_read_parameter_select_e, fss_extended_read_long_select_s, arguments, &data->select); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_extended_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_total_e].result == f_console_result_found_e) { data->option |= fss_extended_read_data_option_total_d; } - if (main->parameters[fss_extended_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e) { data->option |= fss_extended_read_data_option_trim_d; } diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 3804492..f5c0f7c 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_fss_extended_write_program_version_ - const f_string_static_t fss_extended_write_program_version_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_WRITE_program_version_s, 0, FSS_EXTENDED_WRITE_program_version_s_length); + const f_string_static_t fss_extended_write_program_version_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_program_version_s, 0, FSS_EXTENDED_WRITE_program_version_s_length); #endif // _di_fss_extended_write_program_version_ #ifndef _di_fss_extended_write_program_name_ - const f_string_static_t fss_extended_write_program_name_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_WRITE_program_name_s, 0, FSS_EXTENDED_WRITE_program_name_s_length); - const f_string_static_t fss_extended_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_WRITE_program_name_long_s, 0, FSS_EXTENDED_WRITE_program_name_long_s_length); + const f_string_static_t fss_extended_write_program_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_program_name_s, 0, FSS_EXTENDED_WRITE_program_name_s_length); + const f_string_static_t fss_extended_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_program_name_long_s, 0, FSS_EXTENDED_WRITE_program_name_long_s_length); #endif // _di_fss_extended_write_program_name_ #ifndef _di_fss_extended_write_print_help_ @@ -70,81 +70,83 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_extended_write_total_parameters_d); + f_console_parameter_t parameters[] = fss_extended_write_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_extended_write_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_extended_write_parameter_no_color_e, fss_extended_write_parameter_light_e, fss_extended_write_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_extended_write_parameter_no_color_e, fss_extended_write_parameter_light_e, fss_extended_write_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - - fll_program_parameter_process_empty(&main->context, sets); - } + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - if (F_status_is_error(status)) { - fss_extended_write_main_delete(main); - return F_status_set_error(status); - } + fll_program_parameter_process_empty(&main->context, sets); } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_extended_write_parameter_verbosity_quiet_e, fss_extended_write_parameter_verbosity_normal_e, fss_extended_write_parameter_verbosity_verbose_e, fss_extended_write_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + if (F_status_is_error(status)) { + fss_extended_write_main_delete(main); + return F_status_set_error(status); + } + } - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_extended_write_parameter_verbosity_quiet_e, fss_extended_write_parameter_verbosity_normal_e, fss_extended_write_parameter_verbosity_verbose_e, fss_extended_write_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fss_extended_write_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + fss_extended_write_main_delete(main); - if (choice == fss_extended_write_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_extended_write_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_extended_write_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_extended_write_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_extended_write_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_extended_write_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_extended_write_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_extended_write_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_extended_write_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_extended_write_parameter_help_e].result == f_console_result_found_e) { fss_extended_write_print_help(main->output.to, main->context); fss_extended_write_main_delete(main); @@ -152,7 +154,7 @@ extern "C" { return status; } - if (main->parameters[fss_extended_write_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_write_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_extended_write_program_version_s); fss_extended_write_main_delete(main); @@ -167,8 +169,8 @@ extern "C" { output.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_write_parameter_file_e].result == f_console_result_additional_e) { - if (main->parameters[fss_extended_write_parameter_file_e].values.used > 1) { + if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_write_parameter_file_e].values.used > 1) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -182,40 +184,40 @@ extern "C" { status = F_status_set_error(F_parameter); } else { - const f_array_length_t location = main->parameters[fss_extended_write_parameter_file_e].values.array[0]; + const f_array_length_t location = main->parameters.array[fss_extended_write_parameter_file_e].values.array[0]; output.id = -1; output.stream = 0; status = f_file_stream_open(arguments->argv[location], 0, &output); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], f_file_operation_open_s, fll_error_file_type_file_e); } } } - else if (main->parameters[fss_extended_write_parameter_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_found_e) { fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s,.string fss_extended_write_long_file_s); status = F_status_set_error(F_parameter); } } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_write_parameter_object_e].locations.used || main->parameters[fss_extended_write_parameter_content_e].locations.used) { - if (main->parameters[fss_extended_write_parameter_object_e].locations.used) { - if (main->parameters[fss_extended_write_parameter_object_e].locations.used != main->parameters[fss_extended_write_parameter_object_e].values.used) { + if (main->parameters.array[fss_extended_write_parameter_object_e].locations.used || main->parameters.array[fss_extended_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_extended_write_parameter_object_e].locations.used) { + if (main->parameters.array[fss_extended_write_parameter_object_e].locations.used != main->parameters.array[fss_extended_write_parameter_object_e].values.used) { fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_object_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_write_parameter_content_e].locations.used != main->parameters[fss_extended_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used != main->parameters.array[fss_extended_write_parameter_content_e].values.used) { fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (!main->parameters[fss_extended_write_parameter_content_e].locations.used && main->parameters[fss_extended_write_parameter_partial_e].result == f_console_result_none_e) { + else if (!main->parameters.array[fss_extended_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_write_parameter_partial_e].result == f_console_result_none_e) { fss_extended_write_error_parameter_at_least_once(main); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_write_parameter_content_e].locations.used && main->parameters[fss_extended_write_parameter_partial_e].locations.used) { - if (main->parameters[fss_extended_write_parameter_content_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_write_parameter_partial_e].locations.used) { + if (main->parameters.array[fss_extended_write_parameter_content_e].result == f_console_result_additional_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -235,11 +237,11 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_write_parameter_content_e].result == f_console_result_additional_e) { - f_array_length_t location_object = main->parameters[fss_extended_write_parameter_object_e].locations.array[0]; - f_array_length_t location_content = main->parameters[fss_extended_write_parameter_content_e].locations.array[0]; - f_array_length_t location_sub_object = main->parameters[fss_extended_write_parameter_object_e].locations_sub.array[0]; - f_array_length_t location_sub_content = main->parameters[fss_extended_write_parameter_content_e].locations_sub.array[0]; + if (main->parameters.array[fss_extended_write_parameter_content_e].result == f_console_result_additional_e) { + f_array_length_t location_object = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[0]; + f_array_length_t location_content = main->parameters.array[fss_extended_write_parameter_content_e].locations.array[0]; + f_array_length_t location_sub_object = main->parameters.array[fss_extended_write_parameter_object_e].locations_sub.array[0]; + f_array_length_t location_sub_content = main->parameters.array[fss_extended_write_parameter_content_e].locations_sub.array[0]; if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -257,10 +259,10 @@ extern "C" { status = F_status_set_error(F_parameter); } else { - location_object = main->parameters[fss_extended_write_parameter_object_e].locations.array[main->parameters[fss_extended_write_parameter_object_e].locations.used - 1]; - location_content = main->parameters[fss_extended_write_parameter_content_e].locations.array[main->parameters[fss_extended_write_parameter_content_e].locations.used - 1]; - location_sub_object = main->parameters[fss_extended_write_parameter_object_e].locations_sub.array[main->parameters[fss_extended_write_parameter_object_e].locations_sub.used - 1]; - location_sub_content = main->parameters[fss_extended_write_parameter_content_e].locations_sub.array[main->parameters[fss_extended_write_parameter_content_e].locations_sub.used - 1]; + location_object = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[main->parameters.array[fss_extended_write_parameter_object_e].locations.used - 1]; + location_content = main->parameters.array[fss_extended_write_parameter_content_e].locations.array[main->parameters.array[fss_extended_write_parameter_content_e].locations.used - 1]; + location_sub_object = main->parameters.array[fss_extended_write_parameter_object_e].locations_sub.array[main->parameters.array[fss_extended_write_parameter_object_e].locations_sub.used - 1]; + location_sub_content = main->parameters.array[fss_extended_write_parameter_content_e].locations_sub.array[main->parameters.array[fss_extended_write_parameter_content_e].locations_sub.used - 1]; if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -281,12 +283,12 @@ extern "C" { } } } - else if (main->parameters[fss_extended_write_parameter_content_e].locations.used) { - if (main->parameters[fss_extended_write_parameter_content_e].locations.used != main->parameters[fss_extended_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used != main->parameters.array[fss_extended_write_parameter_content_e].values.used) { fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (!main->parameters[fss_extended_write_parameter_partial_e].locations.used) { + else if (!main->parameters.array[fss_extended_write_parameter_partial_e].locations.used) { fss_extended_write_error_parameter_at_least_once(main); status = F_status_set_error(F_parameter); } @@ -309,7 +311,7 @@ extern "C" { } if (F_status_is_error_not(status) && main->process_pipe) { - if (main->parameters[fss_extended_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_write_parameter_partial_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -326,7 +328,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_write_parameter_prepend_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_write_parameter_prepend_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -339,14 +341,14 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_write_parameter_prepend_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_extended_write_parameter_prepend_e].values.array[main->parameters[fss_extended_write_parameter_prepend_e].values.used - 1]; + else if (main->parameters.array[fss_extended_write_parameter_prepend_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_extended_write_parameter_prepend_e].values.array[main->parameters.array[fss_extended_write_parameter_prepend_e].values.used - 1]; const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d); // Even though this standard does not utilize this parameter, provide the validation for consistency. if (length) { f_string_range_t range = macro_f_string_range_t_initialize(length); - const f_string_static_t prepend = macro_f_string_static_t_initialize(arguments->argv[index], length); + const f_string_static_t prepend = macro_f_string_static_t_initialize2(arguments->argv[index], length); for (; range.start < length; ++range.start) { @@ -387,7 +389,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_write_parameter_ignore_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_write_parameter_ignore_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -400,9 +402,9 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_extended_write_parameter_ignore_e].result == f_console_result_additional_e) { - const f_array_length_t total_locations = main->parameters[fss_extended_write_parameter_ignore_e].locations.used; - const f_array_length_t total_arguments = main->parameters[fss_extended_write_parameter_ignore_e].values.used; + else if (main->parameters.array[fss_extended_write_parameter_ignore_e].result == f_console_result_additional_e) { + const f_array_length_t total_locations = main->parameters.array[fss_extended_write_parameter_ignore_e].locations.used; + const f_array_length_t total_arguments = main->parameters.array[fss_extended_write_parameter_ignore_e].values.used; if (total_locations * 2 > total_arguments) { flockfile(main->error.to.stream); @@ -421,14 +423,14 @@ extern "C" { f_fss_quote_t quote = F_fss_delimit_quote_double_s; if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_write_parameter_double_e].result == f_console_result_found_e) { - if (main->parameters[fss_extended_write_parameter_single_e].result == f_console_result_found_e) { - if (main->parameters[fss_extended_write_parameter_double_e].location < main->parameters[fss_extended_write_parameter_single_e].location) { + if (main->parameters.array[fss_extended_write_parameter_double_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_write_parameter_single_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_write_parameter_double_e].location < main->parameters.array[fss_extended_write_parameter_single_e].location) { quote = F_fss_delimit_quote_single_s; } } } - else if (main->parameters[fss_extended_write_parameter_single_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_extended_write_parameter_single_e].result == f_console_result_found_e) { quote = F_fss_delimit_quote_single_s; } } @@ -456,12 +458,12 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_extended_write_parameter_partial_e].result == f_console_result_found_e) { - if (main->parameters[fss_extended_write_parameter_object_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_write_parameter_object_e].result == f_console_result_additional_e) { contents.used = 0; uint16_t signal_check = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_extended_write_parameter_object_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) { if (!((++signal_check) % fss_extended_write_signal_check_d)) { if (fss_extended_write_signal_received(main)) { @@ -473,7 +475,7 @@ extern "C" { signal_check = 0; } - object.string = arguments->argv[main->parameters[fss_extended_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; @@ -484,7 +486,7 @@ extern "C" { else { object.used = 0; - status = f_string_dynamics_increase_by(main->parameters[fss_extended_write_parameter_content_e].values.used, &contents); + status = f_string_dynamics_increase_by(main->parameters.array[fss_extended_write_parameter_content_e].values.used, &contents); if (status == F_array_too_large) { status = F_status_set_error(status); @@ -496,9 +498,9 @@ extern "C" { else { f_array_length_t i = 0; - for (; i < main->parameters[fss_extended_write_parameter_content_e].values.used; ++i) { + for (; i < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++i) { - contents.array[contents.used].string = arguments->argv[main->parameters[fss_extended_write_parameter_content_e].values.array[i]]; + contents.array[contents.used].string = arguments->argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[i]]; contents.array[contents.used].used = strnlen(contents.array[contents.used].string, F_console_parameter_size_d); contents.array[contents.used].size = contents.array[contents.used].used; ++contents.used; @@ -507,7 +509,7 @@ extern "C" { status = fss_extended_write_process(main, output, quote, 0, &contents, &buffer); // clear the contents array of the static strings to avoid deallocation attempts on static variables. - for (; i < main->parameters[fss_extended_write_parameter_content_e].values.used; ++i) { + for (; i < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++i) { contents.array[contents.used].string = 0; contents.array[contents.used].used = 0; contents.array[contents.used].size = 0; @@ -525,7 +527,7 @@ extern "C" { f_array_length_t object_next = 0; f_array_length_t content_current = 0; - for (uint16_t signal_check = 0; i < main->parameters[fss_extended_write_parameter_object_e].values.used; ++i) { + for (uint16_t signal_check = 0; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) { if (!((++signal_check) % fss_extended_write_signal_check_d)) { if (fss_extended_write_signal_received(main)) { @@ -536,23 +538,23 @@ extern "C" { signal_check = 0; } - object_current = main->parameters[fss_extended_write_parameter_object_e].locations.array[i]; + object_current = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[i]; - if (i + 1 < main->parameters[fss_extended_write_parameter_object_e].values.used) { - object_next = main->parameters[fss_extended_write_parameter_object_e].locations.array[i + 1]; + if (i + 1 < main->parameters.array[fss_extended_write_parameter_object_e].values.used) { + object_next = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[i + 1]; } - object.string = arguments->argv[main->parameters[fss_extended_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; contents.used = 0; - for (; j < main->parameters[fss_extended_write_parameter_content_e].values.used; ++j) { + for (; j < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++j) { - content_current = main->parameters[fss_extended_write_parameter_content_e].locations.array[j]; + content_current = main->parameters.array[fss_extended_write_parameter_content_e].locations.array[j]; - if (i + 1 < main->parameters[fss_extended_write_parameter_object_e].values.used) { + if (i + 1 < main->parameters.array[fss_extended_write_parameter_object_e].values.used) { if (content_current < object_current || content_current > object_next) break; } @@ -568,7 +570,7 @@ extern "C" { contents.array[contents.used].used = 0; } - status = f_string_append(arguments->argv[main->parameters[fss_extended_write_parameter_content_e].values.array[j]], strnlen(arguments->argv[main->parameters[fss_extended_write_parameter_content_e].values.array[j]], F_console_parameter_size_d), &contents.array[contents.used]); + status = f_string_append(arguments->argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[j]], strnlen(arguments->argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[j]], F_console_parameter_size_d), &contents.array[contents.used]); if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true); @@ -596,7 +598,7 @@ extern "C" { funlockfile(main->error.to.stream); } } - else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters[fss_extended_write_parameter_file_e].result == f_console_result_none_e) { + else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_none_e) { // Ensure there is always a newline at the end, unless in quiet mode. fll_print_dynamic(f_string_eol_s, main->output.to.stream); @@ -614,7 +616,7 @@ extern "C" { contents.used = 0; } - if (main->parameters[fss_extended_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_additional_e) { if (output.id != -1) { f_file_stream_close(F_true, &output); } @@ -643,12 +645,7 @@ extern "C" { #ifndef _di_fss_extended_write_main_delete_ f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main) { - for (f_array_length_t i = 0; i < fss_extended_write_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fss_extended_write/c/fss_extended_write.h b/level_3/fss_extended_write/c/fss_extended_write.h index c59ec6e..e15e9da 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -157,7 +157,7 @@ extern "C" { #ifndef _di_fss_extended_write_main_t_ typedef struct { - f_console_parameter_t parameters[fss_extended_write_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -175,7 +175,7 @@ extern "C" { #define fss_extended_write_main_t_initialize \ { \ - fss_extended_write_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_extended_write/c/private-write.c b/level_3/fss_extended_write/c/private-write.c index 78482a3..7bc4a6f 100644 --- a/level_3/fss_extended_write/c/private-write.c +++ b/level_3/fss_extended_write/c/private-write.c @@ -81,7 +81,7 @@ extern "C" { } if (contents && contents->used) { - if (main->parameters[fss_extended_write_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_extended_write_parameter_trim_e].result == f_console_result_found_e) { complete = f_fss_complete_full_trim_e; } else { diff --git a/level_3/fss_identify/c/fss_identify.c b/level_3/fss_identify/c/fss_identify.c index 8e503c9..3dd3326 100644 --- a/level_3/fss_identify/c/fss_identify.c +++ b/level_3/fss_identify/c/fss_identify.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_fss_identify_program_version_ - const f_string_static_t fss_identify_program_version_s = macro_f_string_static_t_initialize2(FSS_IDENTIFY_program_version_s, 0, FSS_IDENTIFY_program_version_s_length); + const f_string_static_t fss_identify_program_version_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_program_version_s, 0, FSS_IDENTIFY_program_version_s_length); #endif // _di_fss_identify_program_version_ #ifndef _di_fss_identify_program_name_ - const f_string_static_t fss_identify_program_name_s = macro_f_string_static_t_initialize2(FSS_IDENTIFY_program_name_s, 0, FSS_IDENTIFY_program_name_s_length); - const f_string_static_t fss_identify_program_name_long_s = macro_f_string_static_t_initialize2(FSS_IDENTIFY_program_name_long_s, 0, FSS_IDENTIFY_program_name_long_s_length); + const f_string_static_t fss_identify_program_name_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_program_name_s, 0, FSS_IDENTIFY_program_name_s_length); + const f_string_static_t fss_identify_program_name_long_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_program_name_long_s, 0, FSS_IDENTIFY_program_name_long_s_length); #endif // _di_fss_identify_program_name_ #ifndef _di_fss_identify_print_help_ @@ -71,87 +71,89 @@ extern "C" { f_status_t status = F_none; + f_console_parameter_t parameters[] = fss_identify_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_identify_total_parameters_d; + { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_identify_total_parameters_d); + f_console_parameter_id_t ids[3] = { fss_identify_parameter_no_color_e, fss_identify_parameter_light_e, fss_identify_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - { - f_console_parameter_id_t ids[3] = { fss_identify_parameter_no_color_e, fss_identify_parameter_light_e, fss_identify_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + fll_program_parameter_process_empty(&main->context, sets); + } - fll_program_parameter_process_empty(&main->context, sets); + if (F_status_is_error(status)) { + if (main->error.verbosity != f_console_verbosity_quiet_e) { + fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); + fll_print_dynamic(f_string_eol_s, main->error.to.stream); } - if (F_status_is_error(status)) { - if (main->error.verbosity != f_console_verbosity_quiet_e) { - fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - fll_print_dynamic(f_string_eol_s, main->error.to.stream); - } - - fss_identify_main_delete(main); + fss_identify_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_identify_parameter_verbosity_quiet_e, fss_identify_parameter_verbosity_normal_e, fss_identify_parameter_verbosity_verbose_e, fss_identify_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_identify_parameter_verbosity_quiet_e, fss_identify_parameter_verbosity_normal_e, fss_identify_parameter_verbosity_verbose_e, fss_identify_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fss_identify_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + fss_identify_main_delete(main); - if (choice == fss_identify_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_identify_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_identify_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_identify_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_identify_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_identify_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_identify_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_identify_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_identify_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_identify_parameter_help_e].result == f_console_result_found_e) { fss_identify_print_help(main->output.to, main->context); fss_identify_main_delete(main); @@ -159,7 +161,7 @@ extern "C" { return F_none; } - if (main->parameters[fss_identify_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_identify_program_version); fss_identify_main_delete(main); @@ -170,7 +172,7 @@ extern "C" { fss_identify_data_t data = fss_identify_data_t_initialize; if (F_status_is_error_not(status)) { - if (main->parameters[fss_identify_parameter_line_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -181,8 +183,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_identify_parameter_line_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_identify_parameter_line_e].values.array[main->parameters[fss_identify_parameter_line_e].values.used - 1]; + else if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_identify_parameter_line_e].values.array[main->parameters.array[fss_identify_parameter_line_e].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &data.line); @@ -193,8 +195,8 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[fss_identify_parameter_total_e].result == f_console_result_found_e) { - if (main->parameters[fss_identify_parameter_object_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_identify_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_object_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -207,7 +209,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_identify_parameter_content_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_identify_parameter_content_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -223,7 +225,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_identify_parameter_name_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_name_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -234,8 +236,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_identify_parameter_name_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_identify_parameter_name_e].values.array[main->parameters[fss_identify_parameter_name_e].values.used - 1]; + else if (main->parameters.array[fss_identify_parameter_name_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_identify_parameter_name_e].values.array[main->parameters.array[fss_identify_parameter_name_e].values.used - 1]; const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d); const f_string_range_t range = macro_f_string_range_t_initialize(length); @@ -321,7 +323,7 @@ extern "C" { signal_check = 0; } - if (main->parameters[fss_identify_parameter_line_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_additional_e) { if (data.current > data.line) break; } @@ -332,7 +334,7 @@ extern "C" { status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); } else { status = fss_identify_load_line(main, file, arguments->argv[main->remaining.array[i]], &buffer, &range); @@ -351,7 +353,7 @@ extern "C" { f_string_dynamic_resize(0, &buffer); if (F_status_is_error_not(status)) { - if (main->parameters[fss_identify_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_total_e].result == f_console_result_found_e) { fll_print_format("%ul%q", main->output.to.stream, data.total, f_string_eol_s); } } @@ -377,12 +379,7 @@ extern "C" { #ifndef _di_fss_identify_main_delete_ f_status_t fss_identify_main_delete(fss_identify_main_t * const main) { - for (f_array_length_t i = 0; i < fss_identify_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fss_identify/c/fss_identify.h b/level_3/fss_identify/c/fss_identify.h index 59b73dd..78b231c 100644 --- a/level_3/fss_identify/c/fss_identify.h +++ b/level_3/fss_identify/c/fss_identify.h @@ -143,7 +143,7 @@ extern "C" { #ifndef _di_fss_identify_data_t_ typedef struct { - f_console_parameter_t parameters[fss_identify_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -159,7 +159,7 @@ extern "C" { #define fss_identify_data_initialize \ { \ - fss_identify_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_identify/c/private-identify.c b/level_3/fss_identify/c/private-identify.c index e35b2d0..3ef5c5d 100644 --- a/level_3/fss_identify/c/private-identify.c +++ b/level_3/fss_identify/c/private-identify.c @@ -79,7 +79,7 @@ extern "C" { return status; } - if (main->parameters[fss_identify_parameter_line_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_additional_e) { for (f_array_length_t i = 0; i < ids.used; ++i, ++data->current) { @@ -90,7 +90,7 @@ extern "C" { } } - if (main->parameters[fss_identify_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_total_e].result == f_console_result_found_e) { ++data->total; } else { @@ -103,7 +103,7 @@ extern "C" { } } // for } - else if (main->parameters[fss_identify_parameter_total_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_identify_parameter_total_e].result == f_console_result_found_e) { if (data->name.used) { for (f_array_length_t i = 0; i < ids.used; ++i, ++data->current) { diff --git a/level_3/fss_identify/c/private-print.c b/level_3/fss_identify/c/private-print.c index a8ef271..321e11d 100644 --- a/level_3/fss_identify/c/private-print.c +++ b/level_3/fss_identify/c/private-print.c @@ -11,15 +11,15 @@ extern "C" { flockfile(main->output.to.stream); - if (main->parameters[fss_identify_parameter_object_e].result == f_console_result_found_e || main->parameters[fss_identify_parameter_content_e].result != f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_object_e].result == f_console_result_found_e || main->parameters.array[fss_identify_parameter_content_e].result != f_console_result_found_e) { f_print(id.name, id.used, main->output.to.stream); - if (main->parameters[fss_identify_parameter_object_e].result != f_console_result_found_e || main->parameters[fss_identify_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_object_e].result != f_console_result_found_e || main->parameters.array[fss_identify_parameter_content_e].result == f_console_result_found_e) { f_print_terminated(f_fss_type_header_part5_s, main->output.to.stream); } } - if (main->parameters[fss_identify_parameter_object_e].result != f_console_result_found_e || main->parameters[fss_identify_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_identify_parameter_object_e].result != f_console_result_found_e || main->parameters.array[fss_identify_parameter_content_e].result == f_console_result_found_e) { fl_print_format("%04_ui", main->output.to.stream, id.type); } diff --git a/level_3/fss_payload_read/c/fss_payload_read.c b/level_3/fss_payload_read/c/fss_payload_read.c index b25022f..5f30e43 100644 --- a/level_3/fss_payload_read/c/fss_payload_read.c +++ b/level_3/fss_payload_read/c/fss_payload_read.c @@ -8,12 +8,12 @@ extern "C" { #endif #ifndef _di_fss_payload_read_program_version_ - const f_string_static_t fss_payload_read_program_version_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_READ_program_version_s, 0, FSS_PAYLOAD_READ_program_version_s_length); + const f_string_static_t fss_payload_read_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_version_s, 0, FSS_PAYLOAD_READ_program_version_s_length); #endif // _di_fss_payload_read_program_version_ #ifndef _di_fss_payload_read_program_name_ - const f_string_static_t fss_payload_read_program_name_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_READ_program_name_s, 0, FSS_PAYLOAD_READ_program_name_s_length); - const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length); + const f_string_static_t fss_payload_read_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_s, 0, FSS_PAYLOAD_READ_program_name_s_length); + const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length); #endif // _di_fss_payload_read_program_name_ #ifndef _di_fss_payload_read_print_help_ @@ -141,89 +141,91 @@ extern "C" { f_status_t status = F_none; + f_console_parameter_t parameters[] = fss_payload_read_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_payload_read_total_parameters_d; + { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_payload_total_parameters_d); + f_console_parameter_id_t ids[3] = { fss_payload_read_parameter_no_color_e, fss_payload_read_parameter_light_e, fss_payload_read_parameter_dark_e }; + const f_console_parameter_ids_t choices = { ids, 3 }; - { - f_console_parameter_id_t ids[3] = { fss_payload_read_parameter_no_color_e, fss_payload_read_parameter_light_e, fss_payload_read_parameter_dark_e }; - const f_console_parameter_ids_t choices = { ids, 3 }; + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + fll_program_parameter_process_empty(&main->context, sets); + } - fll_program_parameter_process_empty(&main->context, sets); - } + if (F_status_is_error(status)) { + fss_payload_read_main_delete(main); - if (F_status_is_error(status)) { - fss_payload_read_main_delete(main); - - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_payload_read_parameter_verbosity_quiet_e, fss_payload_read_parameter_verbosity_normal_e, fss_payload_read_parameter_verbosity_verbose_e, fss_payload_read_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_payload_read_parameter_verbosity_quiet_e, fss_payload_read_parameter_verbosity_normal_e, fss_payload_read_parameter_verbosity_verbose_e, fss_payload_read_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fss_payload_read_main_delete(main); - - return status; - } + if (F_status_is_error(status)) { + fss_payload_read_main_delete(main); - if (choice == fss_payload_read_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_payload_read_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_payload_read_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_payload_read_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == fss_payload_read_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_payload_read_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_payload_read_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_payload_read_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_payload_read_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_payload_read_parameter_help_e].result == f_console_result_found_e) { fss_payload_read_print_help(main->output.to, main->context); fss_payload_read_main_delete(main); return status; } - if (main->parameters[fss_payload_read_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_payload_program_version_s); fss_payload_read_main_delete(main); @@ -276,7 +278,7 @@ extern "C" { for (f_array_length_t i = 0; i < 6; ++i) { - if (main->parameters[parameter_code[i]].result == f_console_result_found_e) { + if (main->parameters.array[parameter_code[i]].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -291,7 +293,7 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_payload_read_parameter_columns_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_columns_e].result == f_console_result_found_e) { const f_array_length_t parameter_code[] = { fss_payload_read_parameter_depth_e, fss_payload_read_parameter_line_e, @@ -318,7 +320,7 @@ extern "C" { for (f_array_length_t i = 0; i < 5; ++i) { - if (main->parameters[parameter_code[i]].result == parameter_match[i]) { + if (main->parameters.array[parameter_code[i]].result == parameter_match[i]) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -335,8 +337,8 @@ extern "C" { } // for } - if (F_status_is_error_not(status) && main->parameters[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { - if (main->parameters[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -349,7 +351,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -364,7 +366,7 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[fss_payload_read_parameter_delimit_e].result == f_console_result_additional_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_delimit_e].result == f_console_result_additional_e) { f_array_length_t location = 0; f_array_length_t length = 0; uint16_t signal_check = 0; @@ -372,7 +374,7 @@ extern "C" { // Set the value to 0 to allow for detecting mode based on what is provided. data.delimit_mode = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_payload_read_parameter_delimit_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_read_parameter_delimit_e].values.used; ++i) { if (!((++signal_check) % fss_payload_read_signal_check_d)) { if (fss_payload_read_signal_received(main)) { @@ -383,7 +385,7 @@ extern "C" { signal_check = 0; } - location = main->parameters[fss_payload_read_parameter_delimit_e].values.array[i]; + location = main->parameters.array[fss_payload_read_parameter_delimit_e].values.array[i]; length = strnlen(arguments->argv[location], F_console_parameter_size_d); if (!length) { @@ -521,7 +523,7 @@ extern "C" { } // for if (data.depth_max > 1) { - if (main->parameters[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { fss_payload_read_print_zero(main); } @@ -532,7 +534,7 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[fss_payload_read_parameter_select_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_select_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -606,7 +608,7 @@ extern "C" { status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); break; } @@ -692,12 +694,7 @@ extern "C" { #ifndef _di_fss_payload_read_main_delete_ f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main) { - for (f_array_length_t i = 0; i < fss_payload_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); macro_f_color_context_t_delete_simple(main->context); diff --git a/level_3/fss_payload_read/c/fss_payload_read.h b/level_3/fss_payload_read/c/fss_payload_read.h index 9d7d5c3..9fc157b 100644 --- a/level_3/fss_payload_read/c/fss_payload_read.h +++ b/level_3/fss_payload_read/c/fss_payload_read.h @@ -225,7 +225,7 @@ extern "C" { #ifndef _di_fss_payload_read_main_t_ typedef struct { - f_console_parameter_t parameters[fss_payload_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -241,7 +241,7 @@ extern "C" { #define fss_payload_read_main_t_initialize \ { \ - fss_payload_read_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_payload_read/c/private-print.c b/level_3/fss_payload_read/c/private-print.c index 82d503f..00e9121 100644 --- a/level_3/fss_payload_read/c/private-print.c +++ b/level_3/fss_payload_read/c/private-print.c @@ -222,7 +222,7 @@ extern "C" { #ifndef _di_fss_payload_read_print_content_end_extended_ void fss_payload_read_print_content_end_extended(fss_payload_read_main_t * const main) { - if (main->parameters[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_payload_read_pipe_content_start_s, main->output.to.stream); } else { @@ -234,7 +234,7 @@ extern "C" { #ifndef _di_fss_payload_read_print_content_ignore_ void fss_payload_read_print_content_ignore(fss_payload_read_main_t * const main) { - if (main->parameters[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_payload_read_pipe_content_ignore_s, main->output.to.stream); } } @@ -243,11 +243,11 @@ extern "C" { #ifndef _di_fss_payload_read_print_object_end_ void fss_payload_read_print_object_end(fss_payload_read_main_t * const main) { - if (main->parameters[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_payload_read_pipe_content_start_s, main->output.to.stream); } else { - if (main->parameters[fss_payload_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_content_e].result == f_console_result_found_e) { f_print_dynamic(f_fss_basic_list_open_s, main->output.to.stream); f_print_dynamic(f_fss_basic_list_open_end_s, main->output.to.stream); } @@ -261,7 +261,7 @@ extern "C" { #ifndef _di_fss_payload_read_print_object_end_extended_ void fss_payload_read_print_object_end_extended(fss_payload_read_main_t * const main) { - if (main->parameters[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream); } else { @@ -273,7 +273,7 @@ extern "C" { #ifndef _di_fss_payload_read_print_set_end_ void fss_payload_read_print_set_end(fss_payload_read_main_t * const main) { - if (main->parameters[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream); } } @@ -282,7 +282,7 @@ extern "C" { #ifndef _di_fss_payload_read_print_set_end_extended_ void fss_payload_read_print_set_end_extended(fss_payload_read_main_t * const main) { - if (main->parameters[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) { f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream); } else { diff --git a/level_3/fss_payload_read/c/private-read.c b/level_3/fss_payload_read/c/private-read.c index f227352..6cc4ecd 100644 --- a/level_3/fss_payload_read/c/private-read.c +++ b/level_3/fss_payload_read/c/private-read.c @@ -63,8 +63,8 @@ extern "C" { { f_array_length_t depth_size = 1; - if (main->parameters[fss_payload_read_parameter_depth_e].result == f_console_result_additional_e) { - depth_size = main->parameters[fss_payload_read_parameter_depth_e].values.used; + if (main->parameters.array[fss_payload_read_parameter_depth_e].result == f_console_result_additional_e) { + depth_size = main->parameters.array[fss_payload_read_parameter_depth_e].values.used; } if (depth_size > data->depths.size) { @@ -102,11 +102,11 @@ extern "C" { macro_f_string_dynamic_t_clear(data->depths.array[i].value_name); - if (!main->parameters[fss_payload_read_parameter_depth_e].values.used) { + if (!main->parameters.array[fss_payload_read_parameter_depth_e].values.used) { position_depth = 0; } else { - position_depth = main->parameters[fss_payload_read_parameter_depth_e].values.array[i]; + position_depth = main->parameters.array[fss_payload_read_parameter_depth_e].values.array[i]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth])); @@ -119,18 +119,18 @@ extern "C" { } } - if (main->parameters[fss_payload_read_parameter_at_e].result == f_console_result_additional_e) { - for (; position_at < main->parameters[fss_payload_read_parameter_at_e].values.used; ++position_at) { + if (main->parameters.array[fss_payload_read_parameter_at_e].result == f_console_result_additional_e) { + for (; position_at < main->parameters.array[fss_payload_read_parameter_at_e].values.used; ++position_at) { - if (main->parameters[fss_payload_read_parameter_at_e].values.array[position_at] < position_depth) { + if (main->parameters.array[fss_payload_read_parameter_at_e].values.array[position_at] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_payload_read_parameter_at_e].values.array[position_at] > main->parameters[fss_payload_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_payload_read_parameter_at_e].values.array[position_at] > main->parameters.array[fss_payload_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_at = main->parameters[fss_payload_read_parameter_at_e].values.array[position_at]; + data->depths.array[i].index_at = main->parameters.array[fss_payload_read_parameter_at_e].values.array[position_at]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at])); @@ -144,20 +144,20 @@ extern "C" { } // for } - if (main->parameters[fss_payload_read_parameter_name_e].result == f_console_result_additional_e) { - for (; position_name < main->parameters[fss_payload_read_parameter_name_e].values.used; ++position_name) { + if (main->parameters.array[fss_payload_read_parameter_name_e].result == f_console_result_additional_e) { + for (; position_name < main->parameters.array[fss_payload_read_parameter_name_e].values.used; ++position_name) { - if (main->parameters[fss_payload_read_parameter_name_e].values.array[position_name] < position_depth) { + if (main->parameters.array[fss_payload_read_parameter_name_e].values.array[position_name] < position_depth) { continue; } - if (i + 1 < data->depths.used && main->parameters[fss_payload_read_parameter_name_e].values.array[position_name] > main->parameters[fss_payload_read_parameter_depth_e].values.array[i + 1]) { + if (i + 1 < data->depths.used && main->parameters.array[fss_payload_read_parameter_name_e].values.array[position_name] > main->parameters.array[fss_payload_read_parameter_depth_e].values.array[i + 1]) { break; } - data->depths.array[i].index_name = main->parameters[fss_payload_read_parameter_name_e].values.array[position_name]; + data->depths.array[i].index_name = main->parameters.array[fss_payload_read_parameter_name_e].values.array[position_name]; - if (main->parameters[fss_payload_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e) { status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name); } else { @@ -165,7 +165,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), main->parameters[fss_payload_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); + fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true); return status; } @@ -271,7 +271,7 @@ extern "C" { } } else { - fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_payload_read", F_true, file_name, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_payload_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); } return status; @@ -302,7 +302,7 @@ extern "C" { if (F_status_is_error(status)) { const f_string_t file_name = fss_payload_read_file_identify(input.start, data->files); - fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, file_name, "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); return status; } @@ -316,8 +316,8 @@ extern "C" { #ifndef _di_fss_payload_read_load_number_ f_status_t fss_payload_read_load_number(fss_payload_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) { - if (main->parameters[parameter].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1]; + if (main->parameters.array[parameter].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number); @@ -344,7 +344,7 @@ extern "C" { // This standard does not support multiple content groups, except for "headers" FSS-0001 Extended at depth 1. if (!(data->option & fss_payload_read_data_option_extended_d)) { if ((data->option & fss_payload_read_data_option_select_d) && data->select) { - if (main->parameters[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->output.to.stream); fss_payload_read_print_zero(main); @@ -372,7 +372,7 @@ extern "C" { if (fl_string_dynamic_partial_compare_string(F_fss_string_header_s, data->buffer, F_fss_string_header_s_length, data->objects.array[i]) == F_equal_to) { if (names[i]) break; - if (main->parameters[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { flockfile(main->output.to.stream); fss_payload_read_print_zero(main); @@ -991,53 +991,53 @@ extern "C" { f_status_t status = F_none; - if (main->parameters[fss_payload_read_parameter_at_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_payload_read_parameter_at_e].result == f_console_result_additional_e) { data->option |= fss_payload_read_data_option_at_d; } - if (main->parameters[fss_payload_read_parameter_columns_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_columns_e].result == f_console_result_found_e) { data->option |= fss_payload_read_data_option_columns_d; } - if (main->parameters[fss_payload_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_content_e].result == f_console_result_found_e) { data->option |= fss_payload_read_data_option_content_d; } - if (main->parameters[fss_payload_read_parameter_empty_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_empty_e].result == f_console_result_found_e) { data->option |= fss_payload_read_data_option_empty_d; } - if (main->parameters[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_payload_read_data_option_line_d; status = fss_payload_read_load_number(main, fss_payload_read_parameter_line_e, fss_payload_read_long_line_s, arguments, &data->line); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_payload_read_parameter_name_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_payload_read_parameter_name_e].result == f_console_result_additional_e) { data->option |= fss_payload_read_data_option_name_d; } - if (main->parameters[fss_payload_read_parameter_object_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_object_e].result == f_console_result_found_e) { data->option |= fss_payload_read_data_option_object_d; } - if (main->parameters[fss_payload_read_parameter_raw_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_raw_e].result == f_console_result_found_e) { data->option |= fss_payload_read_data_option_raw_d; } - if (main->parameters[fss_payload_read_parameter_select_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_payload_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_payload_read_data_option_select_d; status = fss_payload_read_load_number(main, fss_payload_read_parameter_select_e, fss_payload_read_long_select_s, arguments, &data->select); if (F_status_is_error(status)) return status; } - if (main->parameters[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_total_e].result == f_console_result_found_e) { data->option |= fss_payload_read_data_option_total_d; } - if (main->parameters[fss_payload_read_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e) { data->option |= fss_payload_read_data_option_trim_d; } diff --git a/level_3/fss_payload_write/c/fss_payload_write.c b/level_3/fss_payload_write/c/fss_payload_write.c index 975bb52..739952c 100644 --- a/level_3/fss_payload_write/c/fss_payload_write.c +++ b/level_3/fss_payload_write/c/fss_payload_write.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_fss_payload_write_program_version_ - const f_string_static_t fss_payload_write_program_version_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_WRITE_program_version_s, 0, FSS_PAYLOAD_WRITE_program_version_s_length); + const f_string_static_t fss_payload_write_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_version_s, 0, FSS_PAYLOAD_WRITE_program_version_s_length); #endif // _di_fss_payload_write_program_version_ #ifndef _di_fss_payload_write_program_name_ - const f_string_static_t fss_payload_write_program_name_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_WRITE_program_name_s, 0, FSS_PAYLOAD_WRITE_program_name_s_length); - const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length); + const f_string_static_t fss_payload_write_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_s, 0, FSS_PAYLOAD_WRITE_program_name_s_length); + const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length); #endif // _di_fss_payload_write_program_name_ #ifndef _di_fss_payload_write_print_help_ @@ -70,87 +70,89 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_payload_write_total_parameters_d); + f_console_parameter_t parameters[] = fss_payload_write_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_payload_write_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_payload_write_parameter_no_color_e, fss_payload_write_parameter_light_e, fss_payload_write_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_payload_write_parameter_no_color_e, fss_payload_write_parameter_light_e, fss_payload_write_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_payload_write_main_delete(main); - return F_status_set_error(status); - } + if (F_status_is_error(status)) { + fss_payload_write_main_delete(main); + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_payload_write_parameter_verbosity_quiet_e, fss_payload_write_parameter_verbosity_normal_e, fss_payload_write_parameter_verbosity_verbose_e, fss_payload_write_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_payload_write_parameter_verbosity_quiet_e, fss_payload_write_parameter_verbosity_normal_e, fss_payload_write_parameter_verbosity_verbose_e, fss_payload_write_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - if (F_status_is_error(status)) { - fss_payload_write_main_delete(main); - return status; - } - - if (choice == fss_payload_write_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_payload_write_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_payload_write_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_payload_write_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + if (F_status_is_error(status)) { + fss_payload_write_main_delete(main); + return status; } - status = F_none; + if (choice == fss_payload_write_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_payload_write_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_payload_write_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_payload_write_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_payload_write_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_payload_write_parameter_help_e].result == f_console_result_found_e) { fss_payload_write_print_help(main->output.to, main->context); fss_payload_write_main_delete(main); return status; } - if (main->parameters[fss_payload_write_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_payload_write_program_version_s); fss_payload_write_main_delete(main); @@ -166,8 +168,8 @@ extern "C" { output.size_write = main->output.to.size_write; if (F_status_is_error_not(status)) { - if (main->parameters[fss_payload_write_parameter_file_e].result == f_console_result_additional_e) { - if (main->parameters[fss_payload_write_parameter_file_e].values.used > 1) { + if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_payload_write_parameter_file_e].values.used > 1) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -181,40 +183,40 @@ extern "C" { status = F_status_set_error(F_parameter); } else { - const f_array_length_t location = main->parameters[fss_payload_write_parameter_file_e].values.array[0]; + const f_array_length_t location = main->parameters.array[fss_payload_write_parameter_file_e].values.array[0]; output.id = -1; output.stream = 0; status = f_file_stream_open(arguments->argv[location], 0, &output); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], f_file_operation_open_s, fll_error_file_type_file_e); } } } - else if (main->parameters[fss_payload_write_parameter_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_found_e) { fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_file_s); status = F_status_set_error(F_parameter); } } if (F_status_is_error_not(status)) { - if (main->parameters[fss_payload_write_parameter_object_e].locations.used || main->parameters[fss_payload_write_parameter_content_e].locations.used) { - if (main->parameters[fss_payload_write_parameter_object_e].locations.used) { - if (main->parameters[fss_payload_write_parameter_object_e].locations.used != main->parameters[fss_payload_write_parameter_object_e].values.used) { + if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used || main->parameters.array[fss_payload_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used) { + if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_object_e].values.used) { fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_object_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_payload_write_parameter_content_e].locations.used != main->parameters[fss_payload_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) { fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_payload_write_parameter_object_e].locations.used != main->parameters[fss_payload_write_parameter_content_e].locations.used && main->parameters[fss_payload_write_parameter_partial_e].result == f_console_result_none_e) { + else if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].locations.used && main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_none_e) { fss_payload_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_payload_write_parameter_content_e].locations.used && main->parameters[fss_payload_write_parameter_partial_e].locations.used) { - if (main->parameters[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) { + else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used && main->parameters.array[fss_payload_write_parameter_partial_e].locations.used) { + if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -234,17 +236,17 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) { f_array_length_t location_object = 0; f_array_length_t location_content = 0; f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_payload_write_parameter_object_e].locations.used; ++i) { - location_object = main->parameters[fss_payload_write_parameter_object_e].locations.array[i]; - location_content = main->parameters[fss_payload_write_parameter_content_e].locations.array[i]; - location_sub_object = main->parameters[fss_payload_write_parameter_object_e].locations_sub.array[i]; - location_sub_content = main->parameters[fss_payload_write_parameter_content_e].locations_sub.array[i]; + for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].locations.used; ++i) { + location_object = main->parameters.array[fss_payload_write_parameter_object_e].locations.array[i]; + location_content = main->parameters.array[fss_payload_write_parameter_content_e].locations.array[i]; + location_sub_object = main->parameters.array[fss_payload_write_parameter_object_e].locations_sub.array[i]; + location_sub_content = main->parameters.array[fss_payload_write_parameter_content_e].locations_sub.array[i]; if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -266,12 +268,12 @@ extern "C" { } } } - else if (main->parameters[fss_payload_write_parameter_content_e].locations.used) { - if (main->parameters[fss_payload_write_parameter_content_e].locations.used != main->parameters[fss_payload_write_parameter_content_e].values.used) { + else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used) { + if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) { fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s); status = F_status_set_error(F_parameter); } - else if (!main->parameters[fss_payload_write_parameter_partial_e].locations.used) { + else if (!main->parameters.array[fss_payload_write_parameter_partial_e].locations.used) { fss_payload_write_error_parameter_same_times_print(main); status = F_status_set_error(F_parameter); } @@ -294,7 +296,7 @@ extern "C" { } if (F_status_is_error_not(status) && main->process_pipe) { - if (main->parameters[fss_payload_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -311,7 +313,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_payload_write_parameter_prepend_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -324,8 +326,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[fss_payload_write_parameter_prepend_e].values.array[main->parameters[fss_payload_write_parameter_prepend_e].values.used - 1]; + else if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1]; const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d); if (length) { @@ -373,7 +375,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_payload_write_parameter_ignore_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_ignore_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -386,9 +388,9 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[fss_payload_write_parameter_ignore_e].result == f_console_result_additional_e) { - const f_array_length_t total_locations = main->parameters[fss_payload_write_parameter_ignore_e].locations.used; - const f_array_length_t total_arguments = main->parameters[fss_payload_write_parameter_ignore_e].values.used; + else if (main->parameters.array[fss_payload_write_parameter_ignore_e].result == f_console_result_additional_e) { + const f_array_length_t total_locations = main->parameters.array[fss_payload_write_parameter_ignore_e].locations.used; + const f_array_length_t total_arguments = main->parameters.array[fss_payload_write_parameter_ignore_e].values.used; if (total_locations * 2 > total_arguments) { flockfile(main->error.to.stream); @@ -407,14 +409,14 @@ extern "C" { f_fss_quote_t quote = F_fss_delimit_quote_double_s; if (F_status_is_error_not(status)) { - if (main->parameters[fss_payload_write_parameter_double_e].result == f_console_result_found_e) { - if (main->parameters[fss_payload_write_parameter_single_e].result == f_console_result_found_e) { - if (main->parameters[fss_payload_write_parameter_double_e].location < main->parameters[fss_payload_write_parameter_single_e].location) { + if (main->parameters.array[fss_payload_write_parameter_double_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_double_e].location < main->parameters.array[fss_payload_write_parameter_single_e].location) { quote = F_fss_delimit_quote_single_s; } } } - else if (main->parameters[fss_payload_write_parameter_single_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) { quote = F_fss_delimit_quote_single_s; } } @@ -445,17 +447,17 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[fss_payload_write_parameter_partial_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_found_e) { - if (main->parameters[fss_payload_write_parameter_object_e].result == f_console_result_additional_e) { - for (f_array_length_t i = 0; i < main->parameters[fss_payload_write_parameter_object_e].values.used; ++i) { + if (main->parameters.array[fss_payload_write_parameter_object_e].result == f_console_result_additional_e) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].values.used; ++i) { if (fss_payload_write_signal_received(main)) { status = F_status_set_error(F_interrupt); break; } - object.string = arguments->argv[main->parameters[fss_payload_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; @@ -464,14 +466,14 @@ extern "C" { } // for } else { - for (f_array_length_t i = 0; i < main->parameters[fss_payload_write_parameter_content_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_content_e].values.used; ++i) { if (fss_payload_write_signal_received(main)) { status = F_status_set_error(F_interrupt); break; } - content.string = arguments->argv[main->parameters[fss_payload_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -481,18 +483,18 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_payload_write_parameter_object_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].values.used; ++i) { if (fss_payload_write_signal_received(main)) { status = F_status_set_error(F_interrupt); break; } - object.string = arguments->argv[main->parameters[fss_payload_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; - content.string = arguments->argv[main->parameters[fss_payload_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -511,7 +513,7 @@ extern "C" { funlockfile(main->error.to.stream); } } - else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters[fss_payload_write_parameter_file_e].result == f_console_result_none_e) { + else if (main->error.verbosity != f_console_verbosity_quiet_e && main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_none_e) { // Ensure there is always a newline at the end, unless in quiet mode. fll_print_dynamic(f_string_eol_s, main->output.to.stream); @@ -530,7 +532,7 @@ extern "C" { content.size = 0; } - if (main->parameters[fss_payload_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_additional_e) { if (output.id != -1) { f_file_stream_close(F_true, &output); } @@ -555,12 +557,7 @@ extern "C" { #ifndef _di_fss_payload_write_main_delete_ f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main) { - for (f_array_length_t i = 0; i < fss_payload_write_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fss_payload_write/c/fss_payload_write.h b/level_3/fss_payload_write/c/fss_payload_write.h index b606c70..74a723e 100644 --- a/level_3/fss_payload_write/c/fss_payload_write.h +++ b/level_3/fss_payload_write/c/fss_payload_write.h @@ -158,7 +158,7 @@ extern "C" { #ifndef _di_fss_payload_write_main_t_ typedef struct { - f_console_parameter_t parameters[fss_payload_write_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -176,7 +176,7 @@ extern "C" { #define fss_payload_write_main_t_initialize \ { \ - fss_payload_write_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_payload_write/c/private-write.c b/level_3/fss_payload_write/c/private-write.c index 13305d8..fb1f07b 100644 --- a/level_3/fss_payload_write/c/private-write.c +++ b/level_3/fss_payload_write/c/private-write.c @@ -72,7 +72,7 @@ extern "C" { if (content) { bool trim = F_false; - if (main->parameters[fss_payload_write_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_trim_e].result == f_console_result_found_e) { trim = F_true; } @@ -112,7 +112,7 @@ extern "C" { } if (content) { - if (main->parameters[fss_payload_write_parameter_trim_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_payload_write_parameter_trim_e].result == f_console_result_found_e) { complete = f_fss_complete_full_trim_e; } else { diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index a166f78..db5a848 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_fss_status_code_program_version_ - const f_string_static_t fss_status_code_program_version_s = macro_f_string_static_t_initialize2(FSS_STATUS_CODE_program_version_s, 0, FSS_STATUS_CODE_program_version_s_length); + const f_string_static_t fss_status_code_program_version_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_program_version_s, 0, FSS_STATUS_CODE_program_version_s_length); #endif // _di_fss_status_code_program_version_ #ifndef _di_fss_status_code_program_name_ - const f_string_static_t fss_status_code_program_name_s = macro_f_string_static_t_initialize2(FSS_STATUS_CODE_program_name_s, 0, FSS_STATUS_CODE_program_name_s_length); - const f_string_static_t fss_status_code_program_name_long_s = macro_f_string_static_t_initialize2(FSS_STATUS_CODE_program_name_long_s, 0, FSS_STATUS_CODE_program_name_long_s_length); + const f_string_static_t fss_status_code_program_name_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_program_name_s, 0, FSS_STATUS_CODE_program_name_s_length); + const f_string_static_t fss_status_code_program_name_long_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_program_name_long_s, 0, FSS_STATUS_CODE_program_name_long_s_length); #endif // _di_fss_status_code_program_name_ #ifndef _di_fss_status_code_print_help_ @@ -52,95 +52,97 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, fss_status_code_total_parameters_d); + f_console_parameter_t parameters[] = fss_status_code_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = fss_status_code_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { fss_status_code_parameter_no_color_e, fss_status_code_parameter_light_e, fss_status_code_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { fss_status_code_parameter_no_color_e, fss_status_code_parameter_light_e, fss_status_code_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fss_status_code_main_delete(main); - return F_status_set_error(status); - } + if (F_status_is_error(status)) { + fss_status_code_main_delete(main); + return F_status_set_error(status); } + } + + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { fss_status_code_parameter_verbosity_quiet_e, fss_status_code_parameter_verbosity_normal_e, fss_status_code_parameter_verbosity_verbose_e, fss_status_code_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { fss_status_code_parameter_verbosity_quiet_e, fss_status_code_parameter_verbosity_normal_e, fss_status_code_parameter_verbosity_verbose_e, fss_status_code_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); - - if (F_status_is_error(status)) { - fss_status_code_main_delete(main); - return status; - } - - if (choice == fss_status_code_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == fss_status_code_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == fss_status_code_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == fss_status_code_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); + + if (F_status_is_error(status)) { + fss_status_code_main_delete(main); + return status; } - status = F_none; + if (choice == fss_status_code_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == fss_status_code_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == fss_status_code_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == fss_status_code_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[fss_status_code_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[fss_status_code_parameter_help_e].result == f_console_result_found_e) { fss_status_code_print_help(main->output.to, main->context); fss_status_code_main_delete(main); return F_none; } - if (main->parameters[fss_status_code_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_status_code_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, fss_status_code_program_version_s); fss_status_code_main_delete(main); return F_none; } - if (main->parameters[fss_status_code_parameter_is_error_e].result == f_console_result_found_e) { - if (main->parameters[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_status_code_parameter_is_error_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -154,7 +156,7 @@ extern "C" { fss_status_code_main_delete(main); return F_status_set_error(status); } - else if (main->parameters[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -169,7 +171,7 @@ extern "C" { return F_status_set_error(status); } } - else if (main->parameters[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e && main->parameters[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e && main->parameters.array[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -193,7 +195,7 @@ extern "C" { f_status_t status2 = F_none; - if (main->parameters[fss_status_code_parameter_is_error_e].result == f_console_result_found_e || main->parameters[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e || main->parameters[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_status_code_parameter_is_error_e].result == f_console_result_found_e || main->parameters.array[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e || main->parameters.array[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) { if (main->process_pipe) { // @todo call fss_status_code_process_check() here for all main from pipe that is space separated. } @@ -224,7 +226,7 @@ extern "C" { funlockfile(main->output.to.stream); } } - else if (main->parameters[fss_status_code_parameter_number_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_status_code_parameter_number_e].result == f_console_result_found_e) { if (main->process_pipe) { // @todo call fss_status_code_process_number() here for all main from pipe that is space separated. } @@ -304,12 +306,7 @@ extern "C" { #ifndef _di_fss_status_code_main_delete_ f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main) { - for (f_array_length_t i = 0; i < fss_status_code_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/fss_status_code/c/fss_status_code.h b/level_3/fss_status_code/c/fss_status_code.h index 099bfa3..b1d3639 100644 --- a/level_3/fss_status_code/c/fss_status_code.h +++ b/level_3/fss_status_code/c/fss_status_code.h @@ -134,7 +134,7 @@ extern "C" { #ifndef _di_fss_status_code_main_t_ typedef struct { - f_console_parameter_t parameters[fss_status_code_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -150,7 +150,7 @@ extern "C" { #define fss_status_code_main_t_initialize \ { \ - fss_status_code_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/fss_status_code/c/private-fss_status_code.c b/level_3/fss_status_code/c/private-fss_status_code.c index fa17af4..0583039 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.c +++ b/level_3/fss_status_code/c/private-fss_status_code.c @@ -16,7 +16,7 @@ extern "C" { if (F_status_is_error(status)) return status; } - if (main->parameters[fss_status_code_parameter_is_error_e].result == f_console_result_found_e) { + if (main->parameters.array[fss_status_code_parameter_is_error_e].result == f_console_result_found_e) { if (F_status_is_error(number)) { f_print_terminated(f_status_true_s, main->output.to.stream); } @@ -26,7 +26,7 @@ extern "C" { f_print_dynamic(f_string_eol_s, main->output.to.stream); } - else if (main->parameters[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e) { if (F_status_is_warning(number)) { f_print_terminated(f_status_true_s, main->output.to.stream); } @@ -36,7 +36,7 @@ extern "C" { f_print_dynamic(f_string_eol_s, main->output.to.stream); } - else if (main->parameters[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) { + else if (main->parameters.array[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) { if (F_status_is_fine(number)) { f_print_terminated(f_status_true_s, main->output.to.stream); } diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 062c66d..e34682d 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_iki_read_program_version_ - const f_string_static_t iki_read_program_version_s = macro_f_string_static_t_initialize2(IKI_READ_program_version_s, 0, IKI_READ_program_version_s_length); + const f_string_static_t iki_read_program_version_s = macro_f_string_static_t_initialize(IKI_READ_program_version_s, 0, IKI_READ_program_version_s_length); #endif // _di_iki_read_program_version_ #ifndef _di_iki_read_program_name_ - const f_string_static_t iki_read_program_name_s = macro_f_string_static_t_initialize2(IKI_READ_program_name_s, 0, IKI_READ_program_name_s_length); - const f_string_static_t iki_read_program_name_long_s = macro_f_string_static_t_initialize2(IKI_READ_program_name_long_s, 0, IKI_READ_program_name_long_s_length); + const f_string_static_t iki_read_program_name_s = macro_f_string_static_t_initialize(IKI_READ_program_name_s, 0, IKI_READ_program_name_s_length); + const f_string_static_t iki_read_program_name_long_s = macro_f_string_static_t_initialize(IKI_READ_program_name_long_s, 0, IKI_READ_program_name_long_s_length); #endif // _di_iki_read_program_name_ #ifndef _di_iki_read_print_help_ @@ -79,90 +79,92 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, iki_read_total_parameters_d); + f_console_parameter_t parameters[] = iki_read_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = iki_read_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { iki_read_parameter_no_color_e, iki_read_parameter_light_e, iki_read_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { iki_read_parameter_no_color_e, iki_read_parameter_light_e, iki_read_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - if (main->error.verbosity == f_console_verbosity_verbose_e) { - fll_print_dynamic(f_string_eol_s, main->error.to.stream); - } + if (main->error.verbosity == f_console_verbosity_verbose_e) { + fll_print_dynamic(f_string_eol_s, main->error.to.stream); + } - iki_read_main_delete(main); + iki_read_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { iki_read_parameter_verbosity_quiet_e, iki_read_parameter_verbosity_normal_e, iki_read_parameter_verbosity_verbose_e, iki_read_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { iki_read_parameter_verbosity_quiet_e, iki_read_parameter_verbosity_normal_e, iki_read_parameter_verbosity_verbose_e, iki_read_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - iki_read_main_delete(main); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - return status; - } + iki_read_main_delete(main); - if (choice == iki_read_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == iki_read_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == iki_read_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == iki_read_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == iki_read_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == iki_read_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == iki_read_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == iki_read_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[iki_read_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[iki_read_parameter_help_e].result == f_console_result_found_e) { iki_read_print_help(main->output.to, main->context); iki_read_main_delete(main); @@ -170,7 +172,7 @@ extern "C" { return F_none; } - if (main->parameters[iki_read_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, iki_read_program_version_s); iki_read_main_delete(main); @@ -179,7 +181,7 @@ extern "C" { } if (main->remaining.used > 0 || main->process_pipe) { - if (main->parameters[iki_read_parameter_at_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -192,8 +194,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[iki_read_parameter_at_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[iki_read_parameter_at_e].values.array[main->parameters[iki_read_parameter_at_e].values.used - 1]; + else if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[iki_read_parameter_at_e].values.array[main->parameters.array[iki_read_parameter_at_e].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[index])); f_number_unsigned_t number = 0; @@ -208,7 +210,7 @@ extern "C" { main->at = number; - if (main->parameters[iki_read_parameter_whole_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_whole_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -225,7 +227,7 @@ extern "C" { } } - if (main->parameters[iki_read_parameter_line_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_line_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -238,8 +240,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - else if (main->parameters[iki_read_parameter_line_e].result == f_console_result_additional_e) { - const f_array_length_t index = main->parameters[iki_read_parameter_line_e].values.array[main->parameters[iki_read_parameter_line_e].values.used - 1]; + else if (main->parameters.array[iki_read_parameter_line_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[iki_read_parameter_line_e].values.array[main->parameters.array[iki_read_parameter_line_e].values.used - 1]; const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[index])); f_number_unsigned_t number = 0; @@ -255,7 +257,7 @@ extern "C" { main->line = number; } - if (main->parameters[iki_read_parameter_name_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_name_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -269,8 +271,8 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (main->parameters[iki_read_parameter_substitute_e].result != f_console_result_none_e) { - if (main->parameters[iki_read_parameter_substitute_e].result == f_console_result_found_e || main->parameters[iki_read_parameter_substitute_e].values.used % 3 != 0) { + if (main->parameters.array[iki_read_parameter_substitute_e].result != f_console_result_none_e) { + if (main->parameters.array[iki_read_parameter_substitute_e].result == f_console_result_found_e || main->parameters.array[iki_read_parameter_substitute_e].values.used % 3 != 0) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -284,7 +286,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (main->parameters[iki_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -301,8 +303,8 @@ extern "C" { } } - if (main->parameters[iki_read_parameter_literal_e].result == f_console_result_found_e) { - if (main->parameters[iki_read_parameter_object_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_literal_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_object_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -318,7 +320,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (main->parameters[iki_read_parameter_content_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_content_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -334,7 +336,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (main->parameters[iki_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -352,8 +354,8 @@ extern "C" { main->mode = iki_read_mode_literal_e; } - else if (main->parameters[iki_read_parameter_object_e].result == f_console_result_found_e) { - if (main->parameters[iki_read_parameter_content_e].result == f_console_result_found_e) { + else if (main->parameters.array[iki_read_parameter_object_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_content_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -369,7 +371,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (main->parameters[iki_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -387,7 +389,7 @@ extern "C" { main->mode = iki_read_mode_object_e; } - else if (main->parameters[iki_read_parameter_total_e].result == f_console_result_found_e) { + else if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) { main->mode = iki_read_mode_total_e; } else { @@ -395,8 +397,8 @@ extern "C" { main->mode = iki_read_mode_content_e; } - if (main->parameters[iki_read_parameter_whole_e].result == f_console_result_found_e) { - if (main->parameters[iki_read_parameter_total_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_whole_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_total_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -431,7 +433,7 @@ extern "C" { status = f_file_read(file, &main->buffer); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read", F_true, "-", "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read", F_true, "-", f_file_operation_process_s, fll_error_file_type_file_e); } else { status = iki_read_process_buffer(main, arguments, "-"); @@ -463,14 +465,14 @@ extern "C" { status = f_file_open(arguments->argv[main->remaining.array[i]], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->remaining.array[i]], "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e); break; } status = f_file_size_by_id(file.id, &total); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e); f_file_stream_close(F_true, &file); break; @@ -487,7 +489,7 @@ extern "C" { f_file_stream_close(F_true, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, arguments->argv[main->remaining.array[i]], "process", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e); break; } @@ -527,12 +529,7 @@ extern "C" { #ifndef _di_iki_read_main_delete_ f_status_t iki_read_main_delete(iki_read_main_t * const main) { - for (f_array_length_t i = 0; i < iki_read_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); f_string_dynamic_resize(0, &main->buffer); diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index 12af928..ca7413a 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -187,8 +187,8 @@ extern "C" { #define macro_iki_read_substitution_t_initialize(replace, with) \ { \ - macro_f_string_static_t_initialize(replace), \ - macro_f_string_static_t_initialize(with), \ + macro_f_string_static_t_initialize2(replace), \ + macro_f_string_static_t_initialize2(with), \ } #endif // _di_iki_read_substitution_t_ @@ -213,7 +213,7 @@ extern "C" { #ifndef _di_iki_read_main_t_ typedef struct { - f_console_parameter_t parameters[iki_read_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -238,7 +238,7 @@ extern "C" { #define iki_read_main_t_initialize \ { \ - iki_read_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/iki_read/c/private-read.c b/level_3/iki_read/c/private-read.c index e3803c9..1cf0279 100644 --- a/level_3/iki_read/c/private-read.c +++ b/level_3/iki_read/c/private-read.c @@ -10,7 +10,7 @@ extern "C" { #ifndef _di_iki_read_process_at_ f_status_t iki_read_process_at(iki_read_main_t * const main, const f_string_t file_name, f_string_range_t *range) { - if (main->parameters[iki_read_parameter_line_e].result != f_console_result_additional_e) { + if (main->parameters.array[iki_read_parameter_line_e].result != f_console_result_additional_e) { return F_false; } @@ -41,7 +41,7 @@ extern "C" { f_status_t status = F_none; iki_data_t iki_data = iki_data_t_initialize; - if (main->parameters[iki_read_parameter_whole_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_read_parameter_whole_e].result == f_console_result_found_e) { f_string_range_t buffer_range = macro_f_string_range_t_initialize(main->buffer.used); status = iki_read_process_at(main, file_name, &buffer_range); @@ -139,7 +139,7 @@ extern "C" { } } - if (main->parameters[iki_read_parameter_name_e].result == f_console_result_additional_e) { + if (main->parameters.array[iki_read_parameter_name_e].result == f_console_result_additional_e) { f_string_dynamic_t name = f_string_dynamic_t_initialize; f_array_length_t index = 0; @@ -148,9 +148,9 @@ extern "C" { f_array_length_t matches = 0; buffer_range->start = 0; - for (; i < main->parameters[iki_read_parameter_name_e].values.used; ++i) { + for (; i < main->parameters.array[iki_read_parameter_name_e].values.used; ++i) { - index = main->parameters[iki_read_parameter_name_e].values.array[i]; + index = main->parameters.array[iki_read_parameter_name_e].values.array[i]; name.used = 0; status = f_string_append_nulless(arguments->argv[index], strlen(arguments->argv[index]), &name); @@ -177,7 +177,7 @@ extern "C" { if (status == F_equal_to) { unmatched = F_false; - if (main->parameters[iki_read_parameter_at_e].result == f_console_result_additional_e) { + if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_additional_e) { if (matches++ != main->at) continue; } @@ -201,7 +201,7 @@ extern "C" { else status = F_none; } else if (ranges->used) { - if (main->parameters[iki_read_parameter_at_e].result == f_console_result_additional_e) { + if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_additional_e) { if (main->at < ranges->used) { flockfile(main->output.to.stream); @@ -310,14 +310,14 @@ extern "C" { substitution_range.start = 0; - if (main->parameters[iki_read_parameter_name_e].result == f_console_result_additional_e) { + if (main->parameters.array[iki_read_parameter_name_e].result == f_console_result_additional_e) { f_array_length_t i = 0; f_array_length_t j = 0; f_array_length_t length_argument = 0; - for (f_array_length_t index = 0; i < main->parameters[iki_read_parameter_name_e].values.used; ++i) { + for (f_array_length_t index = 0; i < main->parameters.array[iki_read_parameter_name_e].values.used; ++i) { - index = main->parameters[iki_read_parameter_name_e].values.array[i]; + index = main->parameters.array[iki_read_parameter_name_e].values.array[i]; length_argument = strnlen(arguments->argv[index], F_console_parameter_size_d); for (j = 0, name_missed = F_true; j < names.used; ++j) { @@ -489,7 +489,7 @@ extern "C" { f_array_length_t total = 0; - if (main->parameters[iki_read_parameter_name_e].result == f_console_result_additional_e) { + if (main->parameters.array[iki_read_parameter_name_e].result == f_console_result_additional_e) { f_string_dynamic_t name = f_string_dynamic_t_initialize; f_array_length_t index = 0; @@ -498,7 +498,7 @@ extern "C" { range.start = 0; - for (uint16_t signal_check = 0; i < main->parameters[iki_read_parameter_name_e].values.used; ++i) { + for (uint16_t signal_check = 0; i < main->parameters.array[iki_read_parameter_name_e].values.used; ++i) { if (!((++signal_check) % iki_read_signal_check_d)) { if (iki_read_signal_received(main)) { @@ -510,7 +510,7 @@ extern "C" { signal_check = 0; } - index = main->parameters[iki_read_parameter_name_e].values.array[i]; + index = main->parameters.array[iki_read_parameter_name_e].values.array[i]; name.used = 0; status = f_string_append_nulless(arguments->argv[index], strlen(arguments->argv[index]), &name); @@ -539,7 +539,7 @@ extern "C" { } // if that at position is within the actual total, then the total at the given position is 1, otherwise is 0. - if (main->parameters[iki_read_parameter_at_e].result == f_console_result_additional_e) { + if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_additional_e) { if (main->at < total) { total = 1; } @@ -557,7 +557,7 @@ extern "C" { #ifndef _di_iki_read_substitutions_identify_ f_status_t iki_read_substitutions_identify(iki_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t file_name, f_iki_vocabulary_t *vocabulary, iki_read_substitutions_t *substitutionss) { - if (main->parameters[iki_read_parameter_substitute_e].result != f_console_result_additional_e) { + if (main->parameters.array[iki_read_parameter_substitute_e].result != f_console_result_additional_e) { return F_none; } @@ -571,7 +571,7 @@ extern "C" { f_array_length_t length = 0; - f_console_parameter_t *parameter = &main->parameters[iki_read_parameter_substitute_e]; + f_console_parameter_t *parameter = &main->parameters.array[iki_read_parameter_substitute_e]; for (; i < parameter->values.used; i += 3) { diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index ff8222a..14153bd 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_iki_write_program_version_ - const f_string_static_t iki_write_program_version_s = macro_f_string_static_t_initialize2(IKI_WRITE_program_version_s, 0, IKI_WRITE_program_version_s_length); + const f_string_static_t iki_write_program_version_s = macro_f_string_static_t_initialize(IKI_WRITE_program_version_s, 0, IKI_WRITE_program_version_s_length); #endif // _di_iki_write_program_version_ #ifndef _di_iki_write_program_name_ - const f_string_static_t iki_write_program_name_s = macro_f_string_static_t_initialize2(IKI_WRITE_program_name_s, 0, IKI_WRITE_program_name_s_length); - const f_string_static_t iki_write_program_name_long_s = macro_f_string_static_t_initialize2(IKI_WRITE_program_name_long_s, 0, IKI_WRITE_program_name_long_s_length); + const f_string_static_t iki_write_program_name_s = macro_f_string_static_t_initialize(IKI_WRITE_program_name_s, 0, IKI_WRITE_program_name_s_length); + const f_string_static_t iki_write_program_name_long_s = macro_f_string_static_t_initialize(IKI_WRITE_program_name_long_s, 0, IKI_WRITE_program_name_long_s_length); #endif // _di_iki_write_program_name_ #ifndef _di_iki_write_print_help_ @@ -61,87 +61,89 @@ extern "C" { f_status_t status = F_none; + f_console_parameter_t parameters[] = iki_write_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = iki_write_total_parameters_d; + { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, iki_write_total_parameters_d); + f_console_parameter_id_t ids[3] = { iki_write_parameter_no_color_e, iki_write_parameter_light_e, iki_write_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - { - f_console_parameter_id_t ids[3] = { iki_write_parameter_no_color_e, iki_write_parameter_light_e, iki_write_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + fll_program_parameter_process_empty(&main->context, sets); + } - fll_program_parameter_process_empty(&main->context, sets); + if (F_status_is_error(status)) { + if (main->error.verbosity != f_console_verbosity_quiet_e) { + fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); + f_print_dynamic(f_string_eol_s, main->error.to.stream); } - if (F_status_is_error(status)) { - if (main->error.verbosity != f_console_verbosity_quiet_e) { - fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - f_print_dynamic(f_string_eol_s, main->error.to.stream); - } + iki_write_main_delete(main); - iki_write_main_delete(main); - - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { iki_write_parameter_verbosity_quiet_e, iki_write_parameter_verbosity_normal_e, iki_write_parameter_verbosity_verbose_e, iki_write_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { iki_write_parameter_verbosity_quiet_e, iki_write_parameter_verbosity_normal_e, iki_write_parameter_verbosity_verbose_e, iki_write_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - iki_write_main_delete(main); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - return status; - } + if (F_status_is_error(status)) { + iki_write_main_delete(main); - if (choice == iki_write_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == iki_write_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == iki_write_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == iki_write_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - status = F_none; + if (choice == iki_write_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == iki_write_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == iki_write_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == iki_write_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[iki_write_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[iki_write_parameter_help_e].result == f_console_result_found_e) { iki_write_print_help(main->output.to, main->context); iki_write_main_delete(main); @@ -149,7 +151,7 @@ extern "C" { return F_none; } - if (main->parameters[iki_write_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_write_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, iki_write_program_version_s); iki_write_main_delete(main); @@ -164,8 +166,8 @@ extern "C" { file.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; if (F_status_is_error_not(status)) { - if (main->parameters[iki_write_parameter_file_e].result == f_console_result_additional_e) { - if (main->parameters[iki_write_parameter_file_e].values.used > 1) { + if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -179,7 +181,7 @@ extern "C" { status = F_status_set_error(F_parameter); } else { - const f_array_length_t location = main->parameters[iki_write_parameter_file_e].values.array[0]; + const f_array_length_t location = main->parameters.array[iki_write_parameter_file_e].values.array[0]; file.id = -1; file.stream = 0; @@ -187,11 +189,11 @@ extern "C" { status = f_file_stream_open(arguments->argv[location], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], f_file_operation_open_s, fll_error_file_type_file_e); } } } - else if (main->parameters[iki_write_parameter_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -206,7 +208,7 @@ extern "C" { } } - if (F_status_is_error_not(status) && main->parameters[iki_write_parameter_object_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[iki_write_parameter_object_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -220,7 +222,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (F_status_is_error_not(status) && main->parameters[iki_write_parameter_content_e].result == f_console_result_found_e) { + if (F_status_is_error_not(status) && main->parameters.array[iki_write_parameter_content_e].result == f_console_result_found_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -235,7 +237,7 @@ extern "C" { } if (F_status_is_error_not(status) && !main->process_pipe) { - if (main->parameters[iki_write_parameter_object_e].result != f_console_result_additional_e && main->parameters[iki_write_parameter_content_e].result != f_console_result_additional_e) { + if (main->parameters.array[iki_write_parameter_object_e].result != f_console_result_additional_e && main->parameters.array[iki_write_parameter_content_e].result != f_console_result_additional_e) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -253,7 +255,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[iki_write_parameter_object_e].values.used != main->parameters[iki_write_parameter_content_e].values.used) { + if (main->parameters.array[iki_write_parameter_object_e].values.used != main->parameters.array[iki_write_parameter_content_e].values.used) { if (main->error.verbosity != f_console_verbosity_quiet_e) { flockfile(main->error.to.stream); @@ -273,14 +275,14 @@ extern "C" { data->quote = f_iki_syntax_quote_double_s.string[0]; if (F_status_is_error_not(status)) { - if (main->parameters[iki_write_parameter_double_e].result == f_console_result_found_e) { - if (main->parameters[iki_write_parameter_single_e].result == f_console_result_found_e) { - if (main->parameters[iki_write_parameter_double_e].location < main->parameters[iki_write_parameter_single_e].location) { + if (main->parameters.array[iki_write_parameter_double_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_write_parameter_single_e].result == f_console_result_found_e) { + if (main->parameters.array[iki_write_parameter_double_e].location < main->parameters.array[iki_write_parameter_single_e].location) { data->quote = f_iki_syntax_quote_single_s.string[0]; } } } - else if (main->parameters[iki_write_parameter_single_e].result == f_console_result_found_e) { + else if (main->parameters.array[iki_write_parameter_single_e].result == f_console_result_found_e) { data->quote = f_iki_syntax_quote_single_s.string[0]; } } @@ -437,7 +439,7 @@ extern "C" { f_string_static_t content = f_string_static_t_initialize; uint16_t signal_check = 0; - for (f_array_length_t i = 0; i < main->parameters[iki_write_parameter_object_e].values.used; ++i) { + for (f_array_length_t i = 0; i < main->parameters.array[iki_write_parameter_object_e].values.used; ++i) { if (!((++signal_check) % iki_write_signal_check_d)) { if (iki_write_signal_received(main)) { @@ -448,11 +450,11 @@ extern "C" { signal_check = 0; } - object.string = arguments->argv[main->parameters[iki_write_parameter_object_e].values.array[i]]; + object.string = arguments->argv[main->parameters.array[iki_write_parameter_object_e].values.array[i]]; object.used = strnlen(object.string, F_console_parameter_size_d); object.size = object.used; - content.string = arguments->argv[main->parameters[iki_write_parameter_content_e].values.array[i]]; + content.string = arguments->argv[main->parameters.array[iki_write_parameter_content_e].values.array[i]]; content.used = strnlen(content.string, F_console_parameter_size_d); content.size = content.used; @@ -463,7 +465,7 @@ extern "C" { } // for // Ensure there is always a newline at the end, unless in quiet mode. - if (F_status_is_error_not(status) && main->error.verbosity != f_console_verbosity_quiet_e && main->parameters[iki_write_parameter_file_e].result == f_console_result_none_e) { + if (F_status_is_error_not(status) && main->error.verbosity != f_console_verbosity_quiet_e && main->parameters.array[iki_write_parameter_file_e].result == f_console_result_none_e) { fll_print_dynamic(f_string_eol_s, file.stream); } } @@ -471,7 +473,7 @@ extern "C" { f_string_dynamic_resize(0, &escaped); } - if (main->parameters[iki_write_parameter_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_e) { if (file.id != -1) { f_file_stream_close(F_true, &file); } @@ -497,12 +499,7 @@ extern "C" { #ifndef _di_iki_write_main_delete_ f_status_t iki_write_main_delete(iki_write_main_t * const main) { - for (f_array_length_t i = 0; i < iki_write_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); f_string_dynamic_resize(0, &main->buffer); diff --git a/level_3/iki_write/c/iki_write.h b/level_3/iki_write/c/iki_write.h index 977de05..64f9aeb 100644 --- a/level_3/iki_write/c/iki_write.h +++ b/level_3/iki_write/c/iki_write.h @@ -148,7 +148,7 @@ extern "C" { #ifndef _di_iki_write_main_t_ typedef struct { - f_console_parameter_t parameters[iki_write_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -167,7 +167,7 @@ extern "C" { #define iki_write_main_t_initialize \ { \ - iki_write_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index a66f3fc..b9880f0 100644 --- a/level_3/status_code/c/private-status_code.c +++ b/level_3/status_code/c/private-status_code.c @@ -16,7 +16,7 @@ extern "C" { return status; } - if (main->parameters[status_code_parameter_is_error_e].result == f_console_result_found_e) { + if (main->parameters.array[status_code_parameter_is_error_e].result == f_console_result_found_e) { if (F_status_is_error(number)) { f_print_terminated(f_status_true_s, main->output.to.stream); } @@ -26,7 +26,7 @@ extern "C" { f_print_dynamic(f_string_eol_s, main->output.to.stream); } - else if (main->parameters[status_code_parameter_is_warning_e].result == f_console_result_found_e) { + else if (main->parameters.array[status_code_parameter_is_warning_e].result == f_console_result_found_e) { if (F_status_is_warning(number)) { f_print_terminated(f_status_true_s, main->output.to.stream); } @@ -36,7 +36,7 @@ extern "C" { f_print_dynamic(f_string_eol_s, main->output.to.stream); } - else if (main->parameters[status_code_parameter_is_fine_e].result == f_console_result_found_e) { + else if (main->parameters.array[status_code_parameter_is_fine_e].result == f_console_result_found_e) { if (F_status_is_fine(number)) { f_print_terminated(f_status_true_s, main->output.to.stream); } diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 0440630..32d532d 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -7,12 +7,12 @@ extern "C" { #endif #ifndef _di_status_code_program_version_ - const f_string_static_t status_code_progam_version_s = macro_f_string_static_t_initialize2(STATUS_CODE_progam_version_s, 0, STATUS_CODE_progam_version_s_length); + const f_string_static_t status_code_progam_version_s = macro_f_string_static_t_initialize(STATUS_CODE_progam_version_s, 0, STATUS_CODE_progam_version_s_length); #endif // _di_status_code_program_version_ #ifndef _di_status_code_program_name_ - const f_string_static_t status_code_program_name_s = macro_f_string_static_t_initialize2(STATUS_CODE_program_name_s, 0, STATUS_CODE_program_name_s_length); - const f_string_static_t status_code_program_name_long_s = macro_f_string_static_t_initialize2(STATUS_CODE_program_name_long_s, 0, STATUS_CODE_program_name_long_s_length); + const f_string_static_t status_code_program_name_s = macro_f_string_static_t_initialize(STATUS_CODE_program_name_s, 0, STATUS_CODE_program_name_s_length); + const f_string_static_t status_code_program_name_long_s = macro_f_string_static_t_initialize(STATUS_CODE_program_name_long_s, 0, STATUS_CODE_program_name_long_s_length); #endif // _di_status_code_program_name_ #ifndef _di_status_code_print_help_ @@ -52,81 +52,83 @@ extern "C" { f_status_t status = F_none; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, status_code_total_parameters_d); + f_console_parameter_t parameters[] = status_code_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = status_code_total_parameters_d; - { - f_console_parameter_id_t ids[3] = { status_code_parameter_no_color_e, status_code_parameter_light_e, status_code_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + { + f_console_parameter_id_t ids[3] = { status_code_parameter_no_color_e, status_code_parameter_light_e, status_code_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - status_code_main_delete(main); + if (F_status_is_error(status)) { + status_code_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } + + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { status_code_parameter_verbosity_quiet_e, status_code_parameter_verbosity_normal_e, status_code_parameter_verbosity_verbose_e, status_code_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { status_code_parameter_verbosity_quiet_e, status_code_parameter_verbosity_normal_e, status_code_parameter_verbosity_verbose_e, status_code_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); - - if (F_status_is_error(status)) { - status_code_main_delete(main); - return status; - } - - if (choice == status_code_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == status_code_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == status_code_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == status_code_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); + + if (F_status_is_error(status)) { + status_code_main_delete(main); + return status; } - status = F_none; + if (choice == status_code_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == status_code_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == status_code_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == status_code_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } } - if (main->parameters[status_code_parameter_help_e].result == f_console_result_found_e) { + f_string_static_t * const argv = main->parameters.arguments.array; + + status = F_none; + + if (main->parameters.array[status_code_parameter_help_e].result == f_console_result_found_e) { status_code_print_help(main->output.to, main->context); status_code_main_delete(main); @@ -134,7 +136,7 @@ extern "C" { return F_none; } - if (main->parameters[status_code_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[status_code_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, status_code_progam_version_s); status_code_main_delete(main); @@ -142,8 +144,8 @@ extern "C" { return F_none; } - if (main->parameters[status_code_parameter_is_error_e].result == f_console_result_found_e) { - if (main->parameters[status_code_parameter_is_warning_e].result == f_console_result_found_e) { + if (main->parameters.array[status_code_parameter_is_error_e].result == f_console_result_found_e) { + if (main->parameters.array[status_code_parameter_is_warning_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -158,7 +160,7 @@ extern "C" { return F_status_set_error(status); } - else if (main->parameters[status_code_parameter_is_fine_e].result == f_console_result_found_e) { + else if (main->parameters.array[status_code_parameter_is_fine_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -174,7 +176,7 @@ extern "C" { return F_status_set_error(status); } } - else if (main->parameters[status_code_parameter_is_warning_e].result == f_console_result_found_e && main->parameters[status_code_parameter_is_fine_e].result == f_console_result_found_e) { + else if (main->parameters.array[status_code_parameter_is_warning_e].result == f_console_result_found_e && main->parameters.array[status_code_parameter_is_fine_e].result == f_console_result_found_e) { flockfile(main->error.to.stream); fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); @@ -200,7 +202,7 @@ extern "C" { f_status_t status2 = F_none; - if (main->parameters[status_code_parameter_is_error_e].result == f_console_result_found_e || main->parameters[status_code_parameter_is_warning_e].result == f_console_result_found_e || main->parameters[status_code_parameter_is_fine_e].result == f_console_result_found_e) { + if (main->parameters.array[status_code_parameter_is_error_e].result == f_console_result_found_e || main->parameters.array[status_code_parameter_is_warning_e].result == f_console_result_found_e || main->parameters.array[status_code_parameter_is_fine_e].result == f_console_result_found_e) { if (main->process_pipe) { // @todo call status_code_process_check() here for all main from pipe that is space separated. } @@ -231,7 +233,7 @@ extern "C" { funlockfile(main->output.to.stream); } } - else if (main->parameters[status_code_parameter_number_e].result == f_console_result_found_e) { + else if (main->parameters.array[status_code_parameter_number_e].result == f_console_result_found_e) { if (main->process_pipe) { // @todo call status_code_process_number() here for all main from pipe that is space separated. } @@ -311,12 +313,7 @@ extern "C" { #ifndef _di_status_code_main_delete_ f_status_t status_code_main_delete(status_code_main_t * const main) { - for (f_array_length_t i = 0; i < status_code_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/status_code/c/status_code.h b/level_3/status_code/c/status_code.h index eb115b9..59741f5 100644 --- a/level_3/status_code/c/status_code.h +++ b/level_3/status_code/c/status_code.h @@ -135,7 +135,7 @@ extern "C" { #ifndef _di_status_code_main_t_ typedef struct { - f_console_parameter_t parameters[status_code_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -151,7 +151,7 @@ extern "C" { #define status_code_main_t_initialize \ { \ - status_code_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ diff --git a/level_3/utf8/c/private-common.h b/level_3/utf8/c/private-common.h index 4e7dcf2..5ed8e94 100644 --- a/level_3/utf8/c/private-common.h +++ b/level_3/utf8/c/private-common.h @@ -38,6 +38,7 @@ extern "C" { * The program data. * * main: The main program data. + * argv: The argument structure in utf8_main_t.parameters for simplifying syntax. * file: The output file for writing the processed data to (may potentially default to "output"). * mode: The input/output mode (see utf8_modes). * valid: Designate the output context set for valid characters. @@ -51,6 +52,7 @@ extern "C" { #ifndef _di_utf8_data_t_ typedef struct { utf8_main_t *main; + f_string_static_t *argv; f_file_t file; uint8_t mode; @@ -69,6 +71,7 @@ extern "C" { #define utf8_data_t_initialize \ { \ 0, \ + 0, \ f_file_t_initialize, \ utf8_mode_from_binary_d | utf8_mode_to_codepoint_d, \ f_color_set_t_initialize, \ diff --git a/level_3/utf8/c/private-print.c b/level_3/utf8/c/private-print.c index e93df7a..7631246 100644 --- a/level_3/utf8/c/private-print.c +++ b/level_3/utf8/c/private-print.c @@ -16,8 +16,8 @@ extern "C" { #ifndef _di_utf8_print_character_invalid_ void utf8_print_character_invalid(utf8_data_t * const data, const f_string_static_t character) { - if (data->main->parameters[utf8_parameter_strip_invalid_e].result == f_console_result_found_e) return; - if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_found_e) return; + if (data->main->parameters.array[utf8_parameter_strip_invalid_e].result == f_console_result_found_e) return; + if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) return; if (!character.used) return; @@ -81,7 +81,7 @@ extern "C" { fl_print_format("%s%s%s", data->file.stream, data->prepend, utf8_string_combining_not_s, data->append); } } - else if (data->main->parameters[utf8_parameter_strip_invalid_e].result == f_console_result_none_e && data->main->parameters[utf8_parameter_verify_e].result == f_console_result_none_e) { + else if (data->main->parameters.array[utf8_parameter_strip_invalid_e].result == f_console_result_none_e && data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) { fl_print_format("%s%[%s%]%s", data->file.stream, data->prepend, data->valid_not, utf8_string_unknown_s, data->valid_not, data->append); } } @@ -95,8 +95,8 @@ extern "C" { void utf8_print_error_decode(utf8_data_t * const data, const f_status_t status, const f_string_static_t character) { if (data->main->error.verbosity == f_console_verbosity_quiet_e) return; - if (data->main->parameters[utf8_parameter_strip_invalid_e].result == f_console_result_found_e) return; - if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_found_e) return; + if (data->main->parameters.array[utf8_parameter_strip_invalid_e].result == f_console_result_found_e) return; + if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) return; fl_print_format("%q%[%QFailed to decode character code '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error); @@ -209,8 +209,8 @@ extern "C" { #ifndef _di_utf8_print_section_header_file_ void utf8_print_section_header_file(utf8_data_t * const data, const f_string_t name) { - if (data->main->parameters[utf8_parameter_headers_e].result == f_console_result_none_e) return; - if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_found_e) return; + if (data->main->parameters.array[utf8_parameter_headers_e].result == f_console_result_none_e) return; + if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) return; flockfile(data->main->output.to.stream); @@ -230,8 +230,8 @@ extern "C" { #ifndef _di_utf8_print_section_header_parameter_ void utf8_print_section_header_parameter(utf8_data_t * const data, const f_array_length_t index) { - if (data->main->parameters[utf8_parameter_headers_e].result == f_console_result_none_e) return; - if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_found_e) return; + if (data->main->parameters.array[utf8_parameter_headers_e].result == f_console_result_none_e) return; + if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) return; flockfile(data->main->output.to.stream); @@ -245,8 +245,8 @@ extern "C" { #ifndef _di_utf8_print_section_header_pipe_ void utf8_print_section_header_pipe(utf8_data_t * const data) { - if (data->main->parameters[utf8_parameter_headers_e].result == f_console_result_none_e) return; - if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_found_e) return; + if (data->main->parameters.array[utf8_parameter_headers_e].result == f_console_result_none_e) return; + if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) return; fll_print_format("%q%[Pipe%]:%q", data->main->output.to.stream, f_string_eol_s, data->main->output.set->title, data->main->output.set->title, f_string_eol_s); } @@ -297,7 +297,7 @@ extern "C" { } } - if (data->main->parameters[utf8_parameter_strip_invalid_e].result == f_console_result_none_e && data->main->parameters[utf8_parameter_verify_e].result == f_console_result_none_e) { + if (data->main->parameters.array[utf8_parameter_strip_invalid_e].result == f_console_result_none_e && data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) { fl_print_format("%s%[%s%]%s", data->file.stream, data->prepend, data->valid_not, utf8_string_unknown_s, data->valid_not, data->append); } } diff --git a/level_3/utf8/c/private-utf8.c b/level_3/utf8/c/private-utf8.c index 693c719..3e90dc3 100644 --- a/level_3/utf8/c/private-utf8.c +++ b/level_3/utf8/c/private-utf8.c @@ -32,7 +32,7 @@ extern "C" { bool valid = F_true; uint8_t mode_codepoint = utf8_codepoint_mode_ready_e; - f_string_static_t current = macro_f_string_static_t_initialize(text, 0); + f_string_static_t current = macro_f_string_static_t_initialize2(text, 0); utf8_process_text_width(¤t); @@ -98,10 +98,10 @@ extern "C" { return status; } - if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_none_e) { + if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) { // When headers are printed, they are printed with a newline so only print this newline when separate is used without headers being printed. - if (data->main->parameters[utf8_parameter_headers_e].result == f_console_result_none_e && data->main->parameters[utf8_parameter_separate_e].result == f_console_result_found_e) { + if (data->main->parameters.array[utf8_parameter_headers_e].result == f_console_result_none_e && data->main->parameters.array[utf8_parameter_separate_e].result == f_console_result_found_e) { f_print_dynamic(f_string_eol_s, data->file.stream); } } diff --git a/level_3/utf8/c/private-utf8_binary.c b/level_3/utf8/c/private-utf8_binary.c index 59c2eb7..217bf5c 100644 --- a/level_3/utf8/c/private-utf8_binary.c +++ b/level_3/utf8/c/private-utf8_binary.c @@ -40,7 +40,7 @@ extern "C" { return status; } } - else if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_none_e) { + else if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) { if (data->mode & utf8_mode_to_binary_d) { utf8_print_binary(data, character); } @@ -74,7 +74,7 @@ extern "C" { f_array_length_t j = 0; char block_character[4] = { 0, 0, 0, 0 }; - f_string_static_t character = macro_f_string_static_t_initialize(block_character, 4); + f_string_static_t character = macro_f_string_static_t_initialize2(block_character, 4); do { status = f_file_read_block(file, &data->buffer); diff --git a/level_3/utf8/c/private-utf8_codepoint.c b/level_3/utf8/c/private-utf8_codepoint.c index a9ec654..6dae00f 100644 --- a/level_3/utf8/c/private-utf8_codepoint.c +++ b/level_3/utf8/c/private-utf8_codepoint.c @@ -51,10 +51,10 @@ extern "C" { return status; } } - else if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_none_e) { + else if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) { if (data->mode & utf8_mode_to_binary_d) { char byte[5] = { 0, 0, 0, 0, 0 }; - f_string_static_t character = macro_f_string_static_t_initialize(byte, 5); + f_string_static_t character = macro_f_string_static_t_initialize2(byte, 5); status = f_utf_unicode_from(codepoint, 4, &character.string); @@ -210,7 +210,7 @@ extern "C" { f_array_length_t j = 0; char block[4] = { 0, 0, 0, 0 }; - f_string_static_t character = macro_f_string_static_t_initialize(block, 4); + f_string_static_t character = macro_f_string_static_t_initialize2(block, 4); do { status = f_file_read_block(file, &data->buffer); diff --git a/level_3/utf8/c/utf8.c b/level_3/utf8/c/utf8.c index 7937de5..b9bfb2c 100644 --- a/level_3/utf8/c/utf8.c +++ b/level_3/utf8/c/utf8.c @@ -10,12 +10,12 @@ extern "C" { #endif #ifndef _di_utf8_program_version_ - const f_string_static_t utf8_program_version_s = macro_f_string_static_t_initialize2(UTF8_program_version_s, 0, UTF8_program_version_s_length); + const f_string_static_t utf8_program_version_s = macro_f_string_static_t_initialize(UTF8_program_version_s, 0, UTF8_program_version_s_length); #endif // _di_utf8_program_version_ #ifndef _di_utf8_program_name_ - const f_string_static_t utf8_program_name_s = macro_f_string_static_t_initialize2(UTF8_program_name_s, 0, UTF8_program_name_s_length); - const f_string_static_t utf8_program_name_long_s = macro_f_string_static_t_initialize2(UTF8_program_name_long_s, 0, UTF8_program_name_s_long_length); + const f_string_static_t utf8_program_name_s = macro_f_string_static_t_initialize(UTF8_program_name_s, 0, UTF8_program_name_s_length); + const f_string_static_t utf8_program_name_long_s = macro_f_string_static_t_initialize(UTF8_program_name_long_s, 0, UTF8_program_name_s_long_length); #endif // _di_utf8_program_name_ #ifndef _di_utf8_print_help_ @@ -83,203 +83,204 @@ extern "C" { utf8_data_t data = utf8_data_t_initialize; data.main = main; - { - const f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(main->parameters, utf8_total_parameters_d); + f_console_parameter_t parameters[] = utf8_console_parameter_t_initialize; + main->parameters.array = parameters; + main->parameters.used = utf8_total_parameters_d; - // Identify priority of color parameters. - { - f_console_parameter_id_t ids[3] = { utf8_parameter_no_color_e, utf8_parameter_light_e, utf8_parameter_dark_e }; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); + // Identify priority of color parameters. + { + f_console_parameter_id_t ids[3] = { utf8_parameter_no_color_e, utf8_parameter_light_e, utf8_parameter_dark_e }; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3); - status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context); - main->output.set = &main->context.set; - main->error.set = &main->context.set; - main->warning.set = &main->context.set; + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; - if (main->context.set.error.before) { - main->output.context = f_color_set_empty_s; - main->output.notable = main->context.set.notable; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; - main->error.context = main->context.set.error; - main->error.notable = main->context.set.notable; + main->error.context = main->context.set.error; + main->error.notable = main->context.set.notable; - main->warning.context = main->context.set.warning; - main->warning.notable = main->context.set.notable; - } - else { - f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + main->warning.context = main->context.set.warning; + main->warning.notable = main->context.set.notable; + } + else { + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; - fll_program_parameter_process_empty(&main->context, sets); - } + fll_program_parameter_process_empty(&main->context, sets); + } - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - utf8_data_delete(&data); - utf8_main_delete(main); + utf8_data_delete(&data); + utf8_main_delete(main); - return F_status_set_error(status); - } + return F_status_set_error(status); } + } - // Identify priority of verbosity related parameters. - { - f_console_parameter_id_t ids[4] = { utf8_parameter_verbosity_quiet_e, utf8_parameter_verbosity_normal_e, utf8_parameter_verbosity_verbose_e, utf8_parameter_verbosity_debug_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify priority of verbosity related parameters. + { + f_console_parameter_id_t ids[4] = { utf8_parameter_verbosity_quiet_e, utf8_parameter_verbosity_normal_e, utf8_parameter_verbosity_verbose_e, utf8_parameter_verbosity_debug_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - utf8_main_delete(main); - utf8_data_delete(&data); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - return status; - } + utf8_main_delete(main); + utf8_data_delete(&data); - if (choice == utf8_parameter_verbosity_quiet_e) { - main->output.verbosity = f_console_verbosity_quiet_e; - main->error.verbosity = f_console_verbosity_quiet_e; - main->warning.verbosity = f_console_verbosity_quiet_e; - } - else if (choice == utf8_parameter_verbosity_normal_e) { - main->output.verbosity = f_console_verbosity_normal_e; - main->error.verbosity = f_console_verbosity_normal_e; - main->warning.verbosity = f_console_verbosity_normal_e; - } - else if (choice == utf8_parameter_verbosity_verbose_e) { - main->output.verbosity = f_console_verbosity_verbose_e; - main->error.verbosity = f_console_verbosity_verbose_e; - main->warning.verbosity = f_console_verbosity_verbose_e; - } - else if (choice == utf8_parameter_verbosity_debug_e) { - main->output.verbosity = f_console_verbosity_debug_e; - main->error.verbosity = f_console_verbosity_debug_e; - main->warning.verbosity = f_console_verbosity_debug_e; - } + return status; } - // Identify and prioritize from mode parameters. - { - f_console_parameter_id_t ids[2] = { utf8_parameter_from_binary_e, utf8_parameter_from_codepoint_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 2); + if (choice == utf8_parameter_verbosity_quiet_e) { + main->output.verbosity = f_console_verbosity_quiet_e; + main->error.verbosity = f_console_verbosity_quiet_e; + main->warning.verbosity = f_console_verbosity_quiet_e; + } + else if (choice == utf8_parameter_verbosity_normal_e) { + main->output.verbosity = f_console_verbosity_normal_e; + main->error.verbosity = f_console_verbosity_normal_e; + main->warning.verbosity = f_console_verbosity_normal_e; + } + else if (choice == utf8_parameter_verbosity_verbose_e) { + main->output.verbosity = f_console_verbosity_verbose_e; + main->error.verbosity = f_console_verbosity_verbose_e; + main->warning.verbosity = f_console_verbosity_verbose_e; + } + else if (choice == utf8_parameter_verbosity_debug_e) { + main->output.verbosity = f_console_verbosity_debug_e; + main->error.verbosity = f_console_verbosity_debug_e; + main->warning.verbosity = f_console_verbosity_debug_e; + } + } - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify and prioritize from mode parameters. + { + f_console_parameter_id_t ids[2] = { utf8_parameter_from_binary_e, utf8_parameter_from_codepoint_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 2); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - utf8_data_delete(&data); - utf8_main_delete(main); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - return status; - } + utf8_data_delete(&data); + utf8_main_delete(main); - if (choice == utf8_parameter_from_binary_e) { - if (data.mode & utf8_mode_from_codepoint_d) { - data.mode -= utf8_mode_from_codepoint_d; - } + return status; + } - data.mode |= utf8_mode_from_binary_d; + if (choice == utf8_parameter_from_binary_e) { + if (data.mode & utf8_mode_from_codepoint_d) { + data.mode -= utf8_mode_from_codepoint_d; } - else if (choice == utf8_parameter_from_codepoint_e) { - if (data.mode & utf8_mode_from_binary_d) { - data.mode -= utf8_mode_from_binary_d; - } - data.mode |= utf8_mode_from_codepoint_d; - } + data.mode |= utf8_mode_from_binary_d; } + else if (choice == utf8_parameter_from_codepoint_e) { + if (data.mode & utf8_mode_from_binary_d) { + data.mode -= utf8_mode_from_binary_d; + } - // Identify and prioritize to mode parameters. - { - f_console_parameter_id_t ids[4] = { utf8_parameter_to_binary_e, utf8_parameter_to_codepoint_e, utf8_parameter_to_combining_e, utf8_parameter_to_width_e }; - f_console_parameter_id_t choice = 0; - const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); + data.mode |= utf8_mode_from_codepoint_d; + } + } - status = f_console_parameter_prioritize_right(parameters, choices, &choice); + // Identify and prioritize to mode parameters. + { + f_console_parameter_id_t ids[4] = { utf8_parameter_to_binary_e, utf8_parameter_to_codepoint_e, utf8_parameter_to_combining_e, utf8_parameter_to_width_e }; + f_console_parameter_id_t choice = 0; + const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); - if (F_status_is_error(status)) { - fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); + status = f_console_parameter_prioritize_right(main->parameters, choices, &choice); - utf8_data_delete(&data); - utf8_main_delete(main); + if (F_status_is_error(status)) { + fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); - return status; - } + utf8_data_delete(&data); + utf8_main_delete(main); - if (choice == utf8_parameter_to_binary_e) { - if (data.mode & utf8_mode_to_codepoint_d) { - data.mode -= utf8_mode_to_codepoint_d; - } + return status; + } - if (data.mode & utf8_mode_to_combining_d) { - data.mode -= utf8_mode_to_combining_d; - } + if (choice == utf8_parameter_to_binary_e) { + if (data.mode & utf8_mode_to_codepoint_d) { + data.mode -= utf8_mode_to_codepoint_d; + } - if (data.mode & utf8_mode_to_width_d) { - data.mode -= utf8_mode_to_width_d; - } + if (data.mode & utf8_mode_to_combining_d) { + data.mode -= utf8_mode_to_combining_d; + } - data.mode |= utf8_mode_to_binary_d; + if (data.mode & utf8_mode_to_width_d) { + data.mode -= utf8_mode_to_width_d; } - else if (choice == utf8_parameter_to_codepoint_e) { - if (data.mode & utf8_mode_to_binary_d) { - data.mode -= utf8_mode_to_binary_d; - } - if (data.mode & utf8_mode_to_combining_d) { - data.mode -= utf8_mode_to_combining_d; - } + data.mode |= utf8_mode_to_binary_d; + } + else if (choice == utf8_parameter_to_codepoint_e) { + if (data.mode & utf8_mode_to_binary_d) { + data.mode -= utf8_mode_to_binary_d; + } - if (data.mode & utf8_mode_to_width_d) { - data.mode -= utf8_mode_to_width_d; - } + if (data.mode & utf8_mode_to_combining_d) { + data.mode -= utf8_mode_to_combining_d; + } - data.mode |= utf8_mode_to_codepoint_d; + if (data.mode & utf8_mode_to_width_d) { + data.mode -= utf8_mode_to_width_d; } - else if (choice == utf8_parameter_to_combining_e) { - if (data.mode & utf8_mode_to_binary_d) { - data.mode -= utf8_mode_to_binary_d; - } - if (data.mode & utf8_mode_to_codepoint_d) { - data.mode -= utf8_mode_to_codepoint_d; - } + data.mode |= utf8_mode_to_codepoint_d; + } + else if (choice == utf8_parameter_to_combining_e) { + if (data.mode & utf8_mode_to_binary_d) { + data.mode -= utf8_mode_to_binary_d; + } - // --to_width may be specified with --to_combining. - if (main->parameters[utf8_parameter_to_width_e].result == f_console_result_found_e) { - data.mode |= utf8_mode_to_width_d; - } + if (data.mode & utf8_mode_to_codepoint_d) { + data.mode -= utf8_mode_to_codepoint_d; + } - data.mode |= utf8_mode_to_combining_d; + // --to_width may be specified with --to_combining. + if (main->parameters.array[utf8_parameter_to_width_e].result == f_console_result_found_e) { + data.mode |= utf8_mode_to_width_d; } - else if (choice == utf8_parameter_to_width_e) { - if (data.mode & utf8_mode_to_binary_d) { - data.mode -= utf8_mode_to_binary_d; - } - if (data.mode & utf8_mode_to_codepoint_d) { - data.mode -= utf8_mode_to_codepoint_d; - } + data.mode |= utf8_mode_to_combining_d; + } + else if (choice == utf8_parameter_to_width_e) { + if (data.mode & utf8_mode_to_binary_d) { + data.mode -= utf8_mode_to_binary_d; + } - // --to_width may be specified with --to_combining. - if (main->parameters[utf8_parameter_to_combining_e].result == f_console_result_found_e) { - data.mode |= utf8_mode_to_combining_d; - } + if (data.mode & utf8_mode_to_codepoint_d) { + data.mode -= utf8_mode_to_codepoint_d; + } - data.mode |= utf8_mode_to_width_d; + // --to_width may be specified with --to_combining. + if (main->parameters.array[utf8_parameter_to_combining_e].result == f_console_result_found_e) { + data.mode |= utf8_mode_to_combining_d; } - } - status = F_none; + data.mode |= utf8_mode_to_width_d; + } } - if (main->parameters[utf8_parameter_help_e].result == f_console_result_found_e) { + data.argv = main->parameters.arguments.array; + status = F_none; + + if (main->parameters.array[utf8_parameter_help_e].result == f_console_result_found_e) { utf8_print_help(main->output.to, main->context); utf8_data_delete(&data); @@ -288,7 +289,7 @@ extern "C" { return F_none; } - if (main->parameters[utf8_parameter_version_e].result == f_console_result_found_e) { + if (main->parameters.array[utf8_parameter_version_e].result == f_console_result_found_e) { fll_program_print_version(main->output.to, utf8_version_s); utf8_data_delete(&data); @@ -298,13 +299,13 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[utf8_parameter_from_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_additional_e) { f_array_length_t i = 0; f_array_length_t index = 0; - for (; i < main->parameters[utf8_parameter_from_file_e].values.used; ++i) { + for (; i < main->parameters.array[utf8_parameter_from_file_e].values.used; ++i) { - index = main->parameters[utf8_parameter_from_file_e].values.array[i]; + index = main->parameters.array[utf8_parameter_from_file_e].values.array[i]; if (arguments->argv[index][0]) { if (!f_file_exists(arguments->argv[index])) { @@ -324,7 +325,7 @@ extern "C" { } } // for } - else if (main->parameters[utf8_parameter_from_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_found_e) { utf8_print_error_no_value(&data, utf8_long_from_file_s); status = F_status_set_error(F_parameter); @@ -334,31 +335,31 @@ extern "C" { bool valid = F_true; if (F_status_is_error_not(status)) { - if (main->parameters[utf8_parameter_to_file_e].result == f_console_result_additional_e) { - if (main->parameters[utf8_parameter_to_file_e].values.used > 1) { + if (main->parameters.array[utf8_parameter_to_file_e].result == f_console_result_additional_e) { + if (main->parameters.array[utf8_parameter_to_file_e].values.used > 1) { utf8_print_error_parameter_file_to_too_many(&data); status = F_status_set_error(F_parameter); } else { - data.file_name.string = arguments->argv[main->parameters[utf8_parameter_to_file_e].values.array[0]]; + data.file_name.string = arguments->argv[main->parameters.array[utf8_parameter_to_file_e].values.array[0]]; data.file_name.used = strnlen(data.file_name.string, PATH_MAX); if (data.file_name.used) { status = f_file_stream_open(data.file_name.string, "a", &data.file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.file_name.string, "open", fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.file_name.string, f_file_operation_open_s, fll_error_file_type_file_e); } } else { - utf8_print_error_parameter_file_name_empty(&data, main->parameters[utf8_parameter_to_file_e].values.array[0]); + utf8_print_error_parameter_file_name_empty(&data, main->parameters.array[utf8_parameter_to_file_e].values.array[0]); status = F_status_set_error(F_parameter); } } } - else if (main->parameters[utf8_parameter_to_file_e].result == f_console_result_found_e) { + else if (main->parameters.array[utf8_parameter_to_file_e].result == f_console_result_found_e) { utf8_print_error_no_value(&data, utf8_long_to_file_s); status = F_status_set_error(F_parameter); @@ -369,14 +370,14 @@ extern "C" { } if (F_status_is_error_not(status)) { - if (main->parameters[utf8_parameter_from_file_e].result == f_console_result_none_e && !(main->process_pipe || main->remaining.used)) { + if (main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_none_e && !(main->process_pipe || main->remaining.used)) { utf8_print_error_no_from(&data); status = F_status_set_error(F_parameter); } if (!(data.mode & utf8_mode_to_binary_d)) { - if (main->parameters[utf8_parameter_separate_e].result == f_console_result_found_e || main->parameters[utf8_parameter_headers_e].result == f_console_result_found_e) { + if (main->parameters.array[utf8_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[utf8_parameter_headers_e].result == f_console_result_found_e) { data.prepend = " "; data.append = f_string_eol_s; } @@ -407,17 +408,17 @@ extern "C" { } if (F_status_is_error(status) && F_status_set_fine(status) != F_utf_fragment) { - fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, 0, utf8_string_process_s, fll_error_file_type_pipe_e); + fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, 0, f_file_operation_process_s, fll_error_file_type_pipe_e); } } - if (F_status_is_error_not(status) && status != F_signal && main->parameters[utf8_parameter_from_file_e].result == f_console_result_additional_e) { + if (F_status_is_error_not(status) && status != F_signal && main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_additional_e) { f_array_length_t i = 0; f_array_length_t index = 0; f_file_t file = macro_f_file_t_initialize(0, -1, F_file_flag_read_only_d, 32768, F_file_default_write_size_d); - for (uint16_t signal_check = 0; i < main->parameters[utf8_parameter_from_file_e].values.used && status != F_signal; ++i) { + for (uint16_t signal_check = 0; i < main->parameters.array[utf8_parameter_from_file_e].values.used && status != F_signal; ++i) { if (!((++signal_check) % utf8_signal_check_d)) { if (utf8_signal_received(&data)) { @@ -428,14 +429,14 @@ extern "C" { signal_check = 0; } - index = main->parameters[utf8_parameter_from_file_e].values.array[i]; + index = main->parameters.array[utf8_parameter_from_file_e].values.array[i]; utf8_print_section_header_file(&data, arguments->argv[index]); status = f_file_stream_open(arguments->argv[index], 0, &file); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[index], utf8_string_open_s, fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[index], f_file_operation_open_s, fll_error_file_type_file_e); break; } @@ -449,14 +450,14 @@ extern "C" { f_file_stream_close(F_true, &file); - if (main->parameters[utf8_parameter_verify_e].result == f_console_result_found_e) { + if (main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) { if (status == F_false) { valid = F_false; } } if (F_status_is_error(status) && F_status_set_fine(status) != F_utf_fragment) { - fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, arguments->argv[index], utf8_string_process_s, fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, arguments->argv[index], f_file_operation_process_s, fll_error_file_type_file_e); break; } @@ -484,7 +485,7 @@ extern "C" { status = utf8_process_text(&data, arguments->argv[index]); - if (main->parameters[utf8_parameter_verify_e].result == f_console_result_found_e) { + if (main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) { if (status == F_false) { valid = F_false; } @@ -493,7 +494,7 @@ extern "C" { } } - if (main->output.verbosity != f_console_verbosity_quiet_e && main->parameters[utf8_parameter_verify_e].result == f_console_result_none_e) { + if (main->output.verbosity != f_console_verbosity_quiet_e && main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) { if (status == F_signal) { fflush(data.file.stream); @@ -519,12 +520,7 @@ extern "C" { #ifndef _di_utf8_main_delete_ f_status_t utf8_main_delete(utf8_main_t *main) { - for (f_array_length_t i = 0; i < utf8_total_parameters_d; ++i) { - - f_type_array_lengths_resize(0, &main->parameters[i].locations); - f_type_array_lengths_resize(0, &main->parameters[i].locations_sub); - f_type_array_lengths_resize(0, &main->parameters[i].values); - } // for + f_console_parameters_delete(&main->parameters); f_type_array_lengths_resize(0, &main->remaining); diff --git a/level_3/utf8/c/utf8.h b/level_3/utf8/c/utf8.h index 650f50a..674caeb 100644 --- a/level_3/utf8/c/utf8.h +++ b/level_3/utf8/c/utf8.h @@ -109,9 +109,6 @@ extern "C" { #define utf8_string_from_s "from" #define utf8_string_to_s "to" - #define utf8_string_open_s "open" - #define utf8_string_process_s "process" - #define utf8_string_verified_valid_s "Verified Valid" #define utf8_string_verified_valid_not_s "Verified Invalid" @@ -126,9 +123,6 @@ extern "C" { #define utf8_string_from_s_length 4 #define utf8_string_to_s_length 2 - #define utf8_string_open_s_length 4 - #define utf8_string_process_s_length 7 - #define utf8_string_verified_valid_s_length 14 #define utf8_string_verified_valid_not_s_length 16 @@ -264,7 +258,7 @@ extern "C" { */ #ifndef _di_utf8_main_t_ typedef struct { - f_console_parameter_t parameters[utf8_total_parameters_d]; + f_console_parameters_t parameters; f_array_lengths_t remaining; bool process_pipe; @@ -280,7 +274,7 @@ extern "C" { #define utf8_main_t_initialize \ { \ - utf8_console_parameter_t_initialize, \ + f_console_parameters_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ fl_print_t_initialize, \ -- 1.8.3.1