From c2f0e38929c44018145e1965248385801f69ed02 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 21 Aug 2023 23:24:57 -0500 Subject: [PATCH] Progress: Continue re-designing of the memory logic, focusing on f_string_dynamic_t and similar. --- build/level_0/settings | 2 +- build/monolithic/settings | 2 +- build/stand_alone/byte_dump.config.h | 31 -- build/stand_alone/fake.config.h | 34 -- build/stand_alone/fake.settings | 2 +- build/stand_alone/firewall.config.h | 31 -- build/stand_alone/utf8.config.h | 31 -- build/stand_alone/utf8.settings | 2 +- level_0/f_account/c/account.c | 8 +- level_0/f_account/c/account.h | 16 +- level_0/f_account/c/account/accounts.c | 63 ++-- level_0/f_account/c/account/accounts.h | 22 +- level_0/f_account/c/private-account.c | 10 +- level_0/f_account/c/private-account.h | 4 +- level_0/f_capability/c/capability.c | 20 +- level_0/f_capability/c/capability.h | 8 +- level_0/f_color/c/color.c | 26 +- level_0/f_color/c/color.h | 24 +- level_0/f_color/c/color/common.c | 40 +- level_0/f_color/c/color/common.h | 8 +- level_0/f_color/c/private-color.c | 4 +- level_0/f_color/c/private-color.h | 8 +- level_0/f_console/c/console.c | 2 +- level_0/f_console/c/console.h | 2 - level_0/f_console/c/console/common.c | 4 +- level_0/f_console/c/console/common.h | 8 +- level_0/f_conversion/c/conversion.h | 8 +- level_0/f_conversion/c/private-conversion.c | 2 +- level_0/f_conversion/c/private-conversion.h | 2 +- level_0/f_directory/c/directory.c | 4 +- level_0/f_directory/c/directory/listing.c | 96 ++--- level_0/f_directory/c/directory/listing.h | 24 +- level_0/f_directory/c/directory/recurse_do.c | 120 +++--- level_0/f_directory/c/directory/recurse_do.h | 36 +- level_0/f_directory/c/directory/status.c | 12 +- level_0/f_directory/c/directory/status.h | 16 +- level_0/f_environment/c/environment.c | 12 +- level_0/f_environment/c/environment.h | 4 +- level_0/f_file/c/file.c | 18 +- level_0/f_file/c/file.h | 20 +- level_0/f_file/c/file/stream.c | 6 +- level_0/f_file/c/file/stream.h | 4 +- level_0/f_file/c/private-file.c | 4 +- level_0/f_file/c/private-file.h | 4 +- level_0/f_fss/c/fss/nest.h | 16 +- level_0/f_fss/c/fss/set.h | 16 +- level_0/f_fss/c/fss/simple_packet.c | 12 +- level_0/f_fss/c/fss/simple_packet.h | 24 +- level_0/f_limit/c/limit/set.h | 8 +- level_0/f_limit/c/limit/value.h | 8 +- level_0/f_network/c/network.c | 2 +- level_0/f_network/c/network.h | 4 +- level_0/f_path/c/path.c | 14 +- level_0/f_path/c/private-path.c | 6 +- level_0/f_serialize/c/serialize.c | 8 +- level_0/f_serialize/c/serialize.h | 4 +- level_0/f_socket/c/socket.c | 2 +- level_0/f_socket/c/socket.h | 4 +- level_0/f_socket/c/socket/address.h | 8 +- level_0/f_socket/c/socket/socket.h | 8 +- level_0/f_string/c/string/common.h | 3 - level_0/f_string/c/string/dynamic.c | 60 --- level_0/f_string/c/string/dynamic.h | 149 -------- level_0/f_string/c/string/dynamics.c | 102 ++---- level_0/f_string/c/string/dynamics.h | 153 ++------ level_0/f_string/c/string/dynamicss.c | 153 +++----- level_0/f_string/c/string/dynamicss.h | 153 ++------ level_0/f_string/c/string/map.h | 8 - level_0/f_string/c/string/map_multi.h | 8 - level_0/f_string/c/string/map_multis.h | 14 +- level_0/f_string/c/string/map_multiss.h | 14 +- level_0/f_string/c/string/maps.h | 14 +- level_0/f_string/c/string/mapss.h | 14 +- level_0/f_string/c/string/private-dynamics.c | 68 +--- level_0/f_string/c/string/private-dynamics.h | 68 ---- level_0/f_string/c/string/private-dynamicss.c | 42 --- level_0/f_string/c/string/private-dynamicss.h | 80 ---- level_0/f_string/c/string/private-map_multis.c | 46 ++- level_0/f_string/c/string/quantitys.h | 14 +- level_0/f_string/c/string/quantityss.h | 16 +- level_0/f_string/c/string/ranges.h | 14 +- level_0/f_string/c/string/rangess.h | 16 +- level_0/f_string/c/string/static.c | 7 + level_0/f_string/c/string/static.h | 20 + level_0/f_string/c/string/triple.h | 14 +- level_0/f_string/c/string/triples.h | 14 +- level_0/f_string/c/string/tripless.h | 14 +- level_1/fl_directory/c/directory.h | 16 +- level_1/fl_directory/c/private-directory.c | 18 +- level_1/fl_directory/c/private-directory.h | 8 +- level_1/fl_environment/c/environment.c | 54 +-- level_1/fl_environment/c/environment.h | 16 +- level_1/fl_fss/c/fss/basic.c | 10 +- level_1/fl_fss/c/fss/basic.h | 16 +- level_1/fl_fss/c/fss/basic_list.c | 30 +- level_1/fl_fss/c/fss/basic_list.h | 16 +- level_1/fl_fss/c/fss/embedded_list.c | 35 +- level_1/fl_fss/c/fss/embedded_list.h | 16 +- level_1/fl_fss/c/fss/extended.c | 8 +- level_1/fl_fss/c/fss/extended.h | 16 +- level_1/fl_fss/c/fss/extended_list.c | 39 +- level_1/fl_fss/c/fss/extended_list.h | 16 +- level_1/fl_fss/c/private-fss.c | 34 +- level_1/fl_fss/c/private-fss.h | 12 +- level_1/fl_utf_file/c/utf_file.c | 9 +- level_2/fll_error/c/error.c | 164 ++++----- level_2/fll_error/c/private-error.c | 2 +- level_2/fll_execute/c/execute.c | 46 +-- level_2/fll_execute/c/execute.h | 37 +- level_2/fll_execute/c/private-execute.c | 44 ++- level_2/fll_execute/c/private-execute.h | 20 +- level_2/fll_file/c/private-file.c | 6 +- level_2/fll_fss/c/fss.c | 69 ++-- level_2/fll_fss/c/fss/basic.c | 2 +- level_2/fll_fss/c/fss/basic.h | 4 +- level_2/fll_fss/c/fss/basic_list.h | 4 +- level_2/fll_fss/c/fss/embedded_list.h | 4 +- level_2/fll_fss/c/fss/extended.h | 4 +- level_2/fll_fss/c/fss/extended_list.h | 4 +- level_2/fll_fss/c/fss/payload.c | 2 +- level_2/fll_fss/c/fss/payload.h | 4 +- level_2/fll_iki/c/iki.h | 32 +- level_2/fll_iki/c/private-iki.c | 18 +- level_2/fll_iki/c/private-iki.h | 16 +- level_2/fll_program/c/program.c | 6 +- level_2/fll_program/c/program/print.c | 36 +- level_3/byte_dump/c/main/common.c | 4 +- level_3/byte_dump/c/main/common/print.c | 2 +- level_3/byte_dump/c/main/common/print.h | 2 +- level_3/byte_dump/c/main/common/type.c | 2 +- level_3/byte_dump/c/main/print/error.c | 12 +- level_3/control/c/main/common.c | 8 +- level_3/control/c/main/common/print.c | 4 +- level_3/control/c/main/common/print.h | 4 +- level_3/control/c/main/common/type.c | 14 +- level_3/control/c/main/common/type.h | 5 +- level_3/control/c/main/packet.c | 4 +- level_3/control/c/main/packet.h | 8 +- level_3/control/c/main/print/error.c | 44 +-- level_3/control/c/main/print/message.c | 2 +- level_3/control/c/main/print/warning.c | 6 +- level_3/controller/c/common.c | 4 +- level_3/controller/c/common/private-cache.c | 16 +- level_3/controller/c/common/private-cache.h | 3 +- level_3/controller/c/common/private-control.c | 10 +- level_3/controller/c/common/private-entry.c | 12 +- level_3/controller/c/common/private-entry.h | 4 +- level_3/controller/c/common/private-process.c | 2 +- level_3/controller/c/common/private-process.h | 2 +- level_3/controller/c/common/private-rule.c | 22 +- level_3/controller/c/common/private-rule.h | 8 +- level_3/controller/c/common/private-setting.c | 12 +- level_3/controller/c/common/private-setting.h | 3 +- level_3/controller/c/controller.c | 4 +- .../controller/c/controller/private-controller.c | 30 +- level_3/controller/c/entry/private-entry.c | 52 +-- level_3/controller/c/entry/private-entry.h | 12 +- level_3/controller/c/entry/private-entry_print.c | 18 +- level_3/controller/c/lock/private-lock_print.c | 2 +- level_3/controller/c/rule/private-rule.c | 88 ++--- level_3/controller/c/rule/private-rule.h | 15 +- level_3/controller/c/rule/private-rule_print.c | 14 +- level_3/controller/c/thread/private-thread.c | 5 +- level_3/controller/c/thread/private-thread_entry.c | 10 +- level_3/fake/c/main/build.c | 6 +- level_3/fake/c/main/build.h | 4 +- level_3/fake/c/main/build/load.c | 98 ++--- level_3/fake/c/main/build/load.h | 4 +- level_3/fake/c/main/common.c | 12 +- level_3/fake/c/main/common.h | 8 +- level_3/fake/c/main/common/print.c | 6 +- level_3/fake/c/main/common/print.h | 6 +- level_3/fake/c/main/common/type.c | 404 ++++++++++----------- level_3/fake/c/main/fake.c | 8 +- level_3/fake/c/main/fake.h | 8 +- level_3/fake/c/main/fake/do.c | 4 +- level_3/fake/c/main/fake/do.h | 4 +- level_3/fake/c/main/make/load_fakefile.c | 17 +- level_3/fake/c/main/make/load_fakefile.h | 8 +- level_3/fake/c/main/make/load_parameters.c | 40 +- level_3/fake/c/main/make/load_parameters.h | 8 +- level_3/fake/c/main/make/operate.c | 56 +-- level_3/fake/c/main/make/operate.h | 30 +- level_3/fake/c/main/make/operate_process.c | 12 +- level_3/fake/c/main/make/operate_process.h | 4 +- level_3/fake/c/main/make/operate_process_type.c | 24 +- level_3/fake/c/main/make/operate_process_type.h | 20 +- level_3/fake/c/main/print/common.c | 4 +- level_3/fake/c/main/print/context.c | 10 +- level_3/fake/c/main/print/error.c | 26 +- level_3/fake/c/main/print/message.c | 8 +- level_3/firewall/c/firewall.c | 18 +- level_3/firewall/c/private-firewall.c | 71 ++-- level_3/firewall/c/private-firewall.h | 8 +- level_3/fss_identify/c/main/common.c | 8 +- level_3/fss_identify/c/main/common/print.c | 3 +- level_3/fss_identify/c/main/common/print.h | 3 +- level_3/fss_identify/c/main/common/type.c | 7 +- level_3/fss_identify/c/main/load.c | 4 +- level_3/fss_identify/c/main/load.h | 4 +- level_3/fss_identify/c/main/print/error.c | 4 +- level_3/fss_read/c/main/common.c | 4 +- level_3/fss_read/c/main/common/print.c | 7 +- level_3/fss_read/c/main/common/print.h | 7 +- level_3/fss_read/c/main/common/type.c | 4 +- level_3/fss_read/c/main/main/print.c | 4 +- level_3/fss_read/c/main/print/error.c | 4 +- level_3/fss_write/c/main/common.c | 12 +- level_3/fss_write/c/main/common/print.c | 9 +- level_3/fss_write/c/main/common/print.h | 9 +- level_3/fss_write/c/main/common/type.c | 12 +- level_3/fss_write/c/main/common/type.h | 1 + level_3/fss_write/c/main/fss_write.c | 24 +- level_3/fss_write/c/main/main/print.c | 4 +- level_3/fss_write/c/payload/fss_write.c | 32 +- level_3/iki_read/c/main/common.c | 34 +- level_3/iki_read/c/main/common.h | 8 +- level_3/iki_read/c/main/common/print.c | 7 +- level_3/iki_read/c/main/common/print.h | 5 +- level_3/iki_read/c/main/common/type.c | 7 +- level_3/iki_read/c/main/iki_read.c | 4 +- level_3/iki_read/c/main/process.c | 4 +- level_3/iki_write/c/main/common.c | 8 +- level_3/iki_write/c/main/common/print.c | 2 +- level_3/iki_write/c/main/common/print.h | 2 +- level_3/iki_write/c/main/common/type.c | 12 +- level_3/iki_write/c/main/print/error.c | 2 +- level_3/utf8/c/main/codepoint.c | 12 +- level_3/utf8/c/main/common.c | 14 +- level_3/utf8/c/main/common/print.c | 1 + level_3/utf8/c/main/common/print.h | 1 + level_3/utf8/c/main/common/type.c | 10 +- level_3/utf8/c/main/print/error.c | 10 +- 233 files changed, 1943 insertions(+), 2890 deletions(-) delete mode 100644 level_0/f_string/c/string/private-dynamicss.c delete mode 100644 level_0/f_string/c/string/private-dynamicss.h diff --git a/build/level_0/settings b/build/level_0/settings index e98ca9a..fc8e543 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -62,7 +62,7 @@ build_sources_library socket.c socket/address.c socket/socket.c build_sources_library status_string.c build_sources_library string.c build_sources_library private-string.c string/common.c -build_sources_library string/private-dynamics.c string/private-dynamicss.c +build_sources_library string/private-dynamics.c build_sources_library string/private-maps.c string/private-mapss.c build_sources_library string/private-map_multis.c string/private-map_multiss.c build_sources_library string/private-quantitys.c string/private-quantityss.c diff --git a/build/monolithic/settings b/build/monolithic/settings index 1ae9dd8..6199846 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -62,7 +62,7 @@ build_sources_library level_0/socket.c level_0/socket/address.c level_0/socket/s build_sources_library level_0/status_string.c build_sources_library level_0/string.c build_sources_library level_0/private-string.c level_0/string/common.c -build_sources_library level_0/string/private-dynamics.c level_0/string/private-dynamicss.c +build_sources_library level_0/string/private-dynamics.c build_sources_library level_0/string/private-maps.c level_0/string/private-mapss.c build_sources_library level_0/string/private-map_multis.c level_0/string/private-map_multiss.c build_sources_library level_0/string/private-quantitys.c level_0/string/private-quantityss.c diff --git a/build/stand_alone/byte_dump.config.h b/build/stand_alone/byte_dump.config.h index f7a095d..7993afd 100644 --- a/build/stand_alone/byte_dump.config.h +++ b/build/stand_alone/byte_dump.config.h @@ -309,15 +309,10 @@ #define _di_f_string_append_nulless_ //#define _di_f_string_ascii_s_ #define _di_f_string_constant_t_ -#define _di_f_string_dynamic_adjust_ #define _di_f_string_dynamic_append_ #define _di_f_string_dynamic_append_assure_ #define _di_f_string_dynamic_append_assure_nulless_ #define _di_f_string_dynamic_append_nulless_ -#define _di_f_string_dynamic_decimate_by_ -#define _di_f_string_dynamic_decrease_by_ -#define _di_f_string_dynamic_increase_ -//#define _di_f_string_dynamic_increase_by_ #define _di_f_string_dynamic_mash_ #define _di_f_string_dynamic_mash_nulless_ #define _di_f_string_dynamic_mish_ @@ -338,26 +333,13 @@ #define _di_f_string_dynamic_prepend_assure_ #define _di_f_string_dynamic_prepend_assure_nulless_ #define _di_f_string_dynamic_prepend_nulless_ -//#define _di_f_string_dynamic_resize_ -#define _di_f_string_dynamics_adjust_ #define _di_f_string_dynamics_append_ #define _di_f_string_dynamics_append_all_ -#define _di_f_string_dynamics_decimate_by_ -#define _di_f_string_dynamics_decrease_by_ #define _di_f_string_dynamic_seek_line_ #define _di_f_string_dynamic_seek_line_to_ #define _di_f_string_dynamic_seek_to_ -#define _di_f_string_dynamics_increase_ -//#define _di_f_string_dynamics_increase_by_ -//#define _di_f_string_dynamics_resize_ -#define _di_f_string_dynamicss_adjust_ #define _di_f_string_dynamicss_append_ #define _di_f_string_dynamicss_append_all_ -#define _di_f_string_dynamicss_decimate_by_ -#define _di_f_string_dynamicss_decrease_by_ -#define _di_f_string_dynamicss_increase_ -#define _di_f_string_dynamicss_increase_by_ -#define _di_f_string_dynamicss_resize_ #define _di_f_string_dynamicss_t_ //#define _di_f_string_dynamics_t_ //#define _di_f_string_dynamic_t_ @@ -840,26 +822,13 @@ #define _di_f_utf_string_dynamic_prepend_assure_ #define _di_f_utf_string_dynamic_prepend_assure_nulless_ #define _di_f_utf_string_dynamic_prepend_nulless_ -//#define _di_f_utf_string_dynamic_resize_ -#define _di_f_utf_string_dynamics_adjust_ #define _di_f_utf_string_dynamics_append_ #define _di_f_utf_string_dynamics_append_all_ -#define _di_f_utf_string_dynamics_decimate_by_ -#define _di_f_utf_string_dynamics_decrease_by_ #define _di_f_utf_string_dynamic_seek_line_ #define _di_f_utf_string_dynamic_seek_line_to_ #define _di_f_utf_string_dynamic_seek_to_ -#define _di_f_utf_string_dynamics_increase_ -#define _di_f_utf_string_dynamics_increase_by_ -//#define _di_f_utf_string_dynamics_resize_ -#define _di_f_utf_string_dynamicss_adjust_ #define _di_f_utf_string_dynamicss_append_ #define _di_f_utf_string_dynamicss_append_all_ -#define _di_f_utf_string_dynamicss_decimate_by_ -#define _di_f_utf_string_dynamicss_decrease_by_ -#define _di_f_utf_string_dynamicss_increase_ -#define _di_f_utf_string_dynamicss_increase_by_ -#define _di_f_utf_string_dynamicss_resize_ #define _di_f_utf_string_dynamicss_t_ //#define _di_f_utf_string_dynamics_t_ //#define _di_f_utf_string_dynamic_t_ diff --git a/build/stand_alone/fake.config.h b/build/stand_alone/fake.config.h index 1e7351e..d996fd6 100644 --- a/build/stand_alone/fake.config.h +++ b/build/stand_alone/fake.config.h @@ -1401,15 +1401,10 @@ //#define _di_f_string_append_nulless_ //#define _di_f_string_ascii_s_ #define _di_f_string_constant_t_ -#define _di_f_string_dynamic_adjust_ //#define _di_f_string_dynamic_append_ //#define _di_f_string_dynamic_append_assure_ #define _di_f_string_dynamic_append_assure_nulless_ //#define _di_f_string_dynamic_append_nulless_ -#define _di_f_string_dynamic_decimate_by_ -#define _di_f_string_dynamic_decrease_by_ -#define _di_f_string_dynamic_increase_ -//#define _di_f_string_dynamic_increase_by_ //#define _di_f_string_dynamic_mash_ #define _di_f_string_dynamic_mash_nulless_ #define _di_f_string_dynamic_mish_ @@ -1432,26 +1427,13 @@ #define _di_f_string_dynamic_prepend_assure_ #define _di_f_string_dynamic_prepend_assure_nulless_ #define _di_f_string_dynamic_prepend_nulless_ -//#define _di_f_string_dynamic_resize_ -#define _di_f_string_dynamics_adjust_ #define _di_f_string_dynamics_append_ #define _di_f_string_dynamics_append_all_ -#define _di_f_string_dynamics_decimate_by_ -#define _di_f_string_dynamics_decrease_by_ #define _di_f_string_dynamic_seek_line_ #define _di_f_string_dynamic_seek_line_to_ #define _di_f_string_dynamic_seek_to_ -//#define _di_f_string_dynamics_increase_ -//#define _di_f_string_dynamics_increase_by_ -//#define _di_f_string_dynamics_resize_ -#define _di_f_string_dynamicss_adjust_ #define _di_f_string_dynamicss_append_ #define _di_f_string_dynamicss_append_all_ -#define _di_f_string_dynamicss_decimate_by_ -#define _di_f_string_dynamicss_decrease_by_ -#define _di_f_string_dynamicss_increase_ -#define _di_f_string_dynamicss_increase_by_ -#define _di_f_string_dynamicss_resize_ #define _di_f_string_dynamicss_t_ //#define _di_f_string_dynamics_t_ //#define _di_f_string_dynamic_t_ @@ -1934,29 +1916,13 @@ #define _di_f_utf_string_dynamic_prepend_assure_ #define _di_f_utf_string_dynamic_prepend_assure_nulless_ #define _di_f_utf_string_dynamic_prepend_nulless_ -#define _di_f_utf_string_dynamic_resize_ -#define _di_f_utf_string_dynamics_adjust_ #define _di_f_utf_string_dynamics_append_ #define _di_f_utf_string_dynamics_append_all_ -#define _di_f_utf_string_dynamics_decimate_by_ -#define _di_f_utf_string_dynamics_decrease_by -#define _di_f_utf_string_dynamics_decrease_by_ #define _di_f_utf_string_dynamic_seek_line_ #define _di_f_utf_string_dynamic_seek_line_to_ #define _di_f_utf_string_dynamic_seek_to_ -#define _di_f_utf_string_dynamics_increase -#define _di_f_utf_string_dynamics_increase_ -#define _di_f_utf_string_dynamics_increase_by -#define _di_f_utf_string_dynamics_increase_by_ -#define _di_f_utf_string_dynamics_resize_ -#define _di_f_utf_string_dynamicss_adjust_ #define _di_f_utf_string_dynamicss_append_ #define _di_f_utf_string_dynamicss_append_all_ -#define _di_f_utf_string_dynamicss_decimate_by_ -#define _di_f_utf_string_dynamicss_decrease_by_ -#define _di_f_utf_string_dynamicss_increase_ -#define _di_f_utf_string_dynamicss_increase_by_ -#define _di_f_utf_string_dynamicss_resize_ #define _di_f_utf_string_dynamicss_t_ //#define _di_f_utf_string_dynamics_t_ //#define _di_f_utf_string_dynamic_t_ diff --git a/build/stand_alone/fake.settings b/build/stand_alone/fake.settings index 271d579..bb225e2 100644 --- a/build/stand_alone/fake.settings +++ b/build/stand_alone/fake.settings @@ -54,7 +54,7 @@ build_sources_program fll/level_0/pipe.c build_sources_program fll/level_0/print.c fll/level_0/private-print.c fll/level_0/print/common.c fll/level_0/print/to.c fll/level_0/print/private-to.c build_sources_program fll/level_0/rip.c fll/level_0/rip/utf.c fll/level_0/private-rip.c fll/level_0/rip/private-utf.c build_sources_program fll/level_0/signal.c -build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/private-dynamics.c fll/level_0/string/private-dynamicss.c fll/level_0/string/private-maps.c fll/level_0/string/private-mapss.c fll/level_0/string/private-map_multis.c fll/level_0/string/private-map_multiss.c fll/level_0/string/private-quantitys.c fll/level_0/string/private-quantityss.c fll/level_0/string/private-ranges.c fll/level_0/string/private-rangess.c fll/level_0/string/private-triples.c fll/level_0/string/private-tripless.c +build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/private-dynamics.c fll/level_0/string/private-maps.c fll/level_0/string/private-mapss.c fll/level_0/string/private-map_multis.c fll/level_0/string/private-map_multiss.c fll/level_0/string/private-quantitys.c fll/level_0/string/private-quantityss.c fll/level_0/string/private-ranges.c fll/level_0/string/private-rangess.c fll/level_0/string/private-triples.c fll/level_0/string/private-tripless.c build_sources_program fll/level_0/string/dynamic.c fll/level_0/string/dynamics.c fll/level_0/string/dynamicss.c fll/level_0/string/map.c fll/level_0/string/maps.c fll/level_0/string/mapss.c fll/level_0/string/map_multi.c fll/level_0/string/map_multis.c fll/level_0/string/map_multiss.c fll/level_0/string/quantity.c fll/level_0/string/quantitys.c fll/level_0/string/quantityss.c fll/level_0/string/range.c fll/level_0/string/ranges.c fll/level_0/string/rangess.c fll/level_0/string/static.c fll/level_0/string/statics.c fll/level_0/string/staticss.c fll/level_0/string/triple.c fll/level_0/string/triples.c fll/level_0/string/tripless.c build_sources_program fll/level_0/type_array/cell.c fll/level_0/type_array/file.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c diff --git a/build/stand_alone/firewall.config.h b/build/stand_alone/firewall.config.h index 9c7c756..debb97c 100644 --- a/build/stand_alone/firewall.config.h +++ b/build/stand_alone/firewall.config.h @@ -585,26 +585,13 @@ #define _di_f_string_dynamic_prepend_assure_ #define _di_f_string_dynamic_prepend_assure_nulless_ #define _di_f_string_dynamic_prepend_nulless_ -//#define _di_f_string_dynamic_resize_ -#define _di_f_string_dynamics_adjust_ #define _di_f_string_dynamics_append_ #define _di_f_string_dynamics_append_all_ -#define _di_f_string_dynamics_decimate_by_ -#define _di_f_string_dynamics_decrease_by_ #define _di_f_string_dynamic_seek_line_ #define _di_f_string_dynamic_seek_line_to_ #define _di_f_string_dynamic_seek_to_ -//#define _di_f_string_dynamics_increase_ -//#define _di_f_string_dynamics_increase_by_ -//#define _di_f_string_dynamics_resize_ -#define _di_f_string_dynamicss_adjust_ #define _di_f_string_dynamicss_append_ #define _di_f_string_dynamicss_append_all_ -#define _di_f_string_dynamicss_decimate_by_ -#define _di_f_string_dynamicss_decrease_by_ -#define _di_f_string_dynamicss_increase_ -#define _di_f_string_dynamicss_increase_by_ -#define _di_f_string_dynamicss_resize_ //#define _di_f_string_dynamicss_t_ //#define _di_f_string_dynamics_t_ //#define _di_f_string_dynamic_t_ @@ -1203,15 +1190,10 @@ #define _di_f_utf_string_append_assure_ #define _di_f_utf_string_append_assure_nulless_ #define _di_f_utf_string_append_nulless_ -#define _di_f_utf_string_dynamic_adjust_ #define _di_f_utf_string_dynamic_append_ #define _di_f_utf_string_dynamic_append_assure_ #define _di_f_utf_string_dynamic_append_assure_nulless_ #define _di_f_utf_string_dynamic_append_nulless_ -#define _di_f_utf_string_dynamic_decimate_by_ -#define _di_f_utf_string_dynamic_decrease_by_ -#define _di_f_utf_string_dynamic_increase_ -#define _di_f_utf_string_dynamic_increase_by_ #define _di_f_utf_string_dynamic_mash_ #define _di_f_utf_string_dynamic_mash_nulless_ #define _di_f_utf_string_dynamic_mish_ @@ -1232,26 +1214,13 @@ #define _di_f_utf_string_dynamic_prepend_assure_ #define _di_f_utf_string_dynamic_prepend_assure_nulless_ #define _di_f_utf_string_dynamic_prepend_nulless_ -#define _di_f_utf_string_dynamic_resize_ -#define _di_f_utf_string_dynamics_adjust_ #define _di_f_utf_string_dynamics_append_ #define _di_f_utf_string_dynamics_append_all_ -#define _di_f_utf_string_dynamics_decimate_by_ -#define _di_f_utf_string_dynamics_decrease_by_ #define _di_f_utf_string_dynamic_seek_line_ #define _di_f_utf_string_dynamic_seek_line_to_ #define _di_f_utf_string_dynamic_seek_to_ -#define _di_f_utf_string_dynamics_increase_ -#define _di_f_utf_string_dynamics_increase_by_ -#define _di_f_utf_string_dynamics_resize_ -#define _di_f_utf_string_dynamicss_adjust_ #define _di_f_utf_string_dynamicss_append_ #define _di_f_utf_string_dynamicss_append_all_ -#define _di_f_utf_string_dynamicss_decimate_by_ -#define _di_f_utf_string_dynamicss_decrease_by_ -#define _di_f_utf_string_dynamicss_increase_ -#define _di_f_utf_string_dynamicss_increase_by_ -#define _di_f_utf_string_dynamicss_resize_ #define _di_f_utf_string_dynamicss_t_ //#define _di_f_utf_string_dynamics_t_ //#define _di_f_utf_string_dynamic_t_ diff --git a/build/stand_alone/utf8.config.h b/build/stand_alone/utf8.config.h index 3c12923..3c692c5 100644 --- a/build/stand_alone/utf8.config.h +++ b/build/stand_alone/utf8.config.h @@ -337,26 +337,13 @@ #define _di_f_string_dynamic_prepend_assure_ #define _di_f_string_dynamic_prepend_assure_nulless_ #define _di_f_string_dynamic_prepend_nulless_ -//#define _di_f_string_dynamic_resize_ -#define _di_f_string_dynamics_adjust_ #define _di_f_string_dynamics_append_ #define _di_f_string_dynamics_append_all_ -#define _di_f_string_dynamics_decimate_by_ -#define _di_f_string_dynamics_decrease_by_ #define _di_f_string_dynamic_seek_line_ #define _di_f_string_dynamic_seek_line_to_ #define _di_f_string_dynamic_seek_to_ -#define _di_f_string_dynamics_increase_ -//#define _di_f_string_dynamics_increase_by_ -//#define _di_f_string_dynamics_resize_ -#define _di_f_string_dynamicss_adjust_ #define _di_f_string_dynamicss_append_ #define _di_f_string_dynamicss_append_all_ -#define _di_f_string_dynamicss_decimate_by_ -#define _di_f_string_dynamicss_decrease_by_ -#define _di_f_string_dynamicss_increase_ -#define _di_f_string_dynamicss_increase_by_ -#define _di_f_string_dynamicss_resize_ #define _di_f_string_dynamicss_t_ //#define _di_f_string_dynamics_t_ //#define _di_f_string_dynamic_t_ @@ -810,15 +797,10 @@ #define _di_f_utf_string_append_assure_ #define _di_f_utf_string_append_assure_nulless_ #define _di_f_utf_string_append_nulless_ -#define _di_f_utf_string_dynamic_adjust_ #define _di_f_utf_string_dynamic_append_ #define _di_f_utf_string_dynamic_append_assure_ #define _di_f_utf_string_dynamic_append_assure_nulless_ #define _di_f_utf_string_dynamic_append_nulless_ -#define _di_f_utf_string_dynamic_decimate_by_ -#define _di_f_utf_string_dynamic_decrease_by_ -#define _di_f_utf_string_dynamic_increase_ -#define _di_f_utf_string_dynamic_increase_by_ #define _di_f_utf_string_dynamic_mash_ #define _di_f_utf_string_dynamic_mash_nulless_ #define _di_f_utf_string_dynamic_mish_ @@ -839,26 +821,13 @@ #define _di_f_utf_string_dynamic_prepend_assure_ #define _di_f_utf_string_dynamic_prepend_assure_nulless_ #define _di_f_utf_string_dynamic_prepend_nulless_ -#define _di_f_utf_string_dynamic_resize_ -#define _di_f_utf_string_dynamics_adjust_ #define _di_f_utf_string_dynamics_append_ #define _di_f_utf_string_dynamics_append_all_ -#define _di_f_utf_string_dynamics_decimate_by_ -#define _di_f_utf_string_dynamics_decrease_by_ #define _di_f_utf_string_dynamic_seek_line_ #define _di_f_utf_string_dynamic_seek_line_to_ #define _di_f_utf_string_dynamic_seek_to_ -#define _di_f_utf_string_dynamics_increase_ -//#define _di_f_utf_string_dynamics_increase_by_ -#define _di_f_utf_string_dynamics_resize_ -#define _di_f_utf_string_dynamicss_adjust_ #define _di_f_utf_string_dynamicss_append_ #define _di_f_utf_string_dynamicss_append_all_ -#define _di_f_utf_string_dynamicss_decimate_by_ -#define _di_f_utf_string_dynamicss_decrease_by_ -#define _di_f_utf_string_dynamicss_increase_ -#define _di_f_utf_string_dynamicss_increase_by_ -#define _di_f_utf_string_dynamicss_resize_ #define _di_f_utf_string_dynamicss_t_ //#define _di_f_utf_string_dynamics_t_ //#define _di_f_utf_string_dynamic_t_ diff --git a/build/stand_alone/utf8.settings b/build/stand_alone/utf8.settings index ea2daa3..00ce151 100644 --- a/build/stand_alone/utf8.settings +++ b/build/stand_alone/utf8.settings @@ -31,7 +31,7 @@ build_sources_program fll/level_0/memory.c fll/level_0/private-memory.c fll/leve build_sources_program fll/level_0/pipe.c build_sources_program fll/level_0/print.c fll/level_0/private-print.c fll/level_0/print/common.c fll/level_0/print/to.c fll/level_0/print/private-to.c build_sources_program fll/level_0/signal.c -build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/private-dynamics.c fll/level_0/string/private-dynamicss.c fll/level_0/string/private-maps.c fll/level_0/string/private-mapss.c fll/level_0/string/private-map_multis.c fll/level_0/string/private-map_multiss.c fll/level_0/string/private-quantitys.c fll/level_0/string/private-quantityss.c fll/level_0/string/private-ranges.c fll/level_0/string/private-rangess.c fll/level_0/string/private-triples.c fll/level_0/string/private-tripless.c +build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/private-dynamics.c fll/level_0/string/private-maps.c fll/level_0/string/private-mapss.c fll/level_0/string/private-map_multis.c fll/level_0/string/private-map_multiss.c fll/level_0/string/private-quantitys.c fll/level_0/string/private-quantityss.c fll/level_0/string/private-ranges.c fll/level_0/string/private-rangess.c fll/level_0/string/private-triples.c fll/level_0/string/private-tripless.c build_sources_program fll/level_0/string/dynamic.c fll/level_0/string/dynamics.c fll/level_0/string/dynamicss.c fll/level_0/string/map.c fll/level_0/string/maps.c fll/level_0/string/mapss.c fll/level_0/string/map_multi.c fll/level_0/string/map_multis.c fll/level_0/string/map_multiss.c fll/level_0/string/quantity.c fll/level_0/string/quantitys.c fll/level_0/string/quantityss.c fll/level_0/string/range.c fll/level_0/string/ranges.c fll/level_0/string/rangess.c fll/level_0/string/static.c fll/level_0/string/statics.c fll/level_0/string/staticss.c fll/level_0/string/triple.c fll/level_0/string/triples.c fll/level_0/string/tripless.c build_sources_program fll/level_0/type_array/cell.c fll/level_0/type_array/file.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c diff --git a/level_0/f_account/c/account.c b/level_0/f_account/c/account.c index cba191e..01ae7bd 100644 --- a/level_0/f_account/c/account.c +++ b/level_0/f_account/c/account.c @@ -286,7 +286,7 @@ extern "C" { name->used = 0; - status = f_string_dynamic_increase_by(name_length + 1, name); + status = f_memory_array_increase_by(name_length + 1, sizeof(f_char_t), (void **) &name->string, &name->used, &name->size); if (F_status_is_error(status)) return status; memcpy(name->string, group_data.gr_name, sizeof(f_char_t) * name_length); @@ -321,7 +321,7 @@ extern "C" { name->used = 0; - status = f_string_dynamic_increase_by(name_length + 1, name); + status = f_memory_array_increase_by(name_length + 1, sizeof(f_char_t), (void **) &name->string, &name->used, &name->size); if (F_status_is_error(status)) return status; memcpy(name->string, group_data.gr_name, sizeof(f_char_t) * name_length); @@ -458,7 +458,7 @@ extern "C" { name->used = 0; - status = f_string_dynamic_increase_by(name_length + 1, name); + status = f_memory_array_increase_by(name_length + 1, sizeof(f_char_t), (void **) &name->string, &name->used, &name->size); if (F_status_is_error(status)) return status; memcpy(name->string, password.pw_name, sizeof(f_char_t) * name_length); @@ -493,7 +493,7 @@ extern "C" { name->used = 0; - status = f_string_dynamic_increase_by(name_length + 1, name); + status = f_memory_array_increase_by(name_length + 1, sizeof(f_char_t), (void **) &name->string, &name->used, &name->size); if (F_status_is_error(status)) return status; memcpy(name->string, password.pw_name, sizeof(f_char_t) * name_length); diff --git a/level_0/f_account/c/account.h b/level_0/f_account/c/account.h index 599c185..ea45a20 100644 --- a/level_0/f_account/c/account.h +++ b/level_0/f_account/c/account.h @@ -54,12 +54,12 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_failure (with error bit) on any other error. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see getpwuid_r() * @see sysconf() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_account_by_id_ extern f_status_t f_account_by_id(const uid_t id, f_account_t * const account); @@ -87,11 +87,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_failure (with error bit) on any other error. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see getpwnam_r() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_account_by_name_ extern f_status_t f_account_by_name(const f_string_static_t name, f_account_t * const account); @@ -145,11 +145,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_failure (with error bit) on any other error. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see getgrgid_r() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_account_group_name_by_id_ extern f_status_t f_account_group_name_by_id(const gid_t id, f_string_dynamic_t * const name); @@ -203,11 +203,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_failure (with error bit) on any other error. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see getpwuid_r() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_account_name_by_id_ extern f_status_t f_account_name_by_id(const uid_t id, f_string_dynamic_t * const name); diff --git a/level_0/f_account/c/account/accounts.c b/level_0/f_account/c/account/accounts.c index d69757a..00c41f3 100644 --- a/level_0/f_account/c/account/accounts.c +++ b/level_0/f_account/c/account/accounts.c @@ -12,19 +12,19 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - f_status_t status = f_string_dynamic_resize(0, &account->home); + f_status_t status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &account->home.string, &account->home.used, &account->home.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &account->label); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &account->label.string, &account->label.used, &account->label.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &account->name); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &account->name.string, &account->name.used, &account->name.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &account->password); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &account->password.string, &account->password.used, &account->password.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &account->shell); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &account->shell.string, &account->shell.used, &account->shell.size); if (F_status_is_error(status)) return status; } @@ -38,23 +38,20 @@ extern "C" { if (!account) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - account->id_user = 0; - account->id_group = 0; - { - f_status_t status = f_string_dynamic_adjust(0, &account->home); + f_status_t status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &account->home.string, &account->home.used, &account->home.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &account->label); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &account->label.string, &account->label.used, &account->label.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &account->name); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &account->name.string, &account->name.used, &account->name.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &account->password); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &account->password.string, &account->password.used, &account->password.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &account->shell); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &account->shell.string, &account->shell.used, &account->shell.size); if (F_status_is_error(status)) return status; } @@ -71,19 +68,19 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamic_resize(0, &array[i].home); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].home.string, &array[i].home.used, &array[i].home.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].label); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].label.string, &array[i].label.used, &array[i].label.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].name); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].password); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].password.string, &array[i].password.used, &array[i].password.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].shell); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].shell.string, &array[i].shell.used, &array[i].shell.size); if (F_status_is_error(status)) return status; } // for } @@ -101,19 +98,19 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamic_adjust(0, &array[i].home); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].home.string, &array[i].home.used, &array[i].home.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].label); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].label.string, &array[i].label.used, &array[i].label.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].name); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].password); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].password.string, &array[i].password.used, &array[i].password.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].shell); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].shell.string, &array[i].shell.used, &array[i].shell.size); if (F_status_is_error(status)) return status; } // for } @@ -134,19 +131,19 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamic_resize(0, &array[i].array[j].home); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].home.string, &array[i].array[j].home.used, &array[i].array[j].home.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].array[j].label); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].label.string, &array[i].array[j].label.used, &array[i].array[j].label.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].array[j].name); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].array[j].password); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].password.string, &array[i].array[j].password.used, &array[i].array[j].password.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].array[j].shell); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].shell.string, &array[i].array[j].shell.used, &array[i].array[j].shell.size); if (F_status_is_error(status)) return status; } // for @@ -173,19 +170,19 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamic_adjust(0, &array[i].array[j].home); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].home.string, &array[i].array[j].home.used, &array[i].array[j].home.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].array[j].label); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].label.string, &array[i].array[j].label.used, &array[i].array[j].label.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].array[j].name); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].array[j].password); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].password.string, &array[i].array[j].password.used, &array[i].array[j].password.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].array[j].shell); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].shell.string, &array[i].array[j].shell.used, &array[i].array[j].shell.size); if (F_status_is_error(status)) return status; } // for diff --git a/level_0/f_account/c/account/accounts.h b/level_0/f_account/c/account/accounts.h index 4383023..febf5de 100644 --- a/level_0/f_account/c/account/accounts.h +++ b/level_0/f_account/c/account/accounts.h @@ -27,9 +27,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_account_delete_ extern f_status_t f_account_delete(f_account_t * const account); @@ -46,9 +46,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_account_destroy_ extern f_status_t f_account_destroy(f_account_t * const account); @@ -74,9 +74,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_accounts_delete_callback_ extern f_status_t f_accounts_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -102,9 +102,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_accounts_destroy_callback_ extern f_status_t f_accounts_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -131,10 +131,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_memory_array_resize(). - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * * @see f_memory_array_resize() - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_accountss_delete_callback_ extern f_status_t f_accountss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -161,10 +161,8 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_memory_array_adjust(). - * Errors (with error bit) from: f_string_dynamic_adjust(). * * @see f_memory_array_adjust() - * @see f_string_dynamic_adjust() */ #ifndef _di_f_accountss_destroy_callback_ extern f_status_t f_accountss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_account/c/private-account.c b/level_0/f_account/c/private-account.c index 8a31d94..b5f53a8 100644 --- a/level_0/f_account/c/private-account.c +++ b/level_0/f_account/c/private-account.c @@ -20,7 +20,7 @@ extern "C" { account->home.used = 0; - status = f_string_dynamic_increase_by(string_length + 1, &account->home); + status = f_memory_array_increase_by(string_length + 1, sizeof(f_char_t), (void **) &account->home.string, &account->home.used, &account->home.size); if (F_status_is_error(status)) return status; memcpy(account->home.string, password.pw_dir, sizeof(f_char_t) * string_length); @@ -33,7 +33,7 @@ extern "C" { account->label.used = 0; - status = f_string_dynamic_increase_by(string_length + 1, &account->label); + status = f_memory_array_increase_by(string_length + 1, sizeof(f_char_t), (void **) &account->label.string, &account->label.used, &account->label.size); if (F_status_is_error(status)) return status; memcpy(account->label.string, password.pw_gecos, sizeof(f_char_t) * string_length); @@ -46,7 +46,7 @@ extern "C" { account->name.used = 0; - status = f_string_dynamic_increase_by(string_length + 1, &account->name); + status = f_memory_array_increase_by(string_length + 1, sizeof(f_char_t), (void **) &account->name.string, &account->name.used, &account->name.size); if (F_status_is_error(status)) return status; memcpy(account->name.string, password.pw_name, sizeof(f_char_t) * string_length); @@ -59,7 +59,7 @@ extern "C" { account->password.used = 0; - status = f_string_dynamic_increase_by(string_length + 1, &account->password); + status = f_memory_array_increase_by(string_length + 1, sizeof(f_char_t), (void **) &account->password.string, &account->password.used, &account->password.size); if (F_status_is_error(status)) return status; memcpy(account->password.string, password.pw_passwd, sizeof(f_char_t) * string_length); @@ -72,7 +72,7 @@ extern "C" { account->shell.used = 0; - status = f_string_dynamic_increase_by(string_length + 1, &account->shell); + status = f_memory_array_increase_by(string_length + 1, sizeof(f_char_t), (void **) &account->shell.string, &account->shell.used, &account->shell.size); if (F_status_is_error(status)) return status; memcpy(account->shell.string, password.pw_shell, sizeof(f_char_t) * string_length); diff --git a/level_0/f_account/c/private-account.h b/level_0/f_account/c/private-account.h index 4f7fb72..0a2d743 100644 --- a/level_0/f_account/c/private-account.h +++ b/level_0/f_account/c/private-account.h @@ -32,9 +32,9 @@ extern "C" { * @return * F_okay on success. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #if !defined(_di_f_account_by_name_) || !defined(_di_f_account_by_id_) extern f_status_t private_f_account_from_passwd(const struct passwd password, const f_number_unsigned_t password_length, f_account_t * const account) F_attribute_visibility_internal_d; diff --git a/level_0/f_capability/c/capability.c b/level_0/f_capability/c/capability.c index 6a6e239..30b9555 100644 --- a/level_0/f_capability/c/capability.c +++ b/level_0/f_capability/c/capability.c @@ -1056,12 +1056,14 @@ extern "C" { return F_status_set_error(F_string_too_large); } - const f_status_t status = f_string_dynamic_resize(name->used + length + 1, name); + { + const f_status_t status = f_memory_array_resize(name->used + length + 1, sizeof(f_char_t), (void **) &name->string, &name->used, &name->size); - if (F_status_is_error(status)) { - cap_free(result); + if (F_status_is_error(status)) { + cap_free(result); - return status; + return status; + } } } @@ -1097,12 +1099,14 @@ extern "C" { return F_status_set_error(F_string_too_large); } - const f_status_t status = f_string_dynamic_resize(text->used + length + 1, text); + { + const f_status_t status = f_memory_array_resize(text->used + length + 1, sizeof(f_char_t), (void **) &text->string, &text->used, &text->size); - if (F_status_is_error(status)) { - cap_free(result); + if (F_status_is_error(status)) { + cap_free(result); - return status; + return status; + } } } diff --git a/level_0/f_capability/c/capability.h b/level_0/f_capability/c/capability.h index 0a0dde0..72c4539 100644 --- a/level_0/f_capability/c/capability.h +++ b/level_0/f_capability/c/capability.h @@ -925,12 +925,12 @@ extern "C" { * * F_failure (with error bit) on any other failure. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * * @see cap_free() * @see cap_to_name() * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_capability_to_name_ extern f_status_t f_capability_to_name(const f_capability_value_t code, f_string_dynamic_t * const name); @@ -957,12 +957,12 @@ extern "C" { * * F_failure (with error bit) on any other failure. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * * @see cap_free() * @see cap_to_text() * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_capability_to_text_ extern f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t * const text); diff --git a/level_0/f_color/c/color.c b/level_0/f_color/c/color.c index a9bdf83..5a1a0e2 100644 --- a/level_0/f_color/c/color.c +++ b/level_0/f_color/c/color.c @@ -34,7 +34,7 @@ extern "C" { f_status_t status = F_okay; if (context->error.size) { - status = f_string_dynamic_resize(0, &context->error); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->error.string, &context->error.used, &context->error.size); if (F_status_is_error(status)) return status; } else { @@ -42,7 +42,7 @@ extern "C" { } if (context->important.size) { - status = f_string_dynamic_resize(0, &context->important); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->important.string, &context->important.used, &context->important.size); if (F_status_is_error(status)) return status; } else { @@ -50,7 +50,7 @@ extern "C" { } if (context->normal.size) { - status = f_string_dynamic_resize(0, &context->normal); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->normal.string, &context->normal.used, &context->normal.size); if (F_status_is_error(status)) return status; } else { @@ -58,7 +58,7 @@ extern "C" { } if (context->normal_reset.size) { - status = f_string_dynamic_resize(0, &context->normal_reset); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->normal_reset.string, &context->normal_reset.used, &context->normal_reset.size); if (F_status_is_error(status)) return status; } else { @@ -66,7 +66,7 @@ extern "C" { } if (context->notable.size) { - status = f_string_dynamic_resize(0, &context->notable); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->notable.string, &context->notable.used, &context->notable.size); if (F_status_is_error(status)) return status; } else { @@ -74,7 +74,7 @@ extern "C" { } if (context->reset.size) { - status = f_string_dynamic_resize(0, &context->reset); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->reset.string, &context->reset.used, &context->reset.size); if (F_status_is_error(status)) return status; } else { @@ -82,7 +82,7 @@ extern "C" { } if (context->standout.size) { - status = f_string_dynamic_resize(0, &context->standout); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->standout.string, &context->standout.used, &context->standout.size); if (F_status_is_error(status)) return status; } else { @@ -90,7 +90,7 @@ extern "C" { } if (context->success.size) { - status = f_string_dynamic_resize(0, &context->success); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->success.string, &context->success.used, &context->success.size); if (F_status_is_error(status)) return status; } else { @@ -98,7 +98,7 @@ extern "C" { } if (context->title.size) { - status = f_string_dynamic_resize(0, &context->title); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->title.string, &context->title.used, &context->title.size); if (F_status_is_error(status)) return status; } else { @@ -106,7 +106,7 @@ extern "C" { } if (context->warning.size) { - status = f_string_dynamic_resize(0, &context->warning); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->warning.string, &context->warning.used, &context->warning.size); if (F_status_is_error(status)) return status; } else { @@ -240,7 +240,7 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - const f_status_t status = f_string_dynamic_increase_by(format.begin.used + (format.medium.used * 2) + format.end.used + color1.used + color2.used + color3.used + 1, buffer); + const f_status_t status = f_memory_array_increase_by(format.begin.used + (format.medium.used * 2) + format.end.used + color1.used + color2.used + color3.used + 1, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) return status; } @@ -293,7 +293,7 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - const f_status_t status = f_string_dynamic_increase_by(format.begin.used + (format.medium.used * 3) + format.end.used + color1.used + color2.used + color3.used + color4.used + 1, buffer); + const f_status_t status = f_memory_array_increase_by(format.begin.used + (format.medium.used * 3) + format.end.used + color1.used + color2.used + color3.used + color4.used + 1, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) return status; } @@ -358,7 +358,7 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - const f_status_t status = f_string_dynamic_increase_by(format.begin.used + (format.medium.used * 4) + format.end.used + color1.used + color2.used + color3.used + color4.used + color5.used + 1, buffer); + const f_status_t status = f_memory_array_increase_by(format.begin.used + (format.medium.used * 4) + format.end.used + color1.used + color2.used + color3.used + color4.used + color5.used + 1, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_color/c/color.h b/level_0/f_color/c/color.h index 26d7ee3..0ed0620 100644 --- a/level_0/f_color/c/color.h +++ b/level_0/f_color/c/color.h @@ -57,11 +57,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see memcpy() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_color_load_context_ extern f_status_t f_color_load_context(const uint8_t mode, f_color_context_t * const context); @@ -87,11 +87,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see memcpy() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_color_save_1_ extern f_status_t f_color_save_1(const f_color_format_t format, const f_string_static_t color1, f_string_dynamic_t * const buffer); @@ -120,11 +120,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see memcpy() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_color_save_2_ extern f_status_t f_color_save_2(const f_color_format_t format, const f_string_static_t color1, const f_string_static_t color2, f_string_dynamic_t * const buffer); @@ -156,11 +156,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see memcpy() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_color_save_3_ extern f_status_t f_color_save_3(const f_color_format_t format, const f_string_static_t color1, const f_string_static_t color2, const f_string_static_t color3, f_string_dynamic_t * const buffer); @@ -195,11 +195,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see memcpy() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_color_save_4_ extern f_status_t f_color_save_4(const f_color_format_t format, const f_string_static_t color1, const f_string_static_t color2, const f_string_static_t color3, const f_string_static_t color4, f_string_dynamic_t * const buffer); @@ -239,11 +239,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see memcpy() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_color_save_5_ extern f_status_t f_color_save_5(const f_color_format_t format, const f_string_static_t color1, const f_string_static_t color2, const f_string_static_t color3, const f_string_static_t color4, const f_string_static_t color5, f_string_dynamic_t * const buffer); diff --git a/level_0/f_color/c/color/common.c b/level_0/f_color/c/color/common.c index 32bc621..df6be97 100644 --- a/level_0/f_color/c/color/common.c +++ b/level_0/f_color/c/color/common.c @@ -192,42 +192,42 @@ extern "C" { f_status_t status = F_okay; - status = f_string_dynamic_resize(0, &context->error); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->error.string, &context->error.used, &context->error.size); if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->important); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->important.string, &context->important.used, &context->important.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->normal); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->normal.string, &context->normal.used, &context->normal.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->normal_reset); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->normal_reset.string, &context->normal_reset.used, &context->normal_reset.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->notable); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->notable.string, &context->notable.used, &context->notable.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->reset); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->reset.string, &context->reset.used, &context->reset.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->standout); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->standout.string, &context->standout.used, &context->standout.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->success); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->success.string, &context->success.used, &context->success.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->title); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->title.string, &context->title.used, &context->title.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_resize(0, &context->warning); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &context->warning.string, &context->warning.used, &context->warning.size); } if (F_status_is_error(status)) return status; @@ -246,42 +246,42 @@ extern "C" { f_status_t status = F_okay; - status = f_string_dynamic_adjust(0, &context->error); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->error.string, &context->error.used, &context->error.size); if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->important); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->important.string, &context->important.used, &context->important.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->normal); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->normal.string, &context->normal.used, &context->normal.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->normal_reset); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->normal_reset.string, &context->normal_reset.used, &context->normal_reset.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->notable); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->notable.string, &context->notable.used, &context->notable.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->reset); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->reset.string, &context->reset.used, &context->reset.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->standout); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->standout.string, &context->standout.used, &context->standout.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->success); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->success.string, &context->success.used, &context->success.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->title); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->title.string, &context->title.used, &context->title.size); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_adjust(0, &context->warning); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &context->warning.string, &context->warning.used, &context->warning.size); } if (F_status_is_error(status)) return status; diff --git a/level_0/f_color/c/color/common.h b/level_0/f_color/c/color/common.h index 2fd87db..94172cf 100644 --- a/level_0/f_color/c/color/common.h +++ b/level_0/f_color/c/color/common.h @@ -1018,9 +1018,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_color_context_delete_ extern f_status_t f_color_context_delete(f_color_context_t * const context); @@ -1037,9 +1037,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_color_context_destroy_ extern f_status_t f_color_context_destroy(f_color_context_t * const context); diff --git a/level_0/f_color/c/private-color.c b/level_0/f_color/c/private-color.c index bfea5b1..6e8c013 100644 --- a/level_0/f_color/c/private-color.c +++ b/level_0/f_color/c/private-color.c @@ -9,7 +9,7 @@ extern "C" { f_status_t private_f_color_save_1(const f_color_format_t format, const f_string_static_t color1, f_string_dynamic_t * const buffer) { { - const f_status_t status = f_string_dynamic_increase_by(format.begin.used + format.end.used + color1.used + 1, buffer); + const f_status_t status = f_memory_array_increase_by(format.begin.used + format.end.used + color1.used + 1, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) return status; } @@ -41,7 +41,7 @@ extern "C" { f_status_t private_f_color_save_2(const f_color_format_t format, const f_string_static_t color1, const f_string_static_t color2, f_string_dynamic_t * const buffer) { { - const f_status_t status = f_string_dynamic_increase_by(format.begin.used + format.medium.used + format.end.used + color1.used + color2.used + 1, buffer); + const f_status_t status = f_memory_array_increase_by(format.begin.used + format.medium.used + format.end.used + color1.used + color2.used + 1, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_color/c/private-color.h b/level_0/f_color/c/private-color.h index 6a88b4d..79fe241 100644 --- a/level_0/f_color/c/private-color.h +++ b/level_0/f_color/c/private-color.h @@ -31,11 +31,11 @@ extern "C" { * @return * F_okay on success. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see memcpy() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * * @see f_color_load_context() * @see f_color_save_1() @@ -60,11 +60,11 @@ extern "C" { * @return * F_okay on success. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see memcpy() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * * @see f_color_load_context() * @see f_color_save_2() diff --git a/level_0/f_console/c/console.c b/level_0/f_console/c/console.c index 5d5ac09..1858f1c 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -171,7 +171,7 @@ extern "C" { process.state = state; - state->status = f_string_dynamics_increase_by(arguments.argc, ¶meters->arguments); + state->status = f_memory_array_increase_by(arguments.argc, sizeof(f_string_dynamic_t), (void **) ¶meters->arguments.array, ¶meters->arguments.used, ¶meters->arguments.size); if (F_status_is_error(state->status)) return; state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &process.needs.array, &process.needs.used, &process.needs.size); diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index d614475..11d0b3c 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -176,11 +176,9 @@ extern "C" { * Set to NULL to not use. * * Errors (with error bit) from: f_memory_array_increase_by(). - * Errors (with error bit) from: f_string_dynamics_increase_by(). * Errors (with error bit) from: f_utf_char_to_character(). * * @see f_memory_array_increase_by() - * @see f_string_dynamics_increase_by() * @see f_utf_char_to_character() */ #ifndef _di_f_console_parameter_process_ diff --git a/level_0/f_console/c/console/common.c b/level_0/f_console/c/console/common.c index 09800bc..36967fb 100644 --- a/level_0/f_console/c/console/common.c +++ b/level_0/f_console/c/console/common.c @@ -184,7 +184,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_string_dynamics_resize(0, ¶meters->arguments); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) ¶meters->arguments.array, ¶meters->arguments.used, ¶meters->arguments.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; status = f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) ¶meters->remaining.array, ¶meters->remaining.used, ¶meters->remaining.size); @@ -215,7 +215,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_string_dynamics_adjust(0, ¶meters->arguments); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) ¶meters->arguments.array, ¶meters->arguments.used, ¶meters->arguments.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; status = f_memory_array_adjust(0, sizeof(f_number_unsigned_t), (void **) ¶meters->remaining.array, ¶meters->remaining.used, ¶meters->remaining.size); diff --git a/level_0/f_console/c/console/common.h b/level_0/f_console/c/console/common.h index c9fb2ce..9ddcc62 100644 --- a/level_0/f_console/c/console/common.h +++ b/level_0/f_console/c/console/common.h @@ -854,10 +854,8 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_memory_array_resize(). - * Errors (with error bit) from: f_string_dynamics_adjust(). * * @see f_memory_array_resize() - * @see f_string_dynamics_adjust() */ #ifndef _di_f_console_parameters_delete_ extern f_status_t f_console_parameters_delete(f_console_parameters_t * const parameters); @@ -874,11 +872,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_array_resize(). - * Errors (with error bit) from: f_string_dynamics_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_memory_array_resize() - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_console_parameters_destroy_ extern f_status_t f_console_parameters_destroy(f_console_parameters_t * const parameters); diff --git a/level_0/f_conversion/c/conversion.h b/level_0/f_conversion/c/conversion.h index 4f2f1fa..76925b5 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -278,9 +278,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_conversion_number_signed_to_string_ extern f_status_t f_conversion_number_signed_to_string(const f_number_signed_t number, const f_conversion_data_t data, f_string_dynamic_t * const destination); @@ -343,9 +343,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_conversion_number_unsigned_to_string_ extern f_status_t f_conversion_number_unsigned_to_string(const f_number_unsigned_t number, const f_conversion_data_t data, f_string_dynamic_t * const destination); diff --git a/level_0/f_conversion/c/private-conversion.c b/level_0/f_conversion/c/private-conversion.c index 818ad3b..8af5055 100644 --- a/level_0/f_conversion/c/private-conversion.c +++ b/level_0/f_conversion/c/private-conversion.c @@ -306,7 +306,7 @@ extern "C" { max += data.width; } - const f_status_t status = f_string_dynamic_increase_by(max, destination); + const f_status_t status = f_memory_array_increase_by(max, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_conversion/c/private-conversion.h b/level_0/f_conversion/c/private-conversion.h index 30048d1..7a61550 100644 --- a/level_0/f_conversion/c/private-conversion.h +++ b/level_0/f_conversion/c/private-conversion.h @@ -159,7 +159,7 @@ extern "C" { * @return * F_okay on success. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see f_conversion_number_signed_to_string() * @see f_conversion_number_unsigned_to_string() diff --git a/level_0/f_directory/c/directory.c b/level_0/f_directory/c/directory.c index 3350ab0..c996b24 100644 --- a/level_0/f_directory/c/directory.c +++ b/level_0/f_directory/c/directory.c @@ -174,7 +174,7 @@ extern "C" { continue; } - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, names); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &names->array, &names->used, &names->size); if (F_status_is_error(status)) { for (; i < length; ++i) { @@ -186,7 +186,7 @@ extern "C" { names->array[names->used].used = 0; - status = f_string_dynamic_increase_by(size + 1, &names->array[names->used]); + status = f_memory_array_increase_by(size + 1, sizeof(f_char_t), (void **) &names->array[names->used].string, &names->array[names->used].used, &names->array[names->used].size); if (F_status_is_error(status)) { for (; i < length; ++i) { diff --git a/level_0/f_directory/c/directory/listing.c b/level_0/f_directory/c/directory/listing.c index 7810e39..71f78f8 100644 --- a/level_0/f_directory/c/directory/listing.c +++ b/level_0/f_directory/c/directory/listing.c @@ -11,28 +11,28 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - f_status_t status = f_string_dynamics_resize(0, &listing->block); + f_status_t status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing->block.array, &listing->block.used, &listing->block.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &listing->character); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing->character.array, &listing->character.used, &listing->character.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &listing->directory); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing->directory.array, &listing->directory.used, &listing->directory.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &listing->regular); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing->regular.array, &listing->regular.used, &listing->regular.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &listing->link); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing->link.array, &listing->link.used, &listing->link.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &listing->fifo); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing->fifo.array, &listing->fifo.used, &listing->fifo.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &listing->socket); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing->socket.array, &listing->socket.used, &listing->socket.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &listing->unknown); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing->unknown.array, &listing->unknown.used, &listing->unknown.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; } @@ -47,28 +47,28 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - f_status_t status = f_string_dynamics_adjust(0, &listing->block); + f_status_t status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &listing->block.array, &listing->block.used, &listing->block.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &listing->character); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &listing->character.array, &listing->character.used, &listing->character.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &listing->directory); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &listing->directory.array, &listing->directory.used, &listing->directory.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &listing->regular); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &listing->regular.array, &listing->regular.used, &listing->regular.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &listing->link); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &listing->link.array, &listing->link.used, &listing->link.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &listing->fifo); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &listing->fifo.array, &listing->fifo.used, &listing->fifo.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &listing->socket); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &listing->socket.array, &listing->socket.used, &listing->socket.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &listing->unknown); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &listing->unknown.array, &listing->unknown.used, &listing->unknown.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; } @@ -85,28 +85,28 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamics_resize(0, &array[i].block); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].block.array, &array[i].block.used, &array[i].block.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].character); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].character.array, &array[i].character.used, &array[i].character.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].directory); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].directory.array, &array[i].directory.used, &array[i].directory.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].regular); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].regular.array, &array[i].regular.used, &array[i].regular.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].link); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].link.array, &array[i].link.used, &array[i].link.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].fifo); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].fifo.array, &array[i].fifo.used, &array[i].fifo.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].socket); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].socket.array, &array[i].socket.used, &array[i].socket.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].unknown); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].unknown.array, &array[i].unknown.used, &array[i].unknown.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; } // for } @@ -124,28 +124,28 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamics_adjust(0, &array[i].block); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].block.array, &array[i].block.used, &array[i].block.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].character); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].character.array, &array[i].character.used, &array[i].character.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].directory); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].directory.array, &array[i].directory.used, &array[i].directory.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].regular); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].regular.array, &array[i].regular.used, &array[i].regular.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].link); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].link.array, &array[i].link.used, &array[i].link.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].fifo); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].fifo.array, &array[i].fifo.used, &array[i].fifo.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].socket); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].socket.array, &array[i].socket.used, &array[i].socket.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].unknown); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].unknown.array, &array[i].unknown.used, &array[i].unknown.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; } // for } @@ -166,28 +166,28 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamics_resize(0, &array[i].array[j].block); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].block.array, &array[i].array[j].block.used, &array[i].array[j].block.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].character); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].character.array, &array[i].array[j].character.used, &array[i].array[j].character.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].directory); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].directory.array, &array[i].array[j].directory.used, &array[i].array[j].directory.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].regular); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].regular.array, &array[i].array[j].regular.used, &array[i].array[j].regular.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].link); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].link.array, &array[i].array[j].link.used, &array[i].array[j].link.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].fifo); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].fifo.array, &array[i].array[j].fifo.used, &array[i].array[j].fifo.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].socket); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].socket.array, &array[i].array[j].socket.used, &array[i].array[j].socket.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].unknown); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].unknown.array, &array[i].array[j].unknown.used, &array[i].array[j].unknown.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; } // for @@ -214,28 +214,28 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamics_adjust(0, &array[i].array[j].block); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].block.array, &array[i].array[j].block.used, &array[i].array[j].block.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].character); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].character.array, &array[i].array[j].character.used, &array[i].array[j].character.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].directory); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].directory.array, &array[i].array[j].directory.used, &array[i].array[j].directory.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].regular); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].regular.array, &array[i].array[j].regular.used, &array[i].array[j].regular.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].link); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].link.array, &array[i].array[j].link.used, &array[i].array[j].link.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].fifo); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].fifo.array, &array[i].array[j].fifo.used, &array[i].array[j].fifo.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].socket); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].socket.array, &array[i].array[j].socket.used, &array[i].array[j].socket.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].unknown); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].unknown.array, &array[i].array[j].unknown.used, &array[i].array[j].unknown.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; } // for diff --git a/level_0/f_directory/c/directory/listing.h b/level_0/f_directory/c/directory/listing.h index 5ebdf2a..7362ca3 100644 --- a/level_0/f_directory/c/directory/listing.h +++ b/level_0/f_directory/c/directory/listing.h @@ -123,9 +123,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_directory_listing_delete_ extern f_status_t f_directory_listing_delete(f_directory_listing_t * const listing); @@ -142,9 +142,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_directory_listing_destroy_ extern f_status_t f_directory_listing_destroy(f_directory_listing_t * const listing); @@ -170,9 +170,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_directory_listings_delete_callback_ extern f_status_t f_directory_listings_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -198,9 +198,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_directory_listings_destroy_callback_ extern f_status_t f_directory_listings_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -226,9 +226,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_directory_listingss_delete_callback_ extern f_status_t f_directory_listingss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -254,9 +254,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_directory_listingss_destroy_callback_ extern f_status_t f_directory_listingss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_directory/c/directory/recurse_do.c b/level_0/f_directory/c/directory/recurse_do.c index 06ddac5..a236e51 100644 --- a/level_0/f_directory/c/directory/recurse_do.c +++ b/level_0/f_directory/c/directory/recurse_do.c @@ -11,34 +11,34 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - f_status_t status = f_string_dynamic_resize(0, &recurse->path); + f_status_t status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &recurse->path.string, &recurse->path.used, &recurse->path.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &recurse->path_cache); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &recurse->path_cache.string, &recurse->path_cache.used, &recurse->path_cache.size); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &recurse->listing.block); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.block.array, &recurse->listing.block.used, &recurse->listing.block.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &recurse->listing.character); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.character.array, &recurse->listing.character.used, &recurse->listing.character.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &recurse->listing.directory); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.directory.array, &recurse->listing.directory.used, &recurse->listing.directory.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &recurse->listing.regular); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.regular.array, &recurse->listing.regular.used, &recurse->listing.regular.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &recurse->listing.link); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.link.array, &recurse->listing.link.used, &recurse->listing.link.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &recurse->listing.fifo); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.fifo.array, &recurse->listing.fifo.used, &recurse->listing.fifo.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &recurse->listing.socket); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.socket.array, &recurse->listing.socket.used, &recurse->listing.socket.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &recurse->listing.unknown); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.unknown.array, &recurse->listing.unknown.used, &recurse->listing.unknown.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; } @@ -53,34 +53,34 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - f_status_t status = f_string_dynamic_adjust(0, &recurse->path); + f_status_t status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &recurse->path.string, &recurse->path.used, &recurse->path.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &recurse->path_cache); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &recurse->path_cache.string, &recurse->path_cache.used, &recurse->path_cache.size); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &recurse->listing.block); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.block.array, &recurse->listing.block.used, &recurse->listing.block.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &recurse->listing.character); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.character.array, &recurse->listing.character.used, &recurse->listing.character.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &recurse->listing.directory); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.directory.array, &recurse->listing.directory.used, &recurse->listing.directory.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &recurse->listing.regular); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.regular.array, &recurse->listing.regular.used, &recurse->listing.regular.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &recurse->listing.link); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.link.array, &recurse->listing.link.used, &recurse->listing.link.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &recurse->listing.fifo); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.fifo.array, &recurse->listing.fifo.used, &recurse->listing.fifo.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &recurse->listing.socket); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.socket.array, &recurse->listing.socket.used, &recurse->listing.socket.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &recurse->listing.unknown); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.unknown.array, &recurse->listing.unknown.used, &recurse->listing.unknown.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; } @@ -97,34 +97,34 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamic_resize(0, &array[i].path); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].path.string, &array[i].path.used, &array[i].path.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].path_cache); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].path_cache.string, &array[i].path_cache.used, &array[i].path_cache.size); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].listing.block); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.block.array, &array[i].listing.block.used, &array[i].listing.block.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].listing.character); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.character.array, &array[i].listing.character.used, &array[i].listing.character.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].listing.directory); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.directory.array, &array[i].listing.directory.used, &array[i].listing.directory.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].listing.regular); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.regular.array, &array[i].listing.regular.used, &array[i].listing.regular.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].listing.link); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.link.array, &array[i].listing.link.used, &array[i].listing.link.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].listing.fifo); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.fifo.array, &array[i].listing.fifo.used, &array[i].listing.fifo.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].listing.socket); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.socket.array, &array[i].listing.socket.used, &array[i].listing.socket.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].listing.unknown); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.unknown.array, &array[i].listing.unknown.used, &array[i].listing.unknown.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; } // for } @@ -142,34 +142,34 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamic_adjust(0, &array[i].path); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].path.string, &array[i].path.used, &array[i].path.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].path_cache); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].path_cache.string, &array[i].path_cache.used, &array[i].path_cache.size); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].listing.block); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.block.array, &array[i].listing.block.used, &array[i].listing.block.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].listing.character); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.character.array, &array[i].listing.character.used, &array[i].listing.character.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].listing.directory); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.directory.array, &array[i].listing.directory.used, &array[i].listing.directory.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].listing.regular); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.regular.array, &array[i].listing.regular.used, &array[i].listing.regular.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].listing.link); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.link.array, &array[i].listing.link.used, &array[i].listing.link.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].listing.fifo); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.fifo.array, &array[i].listing.fifo.used, &array[i].listing.fifo.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].listing.socket); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.socket.array, &array[i].listing.socket.used, &array[i].listing.socket.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].listing.unknown); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].listing.unknown.array, &array[i].listing.unknown.used, &array[i].listing.unknown.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; } // for } @@ -190,34 +190,34 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamic_resize(0, &array[i].array[j].path); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].path.string, &array[i].array[j].path.used, &array[i].array[j].path.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_resize(0, &array[i].array[j].path_cache); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].path_cache.string, &array[i].array[j].path_cache.used, &array[i].array[j].path_cache.size); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].listing.block); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.block.array, &array[i].array[j].listing.block.used, &array[i].array[j].listing.block.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].listing.character); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.character.array, &array[i].array[j].listing.character.used, &array[i].array[j].listing.character.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].listing.directory); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.directory.array, &array[i].array[j].listing.directory.used, &array[i].array[j].listing.directory.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].listing.regular); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.regular.array, &array[i].array[j].listing.regular.used, &array[i].array[j].listing.regular.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].listing.link); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.link.array, &array[i].array[j].listing.link.used, &array[i].array[j].listing.link.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].listing.fifo); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.fifo.array, &array[i].array[j].listing.fifo.used, &array[i].array[j].listing.fifo.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].listing.socket); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.socket.array, &array[i].array[j].listing.socket.used, &array[i].array[j].listing.socket.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_resize(0, &array[i].array[j].listing.unknown); + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.unknown.array, &array[i].array[j].listing.unknown.used, &array[i].array[j].listing.unknown.size, &f_string_dynamics_delete_callback); if (F_status_is_error(status)) return status; } // for @@ -244,34 +244,34 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamic_adjust(0, &array[i].array[j].path); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].path.string, &array[i].array[j].path.used, &array[i].array[j].path.size); if (F_status_is_error(status)) return status; - status = f_string_dynamic_adjust(0, &array[i].array[j].path_cache); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].path_cache.string, &array[i].array[j].path_cache.used, &array[i].array[j].path_cache.size); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].listing.block); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.block.array, &array[i].array[j].listing.block.used, &array[i].array[j].listing.block.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].listing.character); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.character.array, &array[i].array[j].listing.character.used, &array[i].array[j].listing.character.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].listing.directory); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.directory.array, &array[i].array[j].listing.directory.used, &array[i].array[j].listing.directory.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].listing.regular); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.regular.array, &array[i].array[j].listing.regular.used, &array[i].array[j].listing.regular.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].listing.link); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.link.array, &array[i].array[j].listing.link.used, &array[i].array[j].listing.link.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].listing.fifo); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.fifo.array, &array[i].array[j].listing.fifo.used, &array[i].array[j].listing.fifo.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].listing.socket); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.socket.array, &array[i].array[j].listing.socket.used, &array[i].array[j].listing.socket.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; - status = f_string_dynamics_adjust(0, &array[i].array[j].listing.unknown); + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].listing.unknown.array, &array[i].array[j].listing.unknown.used, &array[i].array[j].listing.unknown.size, &f_string_dynamics_destroy_callback); if (F_status_is_error(status)) return status; } // for diff --git a/level_0/f_directory/c/directory/recurse_do.h b/level_0/f_directory/c/directory/recurse_do.h index 811af12..30bd987 100644 --- a/level_0/f_directory/c/directory/recurse_do.h +++ b/level_0/f_directory/c/directory/recurse_do.h @@ -174,11 +174,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamics_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_directory_recurse_do_delete_ extern f_status_t f_directory_recurse_do_delete(f_directory_recurse_do_t * const recurse); @@ -195,11 +193,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). - * Errors (with error bit) from: f_string_dynamics_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_directory_recurse_do_destroy_ extern f_status_t f_directory_recurse_do_destroy(f_directory_recurse_do_t * const recurse); @@ -225,11 +221,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamics_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_directory_recurse_dos_delete_callback_ extern f_status_t f_directory_recurse_dos_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -255,11 +249,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). - * Errors (with error bit) from: f_string_dynamics_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_directory_recurse_dos_destroy_callback_ extern f_status_t f_directory_recurse_dos_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -285,11 +277,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamics_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_directory_recurse_doss_delete_callback_ extern f_status_t f_directory_recurse_doss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -315,11 +305,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). - * Errors (with error bit) from: f_string_dynamics_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_directory_recurse_doss_destroy_callback_ extern f_status_t f_directory_recurse_doss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_directory/c/directory/status.c b/level_0/f_directory/c/directory/status.c index 0dd3497..3138de3 100644 --- a/level_0/f_directory/c/directory/status.c +++ b/level_0/f_directory/c/directory/status.c @@ -11,7 +11,7 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - const f_status_t status = f_string_dynamic_resize(0, &directory_status->path); + const f_status_t status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &directory_status->path.string, &directory_status->path.used, &directory_status->path.size); if (F_status_is_error(status)) return status; } @@ -26,7 +26,7 @@ extern "C" { #endif // _di_level_0_parameter_checking_ { - const f_status_t status = f_string_dynamic_adjust(0, &directory_status->path); + const f_status_t status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &directory_status->path.string, &directory_status->path.used, &directory_status->path.size); if (F_status_is_error(status)) return status; } @@ -43,7 +43,7 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamic_resize(0, &array[i].path); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].path.string, &array[i].path.used, &array[i].path.size); if (F_status_is_error(status)) return status; } // for } @@ -61,7 +61,7 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamic_adjust(0, &array[i].path); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].path.string, &array[i].path.used, &array[i].path.size); if (F_status_is_error(status)) return status; } // for } @@ -82,7 +82,7 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamic_resize(0, &array[i].array[j].path); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].path.string, &array[i].array[j].path.used, &array[i].array[j].path.size); if (F_status_is_error(status)) return status; } // for @@ -109,7 +109,7 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamic_adjust(0, &array[i].array[j].path); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].path.string, &array[i].array[j].path.used, &array[i].array[j].path.size); if (F_status_is_error(status)) return status; } // for diff --git a/level_0/f_directory/c/directory/status.h b/level_0/f_directory/c/directory/status.h index cba3204..60d36a6 100644 --- a/level_0/f_directory/c/directory/status.h +++ b/level_0/f_directory/c/directory/status.h @@ -107,9 +107,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_directory_statuss_delete_callback_ extern f_status_t f_directory_statuss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -135,9 +135,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_directory_statuss_destroy_callback_ extern f_status_t f_directory_statuss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -163,9 +163,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_directory_statusss_delete_callback_ extern f_status_t f_directory_statusss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -191,9 +191,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_directory_statusss_destroy_callback_ extern f_status_t f_directory_statusss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_environment/c/environment.c b/level_0/f_environment/c/environment.c index 207d6d3..71e2b6e 100644 --- a/level_0/f_environment/c/environment.c +++ b/level_0/f_environment/c/environment.c @@ -52,8 +52,10 @@ extern char **environ; const f_number_unsigned_t size = strnlen(result, f_environment_max_length_d); if (size) { - const f_status_t status = f_string_dynamic_increase_by(size + 1, value); - if (F_status_is_error(status)) return status; + { + const f_status_t status = f_memory_array_increase_by(size + 1, sizeof(f_char_t), (void **) &value->string, &value->used, &value->size); + if (F_status_is_error(status)) return status; + } memcpy(value->string + value->used, result, sizeof(char) * size); @@ -61,8 +63,10 @@ extern char **environ; value->string[value->used] = 0; } else { - const f_status_t status = f_string_dynamic_increase_by(1, value); - if (F_status_is_error(status)) return status; + { + const f_status_t status = f_memory_array_increase_by(1, sizeof(f_char_t), (void **) &value->string, &value->used, &value->size); + if (F_status_is_error(status)) return status; + } value->string[0] = 0; value->used = 0; diff --git a/level_0/f_environment/c/environment.h b/level_0/f_environment/c/environment.h index 24f92a6..a9a9e55 100644 --- a/level_0/f_environment/c/environment.h +++ b/level_0/f_environment/c/environment.h @@ -92,11 +92,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see getenv() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_environment_get_ extern f_status_t f_environment_get(const f_string_static_t name, f_string_dynamic_t * const value); diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index e9724a9..6fabdd7 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -188,14 +188,14 @@ extern "C" { status = private_f_file_link_read(source, source_stat.st_size, &target); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &target); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &target.string, &target.used, &target.size); return status; } status = private_f_file_link(target, destination); - f_string_dynamic_resize(0, &target); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &target.string, &target.used, &target.size); if (F_status_is_error(status)) { if (F_status_set_fine(status) != F_file_found || flag & f_file_stat_flag_exclusive_e) { @@ -1495,8 +1495,10 @@ extern "C" { const f_number_unsigned_t size = strnlen(path_to_name, path.used); - const f_status_t status = f_string_dynamic_increase_by(size + 1, name_base); - if (F_status_is_error(status)) return status; + { + const f_status_t status = f_memory_array_increase_by(size + 1, sizeof(f_char_t), (void **) &name_base->string, &name_base->used, &name_base->size); + if (F_status_is_error(status)) return status; + } memcpy(name_base->string + name_base->used, path_to_name, sizeof(f_char_t) * size); name_base->used += size; @@ -1525,7 +1527,7 @@ extern "C" { const f_number_unsigned_t size = strnlen(path_to_name, path.used); { - const f_status_t status = f_string_dynamic_increase_by(size + 1, name_directory); + const f_status_t status = f_memory_array_increase_by(size + 1, sizeof(f_char_t), (void **) &name_directory->string, &name_directory->used, &name_directory->size); if (F_status_is_error(status)) return status; } @@ -1623,7 +1625,7 @@ extern "C" { ssize_t size_read = 0; do { - status = f_string_dynamic_increase_by(file.size_read, buffer); + status = f_memory_array_increase_by(file.size_read, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) return status; size_read = read(file.id, buffer->string + buffer->used, file.size_read); @@ -1660,7 +1662,7 @@ extern "C" { ssize_t size_read = 0; { - const f_status_t status = f_string_dynamic_increase_by(file.size_read, buffer); + const f_status_t status = f_memory_array_increase_by(file.size_read, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) return status; } @@ -1710,7 +1712,7 @@ extern "C" { buffer_size = total - buffer_count; } - status = f_string_dynamic_increase_by(buffer_size, buffer); + status = f_memory_array_increase_by(buffer_size, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) return status; size_read = read(file.id, buffer->string + buffer->used, buffer_size); diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index acdfa6c..a84f241 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -1012,14 +1012,14 @@ extern "C" { * F_string_too_large (with error bit) if link target path is too large for string buffer size. * F_failure (with error bit) for any other error. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * Errors (with error bit) from: f_string_dynamic_terminate_after() * * @see lstat() * @see readlink() * @see stat() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see f_string_dynamic_terminate_after() */ #ifndef _di_f_file_link_read_ @@ -1060,13 +1060,13 @@ extern "C" { * F_string_too_large (with error bit) if link target path is too large for string buffer size. * F_failure (with error bit) for any other error. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * Errors (with error bit) from: f_string_dynamic_terminate_after() * * @see fstatat() * @see readlinkat() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see f_string_dynamic_terminate_after() */ #ifndef _di_f_file_link_read_at_ @@ -1415,11 +1415,11 @@ extern "C" { * 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(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see basename() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_file_name_base_ extern f_status_t f_file_name_base(const f_string_static_t path, f_string_dynamic_t * const name_base); @@ -1446,12 +1446,12 @@ extern "C" { * 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(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_terminate_after(). * * @see dirname() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see f_string_dynamic_terminate_after() */ #ifndef _di_f_file_name_directory_ @@ -1628,11 +1628,11 @@ extern "C" { * F_interrupt (with error bit) if interrupt is received. * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see read() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_file_read_ extern f_status_t f_file_read(const f_file_t file, f_string_dynamic_t * const buffer); diff --git a/level_0/f_file/c/file/stream.c b/level_0/f_file/c/file/stream.c index 97746cc..471accd 100644 --- a/level_0/f_file/c/file/stream.c +++ b/level_0/f_file/c/file/stream.c @@ -203,7 +203,7 @@ extern "C" { size_t size_read = 0; do { - status = f_string_dynamic_increase_by(file.size_read, buffer); + status = f_memory_array_increase_by(file.size_read, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) { funlockfile(file.stream); @@ -253,7 +253,7 @@ extern "C" { } { - const f_status_t status = f_string_dynamic_increase_by(file.size_read, buffer); + const f_status_t status = f_memory_array_increase_by(file.size_read, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) { funlockfile(file.stream); @@ -311,7 +311,7 @@ extern "C" { } { - const f_status_t status = f_string_dynamic_increase_by(total, buffer); + const f_status_t status = f_memory_array_increase_by(total, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(status)) { funlockfile(file.stream); diff --git a/level_0/f_file/c/file/stream.h b/level_0/f_file/c/file/stream.h index 028fd3b..be5814d 100644 --- a/level_0/f_file/c/file/stream.h +++ b/level_0/f_file/c/file/stream.h @@ -307,7 +307,7 @@ extern "C" { * F_file_read (with error bit) on file read error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see feof_unlocked() * @see ferror_unlocked() @@ -315,7 +315,7 @@ extern "C" { * @see fread_unlocked() * @see funlockfile() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_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_number_unsigned_t total, f_string_dynamic_t * const buffer); diff --git a/level_0/f_file/c/private-file.c b/level_0/f_file/c/private-file.c index 815dea4..0805b39 100644 --- a/level_0/f_file/c/private-file.c +++ b/level_0/f_file/c/private-file.c @@ -314,7 +314,7 @@ extern "C" { target->used = 0; - f_status_t status = f_string_dynamic_increase_by(size + 1, target); + f_status_t status = f_memory_array_increase_by(size + 1, sizeof(f_char_t), (void **) &target->string, &target->used, &target->size); if (F_status_is_error(status)) return status; if (size) { @@ -347,7 +347,7 @@ extern "C" { target->used = 0; - f_status_t status = f_string_dynamic_increase_by(size + 1, target); + f_status_t status = f_memory_array_increase_by(size + 1, sizeof(f_char_t), (void **) &target->string, &target->used, &target->size); if (F_status_is_error(status)) return status; if (size) { diff --git a/level_0/f_file/c/private-file.h b/level_0/f_file/c/private-file.h index 8ebba9c..31cb84d 100644 --- a/level_0/f_file/c/private-file.h +++ b/level_0/f_file/c/private-file.h @@ -497,7 +497,7 @@ extern "C" { * * @see f_file_copy() * @see f_file_link_read() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see f_string_dynamic_terminate_after() */ #if !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) @@ -538,7 +538,7 @@ extern "C" { * @see readlinkat() * * @see f_file_link_read_at() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see f_string_dynamic_terminate_after() */ #if !defined(_di_f_file_link_read_at_) diff --git a/level_0/f_fss/c/fss/nest.h b/level_0/f_fss/c/fss/nest.h index 8a6b9ea..b04567e 100644 --- a/level_0/f_fss/c/fss/nest.h +++ b/level_0/f_fss/c/fss/nest.h @@ -152,9 +152,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_fss_nests_delete_callback_ extern f_status_t f_fss_nests_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -180,9 +180,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_fss_nests_destroy_callback_ extern f_status_t f_fss_nests_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -208,9 +208,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_fss_nestss_delete_callback_ extern f_status_t f_fss_nestss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -236,9 +236,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_fss_nestss_destroy_callback_ extern f_status_t f_fss_nestss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_fss/c/fss/set.h b/level_0/f_fss/c/fss/set.h index beae7bb..f011e78 100644 --- a/level_0/f_fss/c/fss/set.h +++ b/level_0/f_fss/c/fss/set.h @@ -151,9 +151,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_fss_sets_delete_callback_ extern f_status_t f_fss_sets_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -179,9 +179,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_fss_sets_destroy_callback_ extern f_status_t f_fss_sets_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -207,9 +207,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_fss_setss_delete_callback_ extern f_status_t f_fss_setss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -235,9 +235,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_fss_setss_destroy_callback_ extern f_status_t f_fss_setss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_fss/c/fss/simple_packet.c b/level_0/f_fss/c/fss/simple_packet.c index bf9e103..50de7b0 100644 --- a/level_0/f_fss/c/fss/simple_packet.c +++ b/level_0/f_fss/c/fss/simple_packet.c @@ -10,7 +10,7 @@ extern "C" { if (!packet) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - return f_string_dynamic_resize(0, &packet->payload); + return f_memory_array_resize(0, sizeof(f_char_t), (void **) &packet->payload.string, &packet->payload.used, &packet->payload.size); } #endif // _di_f_fss_simple_packet_delete_ @@ -20,7 +20,7 @@ extern "C" { if (!packet) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - return f_string_dynamic_adjust(0, &packet->payload); + return f_memory_array_adjust(0, sizeof(f_char_t), (void **) &packet->payload.string, &packet->payload.used, &packet->payload.size); } #endif // _di_f_fss_simple_packet_destroy_ @@ -85,7 +85,7 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamic_resize(0, &array[i].payload); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].payload.string, &array[i].payload.used, &array[i].payload.size); if (F_status_is_error(status)) return status; } // for } @@ -103,7 +103,7 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - status = f_string_dynamic_adjust(0, &array[i].payload); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].payload.string, &array[i].payload.used, &array[i].payload.size); if (F_status_is_error(status)) return status; } // for } @@ -124,7 +124,7 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamic_resize(0, &array[i].array[j].payload); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].payload.string, &array[i].array[j].payload.used, &array[i].array[j].payload.size); if (F_status_is_error(status)) return status; } // for @@ -151,7 +151,7 @@ extern "C" { for (j = 0; j < array[i].size; ++j) { - status = f_string_dynamic_adjust(0, &array[i].array[j].payload); + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].payload.string, &array[i].array[j].payload.used, &array[i].array[j].payload.size); if (F_status_is_error(status)) return status; } // for diff --git a/level_0/f_fss/c/fss/simple_packet.h b/level_0/f_fss/c/fss/simple_packet.h index 9293e68..33f6669 100644 --- a/level_0/f_fss/c/fss/simple_packet.h +++ b/level_0/f_fss/c/fss/simple_packet.h @@ -203,9 +203,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_fss_simple_packet_delete_ extern f_status_t f_fss_simple_packet_delete(f_fss_simple_packet_t * const packet); @@ -222,9 +222,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_fss_simple_packet_destroy_ extern f_status_t f_fss_simple_packet_destroy(f_fss_simple_packet_t * const packet); @@ -272,9 +272,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_fss_simple_packets_delete_callback_ extern f_status_t f_fss_simple_packets_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -300,9 +300,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_fss_simple_packets_destroy_callback_ extern f_status_t f_fss_simple_packets_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -328,9 +328,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_fss_simple_packetss_delete_callback_ extern f_status_t f_fss_simple_packetss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -356,9 +356,9 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_adjust(). + * Errors (with error bit) from: f_memory_array_adjust(). * - * @see f_string_dynamic_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_fss_simple_packetss_destroy_callback_ extern f_status_t f_fss_simple_packetss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_limit/c/limit/set.h b/level_0/f_limit/c/limit/set.h index 2205cae..29df683 100644 --- a/level_0/f_limit/c/limit/set.h +++ b/level_0/f_limit/c/limit/set.h @@ -102,9 +102,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_limit_setss_delete_callback_ extern f_status_t f_limit_setss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -130,9 +130,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_limit_setss_destroy_callback_ extern f_status_t f_limit_setss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_limit/c/limit/value.h b/level_0/f_limit/c/limit/value.h index afa0628..92a0000 100644 --- a/level_0/f_limit/c/limit/value.h +++ b/level_0/f_limit/c/limit/value.h @@ -98,9 +98,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_limit_valuess_delete_callback_ extern f_status_t f_limit_valuess_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -126,9 +126,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_limit_valuess_destroy_callback_ extern f_status_t f_limit_valuess_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_network/c/network.c b/level_0/f_network/c/network.c index fb1a172..7724647 100644 --- a/level_0/f_network/c/network.c +++ b/level_0/f_network/c/network.c @@ -455,7 +455,7 @@ extern "C" { if (!(from.type == f_network_family_ip_4_e || from.type == f_network_family_ip_6_e)) return F_data_not; { - const f_status_t status = f_string_dynamic_increase_by((from.type == f_network_family_ip_4_e ? INET_ADDRSTRLEN : INET6_ADDRSTRLEN) + 1, to); + const f_status_t status = f_memory_array_increase_by((from.type == f_network_family_ip_4_e ? INET_ADDRSTRLEN : INET6_ADDRSTRLEN) + 1, sizeof(f_char_t), (void **) &to->string, &to->used, &to->size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_network/c/network.h b/level_0/f_network/c/network.h index 8ce94e9..3368120 100644 --- a/level_0/f_network/c/network.h +++ b/level_0/f_network/c/network.h @@ -249,11 +249,11 @@ extern "C" { * F_support_not (with error bit) if an invalid address family type is passed to inet_ntop(). * F_failure (with error bit) on any other error. * - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * * @see inet_ntop() * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_f_network_to_ip_string_ extern f_status_t f_network_to_ip_string(const f_network_family_ip_t from, f_string_dynamic_t * const to); diff --git a/level_0/f_path/c/path.c b/level_0/f_path/c/path.c index 3d2a1e2..ea1be72 100644 --- a/level_0/f_path/c/path.c +++ b/level_0/f_path/c/path.c @@ -75,10 +75,10 @@ extern "C" { const f_number_unsigned_t length = strnlen(buffer, F_path_length_max_d); - { - path->used = 0; + path->used = 0; - const f_status_t status = f_string_dynamic_increase_by(length + 1, path); + { + const f_status_t status = f_memory_array_increase_by(length + 1, sizeof(f_char_t), (void **) &path->string, &path->used, &path->size); if (F_status_is_error(status)) return status; } @@ -104,12 +104,8 @@ extern "C" { } // Ensure enough space is available for terminating slash and terminating NULL. - if (argument.string[argument.used - 1] == f_path_separator_s.string[0]) { - const f_status_t status = f_string_dynamic_increase_by(argument.used + 1, directory); - if (F_status_is_error(status)) return status; - } - else { - const f_status_t status = f_string_dynamic_increase_by(argument.used + 2, directory); + { + const f_status_t status = f_memory_array_increase_by(argument.used + ((argument.string[argument.used - 1] == f_path_separator_s.string[0]) ? 1 : 2), sizeof(f_char_t), (void **) &directory->string, &directory->used, &directory->size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_path/c/private-path.c b/level_0/f_path/c/private-path.c index 648b851..15f19dc 100644 --- a/level_0/f_path/c/private-path.c +++ b/level_0/f_path/c/private-path.c @@ -30,10 +30,10 @@ extern "C" { const f_number_unsigned_t length = strnlen(buffer, F_path_length_max_d); - { - real->used = 0; + real->used = 0; - const f_status_t status = f_string_dynamic_increase_by(length + 1, real); + { + const f_status_t status = f_memory_array_increase_by(length + 1, sizeof(f_char_t), (void **) &real->string, &real->used, &real->size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_serialize/c/serialize.c b/level_0/f_serialize/c/serialize.c index fc6e47c..5259f62 100644 --- a/level_0/f_serialize/c/serialize.c +++ b/level_0/f_serialize/c/serialize.c @@ -25,7 +25,7 @@ extern "C" { if (i + width > source.used) { total = i - start; - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, destination); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; destination->array[destination->used].used = 0; @@ -41,7 +41,7 @@ extern "C" { if (source.string[i] == f_serialize_to_simple_splitter_s.string[0]) { total = i - start; - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, destination); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; destination->array[destination->used].used = 0; @@ -54,7 +54,7 @@ extern "C" { // Handle case when splitter as at the end of the string, creating a new empty string. if (start == source.used) { - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, destination); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; destination->array[++destination->used].used = 0; @@ -68,7 +68,7 @@ extern "C" { if (start < source.used) { total = source.used - start; - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, destination); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; destination->array[destination->used].used = 0; diff --git a/level_0/f_serialize/c/serialize.h b/level_0/f_serialize/c/serialize.h index 4181642..75f418a 100644 --- a/level_0/f_serialize/c/serialize.h +++ b/level_0/f_serialize/c/serialize.h @@ -53,11 +53,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * + * Errors (with error bit) from: f_memory_array_increase_by(); * Errors (with error bit) from: f_string_append(); - * Errors (with error bit) from: f_string_dynamics_increase_by(); * + * @see f_memory_array_increase_by() * @see f_string_append() - * @see f_string_dynamics_increase_by() */ #ifndef _di_f_serialize_from_simple_ extern f_status_t f_serialize_from_simple(const f_string_static_t source, f_string_dynamics_t * const destination); diff --git a/level_0/f_socket/c/socket.c b/level_0/f_socket/c/socket.c index 9f9f4ac..8a12998 100644 --- a/level_0/f_socket/c/socket.c +++ b/level_0/f_socket/c/socket.c @@ -380,7 +380,7 @@ extern "C" { #endif // _di_level_0_parameter_checking_ if (!name->size) { - const f_status_t status = f_string_dynamic_resize(F_socket_default_name_max_d, name); + const f_status_t status = f_memory_array_resize(F_socket_default_name_max_d, sizeof(f_char_t), (void **) &name->string, &name->used, &name->size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_socket/c/socket.h b/level_0/f_socket/c/socket.h index 296697e..f8bf5c3 100644 --- a/level_0/f_socket/c/socket.h +++ b/level_0/f_socket/c/socket.h @@ -512,11 +512,11 @@ extern "C" { * * F_failure (with error bit) for any other error. * - * Errors (with error bit) from: f_string_dynamic_resize() + * Errors (with error bit) from: f_memory_array_resize() * * @see gethostname() * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_socket_name_host_ extern f_status_t f_socket_name_host(f_socket_t * const socket, f_string_dynamic_t * const name); diff --git a/level_0/f_socket/c/socket/address.h b/level_0/f_socket/c/socket/address.h index 29215a1..bc5a071 100644 --- a/level_0/f_socket/c/socket/address.h +++ b/level_0/f_socket/c/socket/address.h @@ -162,9 +162,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_socket_addressss_delete_callback_ extern f_status_t f_socket_addressss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -190,9 +190,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_socket_addressss_destroy_callback_ extern f_status_t f_socket_addressss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_socket/c/socket/socket.h b/level_0/f_socket/c/socket/socket.h index d2eab43..692f90d 100644 --- a/level_0/f_socket/c/socket/socket.h +++ b/level_0/f_socket/c/socket/socket.h @@ -207,9 +207,9 @@ extern "C" { * * 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_memory_array_resize(). * - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() */ #ifndef _di_f_socketss_delete_callback_ extern f_status_t f_socketss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); @@ -235,9 +235,9 @@ extern "C" { * * 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_memory_array_adjust(). * - * @see f_string_dynamics_adjust() + * @see f_memory_array_adjust() */ #ifndef _di_f_socketss_destroy_callback_ extern f_status_t f_socketss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); diff --git a/level_0/f_string/c/string/common.h b/level_0/f_string/c/string/common.h index 0eb0ccc..b8f9b27 100644 --- a/level_0/f_string/c/string/common.h +++ b/level_0/f_string/c/string/common.h @@ -62,9 +62,6 @@ extern "C" { #define macro_f_string_t_resize(status, string, length_old, length_new) status = f_memory_resize(length_old, length_new, 1, (void **) & string); #define macro_f_string_t_adjust(status, string, length_old, length_new) status = f_memory_adjust(length_old, length_new, 1, (void **) & string); - #define macro_f_string_t_delete_simple(string, length) f_memory_resize(length, 0, 1, (void **) & string); - #define macro_f_string_t_destroy_simple(string, length) f_memory_adjust(length, 0, 1, (void **) & string); - #define F_string_t_size_d F_number_t_size_positive_d #endif // _di_f_string_t_ diff --git a/level_0/f_string/c/string/dynamic.c b/level_0/f_string/c/string/dynamic.c index 4d2f457..41e8777 100644 --- a/level_0/f_string/c/string/dynamic.c +++ b/level_0/f_string/c/string/dynamic.c @@ -5,16 +5,6 @@ extern "C" { #endif -#ifndef _di_f_string_dynamic_adjust_ - f_status_t f_string_dynamic_adjust(const f_number_unsigned_t length, f_string_dynamic_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return f_memory_array_adjust(length, sizeof(f_char_t), (void **) &structure->string, &structure->used, &structure->size); - } -#endif // _di_f_string_dynamic_adjust_ - #ifndef _di_f_string_dynamic_append_ f_status_t f_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -103,46 +93,6 @@ extern "C" { } #endif // _di_f_string_dynamic_append_nulless_ -#ifndef _di_f_string_dynamic_decimate_by_ - f_status_t f_string_dynamic_decimate_by(const f_number_unsigned_t amount, f_string_dynamic_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return f_memory_array_decimate_by(amount, sizeof(f_char_t), (void **) &structure->string, &structure->used, &structure->size); - } -#endif // _di_f_string_dynamic_decimate_by_ - -#ifndef _di_f_string_dynamic_decrease_by_ - f_status_t f_string_dynamic_decrease_by(const f_number_unsigned_t amount, f_string_dynamic_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return f_memory_array_decrease_by(amount, sizeof(f_char_t), (void **) &structure->string, &structure->used, &structure->size); - } -#endif // _di_f_string_dynamic_decrease_by_ - -#ifndef _di_f_string_dynamic_increase_ - f_status_t f_string_dynamic_increase(const f_number_unsigned_t step, f_string_dynamic_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return f_memory_array_increase(step, sizeof(f_char_t), (void **) &structure->string, &structure->used, &structure->size); - } -#endif // _di_f_string_dynamic_increase_ - -#ifndef _di_f_string_dynamic_increase_by_ - f_status_t f_string_dynamic_increase_by(const f_number_unsigned_t amount, f_string_dynamic_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return f_memory_array_increase_by(amount, sizeof(f_char_t), (void **) &structure->string, &structure->used, &structure->size); - } -#endif // _di_f_string_dynamic_increase_by_ - #ifndef _di_f_string_dynamic_mash_ f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -607,16 +557,6 @@ extern "C" { } #endif // _di_f_string_dynamic_prepend_nulless_ -#ifndef _di_f_string_dynamic_resize_ - f_status_t f_string_dynamic_resize(const f_number_unsigned_t length, f_string_dynamic_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return f_memory_array_resize(length, sizeof(f_char_t), (void **) &structure->string, &structure->used, &structure->size); - } -#endif // _di_f_string_dynamic_resize_ - #ifndef _di_f_string_dynamic_seek_line_ f_status_t f_string_dynamic_seek_line(const f_string_static_t structure, f_string_range_t * const range) { #ifndef _di_level_0_parameter_checking_ diff --git a/level_0/f_string/c/string/dynamic.h b/level_0/f_string/c/string/dynamic.h index 6d660b8..bc02c3e 100644 --- a/level_0/f_string/c/string/dynamic.h +++ b/level_0/f_string/c/string/dynamic.h @@ -39,38 +39,9 @@ extern "C" { #define macro_f_string_dynamic_t_initialize_2(array, length) { array, length, length } #define macro_f_string_dynamic_t_clear(dynamic) macro_f_string_static_t_clear(dynamic) - - #define macro_f_string_dynamic_t_resize(status, dynamic, length) status = f_string_dynamic_resize(length, &dynamic); - #define macro_f_string_dynamic_t_adjust(status, dynamic, length) status = f_string_dynamic_adjust(length, &dynamic); - - #define macro_f_string_dynamic_t_delete_simple(dynamic) f_string_dynamic_resize(0, &dynamic); - #define macro_f_string_dynamic_t_destroy_simple(dynamic) f_string_dynamic_adjust(0, &dynamic); - - #define macro_f_string_dynamic_t_increase(status, step, dynamic) status = f_string_dynamic_increase(step, &dynamic); - #define macro_f_string_dynamic_t_increase_by(status, dynamic, amount) status = f_string_dynamic_increase_by(amount, &dynamic); - #define macro_f_string_dynamic_t_decrease_by(status, dynamic, amount) status = f_string_dynamic_decrease_by(amount, &dynamic); - #define macro_f_string_dynamic_t_decimate_by(status, dynamic, amount) status = f_string_dynamic_decimate_by(amount, &dynamic); #endif // _di_f_string_dynamic_t_ /** - * Resize the dynamic string. - * - * @param length - * The new size to use. - * @param structure - * The string to resize. - * - * @return - * F_okay on success. - * - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_string_dynamic_adjust_ - extern f_status_t f_string_dynamic_adjust(const f_number_unsigned_t length, f_string_dynamic_t * const structure); -#endif // _di_f_string_dynamic_adjust_ - -/** * Append the source string onto the destination. * * @param source @@ -159,107 +130,6 @@ extern "C" { #endif // _di_f_string_dynamic_append_nulless_ /** - * Resize the dynamic string to a smaller size. - * - * This will resize making the string smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not if amount is 0. - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamic_decimate_by_ - extern f_status_t f_string_dynamic_decimate_by(const f_number_unsigned_t amount, f_string_dynamic_t * const structure); -#endif // _di_f_string_dynamic_decimate_by_ - -/** - * Resize the dynamic string to a smaller size. - * - * This will resize making the string smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not if amount is 0. - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamic_decrease_by_ - extern f_status_t f_string_dynamic_decrease_by(const f_number_unsigned_t amount, f_string_dynamic_t * const structure); -#endif // _di_f_string_dynamic_decrease_by_ - -/** - * Resize the dynamic string to a larger size. - * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size) (or step is 0). - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamic_increase_ - extern f_status_t f_string_dynamic_increase(const f_number_unsigned_t step, f_string_dynamic_t * const structure); -#endif // _di_f_string_dynamic_increase_ - -/** - * Resize the dynamic string to a larger size. - * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamic_increase_by_ - extern f_status_t f_string_dynamic_increase_by(const f_number_unsigned_t amount, f_string_dynamic_t * const structure); -#endif // _di_f_string_dynamic_increase_by_ - -/** * Append the source string onto the destination with the glue in between. * * If the destination string is empty, then no glue is appended. @@ -796,25 +666,6 @@ extern "C" { #endif // _di_f_string_dynamic_prepend_nulless_ /** - * Resize the dynamic string. - * - * @param length - * The new size to use. - * @param structure - * The string to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamic_resize_ - extern f_status_t f_string_dynamic_resize(const f_number_unsigned_t length, f_string_dynamic_t * const structure); -#endif // _di_f_string_dynamic_resize_ - -/** * Seek the buffer location forward until EOL is reached. * * @param structure diff --git a/level_0/f_string/c/string/dynamics.c b/level_0/f_string/c/string/dynamics.c index 58e2ea0..6bcb579 100644 --- a/level_0/f_string/c/string/dynamics.c +++ b/level_0/f_string/c/string/dynamics.c @@ -6,16 +6,6 @@ extern "C" { #endif -#ifndef _di_f_string_dynamics_adjust_ - f_status_t f_string_dynamics_adjust(const f_number_unsigned_t length, f_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_dynamics_adjust(length, structure); - } -#endif // _di_f_string_dynamics_adjust_ - #ifndef _di_f_string_dynamics_append_ f_status_t f_string_dynamics_append(const f_string_dynamic_t source, f_string_dynamics_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -40,85 +30,45 @@ extern "C" { } #endif // _di_f_string_dynamics_append_all_ -#ifndef _di_f_string_dynamics_decimate_by_ - f_status_t f_string_dynamics_decimate_by(const f_number_unsigned_t amount, f_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_string_dynamics_delete_callback_ + f_status_t f_string_dynamics_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_string_dynamic_t * const array = (f_string_dynamic_t *) void_array; + f_status_t status = F_okay; - return private_f_string_dynamics_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_string_dynamics_decimate_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_string_dynamics_decrease_by_ - f_status_t f_string_dynamics_decrease_by(const f_number_unsigned_t amount, f_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; - - return private_f_string_dynamics_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_string_dynamics_decrease_by_ - -#ifndef _di_f_string_dynamics_increase_ - f_status_t f_string_dynamics_increase(const f_number_unsigned_t step, f_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!step) return F_data_not; - - if (structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; - - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); - - length = F_number_t_size_unsigned_d; - } - - return private_f_string_dynamics_resize(length, structure); + if (array[i].size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].string, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_string_dynamics_increase_ - -#ifndef _di_f_string_dynamics_increase_by_ - f_status_t f_string_dynamics_increase_by(const f_number_unsigned_t amount, f_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#endif // _di_f_string_dynamics_delete_callback_ - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); +#ifndef _di_f_string_dynamics_destroy_callback_ + f_status_t f_string_dynamics_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - const f_number_unsigned_t length = structure->used + amount; + { + f_string_dynamic_t * const array = (f_string_dynamic_t *) void_array; + f_status_t status = F_okay; - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + for (f_number_unsigned_t i = start; i < stop; ++i) { - return private_f_string_dynamics_resize(structure->used + amount, structure); - } + if (array[i].size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].string, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; - } -#endif // _di_f_string_dynamics_increase_by_ - -#ifndef _di_f_string_dynamics_resize_ - f_status_t f_string_dynamics_resize(const f_number_unsigned_t length, f_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_dynamics_resize(length, structure); + return F_okay; } -#endif // _di_f_string_dynamics_resize_ +#endif // _di_f_string_dynamics_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string/dynamics.h b/level_0/f_string/c/string/dynamics.h index 86f328d..5a84429 100644 --- a/level_0/f_string/c/string/dynamics.h +++ b/level_0/f_string/c/string/dynamics.h @@ -32,39 +32,9 @@ extern "C" { #define macro_f_string_dynamics_t_initialize_2(array, length) { array, length, length } #define macro_f_string_dynamics_t_clear(dynamics) macro_f_string_statics_t_clear(dynamics) - - #define macro_f_string_dynamics_t_resize(status, dynamics, length) status = f_string_dynamics_resize(length, &dynamics); - #define macro_f_string_dynamics_t_adjust(status, dynamics, length) status = f_string_dynamics_adjust(length, &dynamics); - - #define macro_f_string_dynamics_t_delete_simple(dynamics) f_string_dynamics_resize(0, &dynamics); - #define macro_f_string_dynamics_t_destroy_simple(dynamics) f_string_dynamics_adjust(0, &dynamics); - - #define macro_f_string_dynamics_t_increase(status, step, dynamics) status = f_string_dynamics_increase(step, &dynamics); - #define macro_f_string_dynamics_t_increase_by(status, dynamics, amount) status = f_string_dynamics_increase_by(amount, &dynamics); - #define macro_f_string_dynamics_t_decrease_by(status, dynamics, amount) status = f_string_dynamics_decrease_by(amount, &dynamics); - #define macro_f_string_dynamics_t_decimate_by(status, dynamics, amount) status = f_string_dynamics_decimate_by(amount, &dynamics); #endif // _di_f_string_dynamics_t_ /** - * Resize the dynamic string array. - * - * @param length - * The new size to use. - * @param structure - * The array to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_adjust(). - */ -#ifndef _di_f_string_dynamics_adjust_ - extern f_status_t f_string_dynamics_adjust(const f_number_unsigned_t length, f_string_dynamics_t * const structure); -#endif // _di_f_string_dynamics_adjust_ - -/** * Append the single source string onto the destination. * * @param source @@ -107,121 +77,60 @@ extern "C" { #endif // _di_f_string_dynamics_append_all_ /** - * Resize the dynamic string array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The array to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0). + * A callback intended to be passed to f_memory_arrays_resize() for an f_string_dynamics_t structure. * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamics_decimate_by_ - extern f_status_t f_string_dynamics_decimate_by(const f_number_unsigned_t amount, f_string_dynamics_t * const structure); -#endif // _di_f_string_dynamics_decimate_by_ - -/** - * Resize the dynamic string array to a smaller size. + * This is only called when shrinking the array and generally should perform deallocations. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not do parameter checking. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. - * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0). * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamics_decrease_by_ - extern f_status_t f_string_dynamics_decrease_by(const f_number_unsigned_t amount, f_string_dynamics_t * const structure); -#endif // _di_f_string_dynamics_decrease_by_ - -/** - * Increase the size of the dynamic string array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The array to resize. + * Errors (with error bit) from: f_memory_array_resize(). * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_string_dynamics_increase_ - extern f_status_t f_string_dynamics_increase(const f_number_unsigned_t step, f_string_dynamics_t * const structure); -#endif // _di_f_string_dynamics_increase_ +#ifndef _di_f_string_dynamics_delete_callback_ + extern f_status_t f_string_dynamics_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_string_dynamics_delete_callback_ /** - * Resize the dynamic string array to a larger size. + * A callback intended to be passed to f_memory_arrays_adjust() for an f_string_dynamics_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamics_increase_by_ - extern f_status_t f_string_dynamics_increase_by(const f_number_unsigned_t amount, f_string_dynamics_t * const structure); -#endif // _di_f_string_dynamics_increase_by_ - -/** - * Resize the dynamic string array. - * - * @param length - * The new size to use. - * @param structure - * The array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_string_dynamics_resize_ - extern f_status_t f_string_dynamics_resize(const f_number_unsigned_t length, f_string_dynamics_t * const structure); -#endif // _di_f_string_dynamics_resize_ +#ifndef _di_f_string_dynamics_destroy_callback_ + extern f_status_t f_string_dynamics_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_string_dynamics_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string/dynamicss.c b/level_0/f_string/c/string/dynamicss.c index d6a447f..870872b 100644 --- a/level_0/f_string/c/string/dynamicss.c +++ b/level_0/f_string/c/string/dynamicss.c @@ -1,22 +1,11 @@ #include "../string.h" #include "../private-string.h" #include "private-dynamics.h" -#include "private-dynamicss.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_f_string_dynamicss_adjust_ - f_status_t f_string_dynamicss_adjust(const f_number_unsigned_t length, f_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_dynamicss_adjust(length, structure); - } -#endif // _di_f_string_dynamicss_adjust_ - #ifndef _di_f_string_dynamicss_append_ f_status_t f_string_dynamicss_append(const f_string_dynamics_t source, f_string_dynamicss_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -25,18 +14,16 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_string_dynamicss_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamics_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.used) { - status = private_f_string_dynamics_append_all(source, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; + if (source.used) { + status = private_f_string_dynamics_append_all(source, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -53,106 +40,82 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_string_dynamicss_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_dynamics_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.array[i].used) { - status = private_f_string_dynamics_append_all(source.array[i], &destination->array[destination->used]); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].used) { + status = private_f_string_dynamics_append_all(source.array[i], &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // _di_f_string_dynamicss_append_all_ -#ifndef _di_f_string_dynamicss_decimate_by_ - f_status_t f_string_dynamicss_decimate_by(const f_number_unsigned_t amount, f_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_string_dynamicss_delete_callback_ + f_status_t f_string_dynamicss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_string_dynamics_t * const array = (f_string_dynamics_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - return private_f_string_dynamicss_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_string_dynamicss_decimate_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_string_dynamicss_decrease_by_ - f_status_t f_string_dynamicss_decrease_by(const f_number_unsigned_t amount, f_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].size) { + for (j = 0; j < array[i].size; ++j) { - if (!amount) return F_data_not; + if (array[i].array[j].size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].string, &array[i].array[j].used, &array[i].array[j].size); + if (F_status_is_error(status)) return status; + } - return private_f_string_dynamicss_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_string_dynamicss_decrease_by_ - -#ifndef _di_f_string_dynamicss_increase_ - f_status_t f_string_dynamicss_increase(const f_number_unsigned_t step, f_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!step) return F_data_not; - - if (structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; - - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); - - length = F_number_t_size_unsigned_d; - } - - return private_f_string_dynamicss_resize(length, structure); + status = f_memory_array_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } // for + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_string_dynamicss_increase_ +#endif // _di_f_string_dynamicss_delete_callback_ -#ifndef _di_f_string_dynamicss_increase_by_ - f_status_t f_string_dynamicss_increase_by(const f_number_unsigned_t amount, f_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); +#ifndef _di_f_string_dynamicss_destroy_callback_ + f_status_t f_string_dynamicss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - const f_number_unsigned_t length = structure->used + amount; + { + f_string_dynamics_t * const array = (f_string_dynamics_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + for (f_number_unsigned_t i = start; i < stop; ++i) { - return private_f_string_dynamicss_resize(structure->used + amount, structure); - } - } + if (array[i].size) { + for (j = 0; j < array[i].size; ++j) { - return F_data_not; - } -#endif // _di_f_string_dynamicss_increase_by_ + if (array[i].array[j].size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].string, &array[i].array[j].used, &array[i].array[j].size); + if (F_status_is_error(status)) return status; + } -#ifndef _di_f_string_dynamicss_resize_ - f_status_t f_string_dynamicss_resize(const f_number_unsigned_t length, f_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + status = f_memory_array_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } // for + } + } // for + } - return private_f_string_dynamicss_resize(length, structure); + return F_okay; } -#endif // _di_f_string_dynamicss_resize_ +#endif // _di_f_string_dynamicss_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string/dynamicss.h b/level_0/f_string/c/string/dynamicss.h index a228a86..5540c03 100644 --- a/level_0/f_string/c/string/dynamicss.h +++ b/level_0/f_string/c/string/dynamicss.h @@ -32,39 +32,9 @@ extern "C" { #define macro_f_string_dynamicss_t_initialize_2(array, length) { array, length, length } #define macro_f_string_dynamicss_t_clear(dynamicss) macro_f_string_staticss_t_clear(dynamicss) - - #define macro_f_string_dynamicss_t_resize(status, dynamicss, length) status = f_string_dynamicss_resize(length, &dynamicss); - #define macro_f_string_dynamicss_t_adjust(status, dynamicss, length) status = f_string_dynamicss_adjust(length, &dynamicss); - - #define macro_f_string_dynamicss_t_delete_simple(dynamicss) f_string_dynamicss_resize(0, &dynamicss); - #define macro_f_string_dynamicss_t_destroy_simple(dynamicss) f_string_dynamicss_adjust(0, &dynamicss); - - #define macro_f_string_dynamicss_t_increase(status, step, dynamicss) status = f_string_dynamicss_increase(step, &dynamicss); - #define macro_f_string_dynamicss_t_increase_by(status, dynamicss, amount) status = f_string_dynamicss_increase_by(amount, &dynamicss); - #define macro_f_string_dynamicss_t_decrease_by(status, dynamicss, amount) status = f_string_dynamicss_decrease_by(amount, &dynamicss); - #define macro_f_string_dynamicss_t_decimate_by(status, dynamicss, amount) status = f_string_dynamicss_decimate_by(amount, &dynamicss); #endif // _di_f_string_dynamicss_t_ /** - * Resize the dynamics string array. - * - * @param length - * The new size to use. - * @param structure - * The array to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_adjust(). - */ -#ifndef _di_f_string_dynamicss_adjust_ - extern f_status_t f_string_dynamicss_adjust(const f_number_unsigned_t length, f_string_dynamicss_t * const structure); -#endif // _di_f_string_dynamicss_adjust_ - -/** * Append the single source string onto the destination. * * @param source @@ -107,121 +77,60 @@ extern "C" { #endif // _di_f_string_dynamicss_append_all_ /** - * Resize the dynamics string array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The array to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0). + * A callback intended to be passed to f_memory_arrayss_resize() for an f_string_dynamicss_t structure. * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamicss_decimate_by_ - extern f_status_t f_string_dynamicss_decimate_by(const f_number_unsigned_t amount, f_string_dynamicss_t * const structure); -#endif // _di_f_string_dynamicss_decimate_by_ - -/** - * Resize the dynamics string array to a smaller size. + * This is only called when shrinking the array and generally should perform deallocations. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not do parameter checking. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. - * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0). * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamicss_decrease_by_ - extern f_status_t f_string_dynamicss_decrease_by(const f_number_unsigned_t amount, f_string_dynamicss_t * const structure); -#endif // _di_f_string_dynamicss_decrease_by_ - -/** - * Increase the size of the dynamics string array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The array to resize. + * Errors (with error bit) from: f_memory_array_resize(). * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_string_dynamicss_increase_ - extern f_status_t f_string_dynamicss_increase(const f_number_unsigned_t step, f_string_dynamicss_t * const structure); -#endif // _di_f_string_dynamicss_increase_ +#ifndef _di_f_string_dynamicss_delete_callback_ + extern f_status_t f_string_dynamicss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_string_dynamicss_delete_callback_ /** - * Resize the dynamics string array to a larger size. + * A callback intended to be passed to f_memory_arrayss_adjust() for an f_string_dynamicss_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_dynamicss_increase_by_ - extern f_status_t f_string_dynamicss_increase_by(const f_number_unsigned_t amount, f_string_dynamicss_t * const structure); -#endif // _di_f_string_dynamicss_increase_by_ - -/** - * Resize the dynamics string array. - * - * @param length - * The new size to use. - * @param structure - * The array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_string_dynamicss_resize_ - extern f_status_t f_string_dynamicss_resize(const f_number_unsigned_t length, f_string_dynamicss_t * const structure); -#endif // _di_f_string_dynamicss_resize_ +#ifndef _di_f_string_dynamicss_destroy_callback_ + extern f_status_t f_string_dynamicss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_string_dynamicss_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string/map.h b/level_0/f_string/c/string/map.h index dbc0502..1f38bd3 100644 --- a/level_0/f_string/c/string/map.h +++ b/level_0/f_string/c/string/map.h @@ -36,14 +36,6 @@ extern "C" { #define macro_f_string_map_t_clear(map) \ macro_f_string_dynamic_t_clear(map.name) \ macro_f_string_dynamic_t_clear(map.value) - - #define macro_f_string_map_t_delete_simple(map) \ - macro_f_string_dynamic_t_delete_simple(map.name) \ - macro_f_string_dynamic_t_delete_simple(map.value) - - #define macro_f_string_map_t_destroy_simple(map) \ - macro_f_string_dynamic_t_destroy_simple(map.name) \ - macro_f_string_dynamic_t_destroy_simple(map.value) #endif // _di_f_string_map_t_ #ifdef __cplusplus diff --git a/level_0/f_string/c/string/map_multi.h b/level_0/f_string/c/string/map_multi.h index 4876c58..f255e16 100644 --- a/level_0/f_string/c/string/map_multi.h +++ b/level_0/f_string/c/string/map_multi.h @@ -36,14 +36,6 @@ extern "C" { #define macro_f_string_map_multi_t_clear(map) \ macro_f_string_dynamic_t_clear(map.name) \ macro_f_string_dynamics_t_clear(map.value) - - #define macro_f_string_map_multi_t_delete_simple(map) \ - macro_f_string_dynamic_t_delete_simple(map.name) \ - macro_f_string_dynamics_t_delete_simple(map.value) - - #define macro_f_string_map_multi_t_destroy_simple(map) \ - macro_f_string_dynamic_t_destroy_simple(map.name) \ - macro_f_string_dynamics_t_destroy_simple(map.value) #endif // _di_f_string_map_multi_t_ #ifdef __cplusplus diff --git a/level_0/f_string/c/string/map_multis.h b/level_0/f_string/c/string/map_multis.h index 2b5147b..5aafdb4 100644 --- a/level_0/f_string/c/string/map_multis.h +++ b/level_0/f_string/c/string/map_multis.h @@ -37,16 +37,10 @@ extern "C" { #define macro_f_string_map_multis_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_map_multis_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_map_multis_t_resize(status, map_multis, length) status = f_string_map_multis_resize(length, &map_multis); - #define macro_f_string_map_multis_t_adjust(status, map_multis, length) status = f_string_map_multis_adjust(length, &map_multis); - - #define macro_f_string_map_multis_t_delete_simple(map_multis) f_string_map_multis_resize(0, &map_multis); - #define macro_f_string_map_multis_t_destroy_simple(map_multis) f_string_map_multis_adjust(0, &map_multis); - - #define macro_f_string_map_multis_t_increase(status, step, map_multis) status = f_string_map_multis_increase(step, &map_multis); - #define macro_f_string_map_multis_t_increase_by(status, map_multis, amount) status = f_string_map_multis_increase_by(amount, &map_multis); - #define macro_f_string_map_multis_t_decrease_by(status, map_multis, amount) status = f_string_map_multis_decrease_by(amount, &map_multis); - #define macro_f_string_map_multis_t_decimate_by(status, map_multis, amount) status = f_string_map_multis_decimate_by(amount, &map_multis); + #define macro_f_string_map_multis_t_clear(map_multis) \ + map_multis.array = 0; \ + map_multis.size = 0; \ + map_multis.used = 0; #endif // _di_f_string_map_multis_t_ /** diff --git a/level_0/f_string/c/string/map_multiss.h b/level_0/f_string/c/string/map_multiss.h index 01110a4..58194c5 100644 --- a/level_0/f_string/c/string/map_multiss.h +++ b/level_0/f_string/c/string/map_multiss.h @@ -37,16 +37,10 @@ extern "C" { #define macro_f_string_map_multiss_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_map_multiss_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_map_multiss_t_resize(status, map_multis, length) status = f_string_map_multiss_resize(length, &map_multis); - #define macro_f_string_map_multiss_t_adjust(status, map_multis, length) status = f_string_map_multiss_adjust(length, &map_multis); - - #define macro_f_string_map_multiss_t_delete_simple(map_multis) f_string_map_multiss_resize(0, &map_multis); - #define macro_f_string_map_multiss_t_destroy_simple(map_multis) f_string_map_multiss_adjust(0, &map_multis); - - #define macro_f_string_map_multiss_t_increase(status, step, map_multis) status = f_string_map_multiss_increase(step, &map_multis); - #define macro_f_string_map_multiss_t_increase_by(status, map_multis, amount) status = f_string_map_multiss_increase_by(amount, &map_multis); - #define macro_f_string_map_multiss_t_decrease_by(status, map_multis, amount) status = f_string_map_multiss_decrease_by(amount, &map_multis); - #define macro_f_string_map_multiss_t_decimate_by(status, map_multis, amount) status = f_string_map_multiss_decimate_by(amount, &map_multis); + #define macro_f_string_map_multiss_t_clear(map_multiss) \ + map_multiss.array = 0; \ + map_multiss.size = 0; \ + map_multiss.used = 0; #endif // _di_f_string_map_multiss_t_ /** diff --git a/level_0/f_string/c/string/maps.h b/level_0/f_string/c/string/maps.h index 4fbee7e..850c1c6 100644 --- a/level_0/f_string/c/string/maps.h +++ b/level_0/f_string/c/string/maps.h @@ -37,16 +37,10 @@ extern "C" { #define macro_f_string_maps_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_maps_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_maps_t_resize(status, maps, length) status = f_string_maps_resize(length, &maps); - #define macro_f_string_maps_t_adjust(status, maps, length) status = f_string_maps_adjust(length, &maps); - - #define macro_f_string_maps_t_delete_simple(maps) f_string_maps_resize(0, &maps); - #define macro_f_string_maps_t_destroy_simple(maps) f_string_maps_adjust(0, &maps); - - #define macro_f_string_maps_t_increase(status, step, maps) status = f_string_maps_increase(step, maps); - #define macro_f_string_maps_t_increase_by(status, maps, amount) status = f_string_maps_increase_by(amount, maps); - #define macro_f_string_maps_t_decrease_by(status, maps, amount) status = f_string_maps_decrease_by(amount, maps); - #define macro_f_string_maps_t_decimate_by(status, maps, amount) status = f_string_maps_decimate_by(amount, maps); + #define macro_f_string_maps_t_clear(maps) \ + maps.array = 0; \ + maps.size = 0; \ + maps.used = 0; #endif // _di_f_string_maps_t_ /** diff --git a/level_0/f_string/c/string/mapss.h b/level_0/f_string/c/string/mapss.h index b859067..0da2ff3 100644 --- a/level_0/f_string/c/string/mapss.h +++ b/level_0/f_string/c/string/mapss.h @@ -37,16 +37,10 @@ extern "C" { #define macro_f_string_mapss_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_mapss_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_mapss_t_resize(status, maps, length) status = f_string_mapss_resize(length, &maps); - #define macro_f_string_mapss_t_adjust(status, maps, length) status = f_string_mapss_adjust(length, &maps); - - #define macro_f_string_mapss_t_delete_simple(maps) f_string_mapss_resize(0, &maps); - #define macro_f_string_mapss_t_destroy_simple(maps) f_string_mapss_adjust(0, &maps); - - #define macro_f_string_mapss_t_increase(status, step, maps) status = f_string_mapss_increase(step, maps); - #define macro_f_string_mapss_t_increase_by(status, maps, amount) status = f_string_mapss_increase_by(amount, maps); - #define macro_f_string_mapss_t_decrease_by(status, maps, amount) status = f_string_mapss_decrease_by(amount, maps); - #define macro_f_string_mapss_t_decimate_by(status, maps, amount) status = f_string_mapss_decimate_by(amount, maps); + #define macro_f_string_mapss_t_clear(mapss) \ + mapss.array = 0; \ + mapss.size = 0; \ + mapss.used = 0; #endif // _di_f_string_mapss_t_ /** diff --git a/level_0/f_string/c/string/private-dynamics.c b/level_0/f_string/c/string/private-dynamics.c index 9083748..32a601c 100644 --- a/level_0/f_string/c/string/private-dynamics.c +++ b/level_0/f_string/c/string/private-dynamics.c @@ -6,36 +6,19 @@ extern "C" { #endif -#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) - f_status_t private_f_string_dynamics_adjust(const f_number_unsigned_t length, f_string_dynamics_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &structure->array[i].string, &structure->array[i].used, &structure->array[i].size); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_string_dynamic_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) - #if !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) f_status_t private_f_string_dynamics_append(const f_string_dynamic_t source, f_string_dynamics_t * const destination) { - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_string_dynamics_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.used) { - status = private_f_string_append(source.string, source.used, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; + if (source.used) { + status = private_f_string_append(source.string, source.used, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -47,42 +30,25 @@ extern "C" { #if !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) f_status_t private_f_string_dynamics_append_all(const f_string_dynamics_t source, f_string_dynamics_t * const destination) { - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_string_dynamics_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.array[i].used) { - status = private_f_string_append(source.array[i].string, source.array[i].used, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].used) { + status = private_f_string_append(source.array[i].string, source.array[i].used, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) -#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_dynamics_resize) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) - f_status_t private_f_string_dynamics_resize(const f_number_unsigned_t length, f_string_dynamics_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &structure->array[i].string, &structure->array[i].used, &structure->array[i].size); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_string_dynamic_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_dynamics_resize) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string/private-dynamics.h b/level_0/f_string/c/string/private-dynamics.h index bed384b..0897a7a 100644 --- a/level_0/f_string/c/string/private-dynamics.h +++ b/level_0/f_string/c/string/private-dynamics.h @@ -16,35 +16,6 @@ extern "C" { #endif /** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The dynamics to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * - * @see f_string_dynamics_adjust() - * @see f_string_dynamics_append() - * @see f_string_dynamics_decimate_by() - * @see f_string_map_multis_adjust() - * @see f_string_map_multis_append() - */ -#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) - extern f_status_t private_f_string_dynamics_adjust(const f_number_unsigned_t length, f_string_dynamics_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) - -/** * Private implementation for appending. * * Intended to be shared to each of the different implementation variations. @@ -98,45 +69,6 @@ extern "C" { extern f_status_t private_f_string_dynamics_append_all(const f_string_dynamics_t source, f_string_dynamics_t * const destination) F_attribute_visibility_internal_d; #endif // !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The dynamics to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * - * @see f_string_dynamics_decrease_by() - * @see f_string_dynamics_increase() - * @see f_string_dynamics_increase_by() - * @see f_string_dynamics_resize() - * @see f_string_map_multis_append() - * @see f_string_map_multis_append_all() - * @see f_string_map_multis_decrease_by() - * @see f_string_map_multis_increase() - * @see f_string_map_multis_increase_by() - * @see f_string_map_multis_resize() - * @see f_string_map_multiss_append() - * @see f_string_map_multiss_append_all() - * @see f_string_map_multiss_decrease_by() - * @see f_string_map_multiss_increase() - * @see f_string_map_multiss_increase_by() - */ -#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_dynamics_resize) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) - extern f_status_t private_f_string_dynamics_resize(const f_number_unsigned_t length, f_string_dynamics_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_dynamics_resize) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string/private-dynamicss.c b/level_0/f_string/c/string/private-dynamicss.c deleted file mode 100644 index df95146..0000000 --- a/level_0/f_string/c/string/private-dynamicss.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "../string.h" -#include "../private-string.h" -#include "private-dynamics.h" -#include "private-dynamicss.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) - f_status_t private_f_string_dynamicss_adjust(const f_number_unsigned_t length, f_string_dynamicss_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_string_dynamics_adjust(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_string_dynamics_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) - -#if !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_) - f_status_t private_f_string_dynamicss_resize(const f_number_unsigned_t length, f_string_dynamicss_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_string_dynamics_resize(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_string_dynamics_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_) - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_string/c/string/private-dynamicss.h b/level_0/f_string/c/string/private-dynamicss.h deleted file mode 100644 index a8b2ff3..0000000 --- a/level_0/f_string/c/string/private-dynamicss.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: String - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * These are provided for internal reduction in redundant code. - * These should not be exposed/used outside of this project. - */ -#ifndef _PRIVATE_F_string_dynamicss_h -#define _PRIVATE_F_string_dynamicss_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The dynamicss to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * - * @see f_string_dynamicss_adjust() - * @see f_string_dynamicss_append() - * @see f_string_dynamicss_decimate_by() - * @see f_string_map_multis_adjust() - * @see f_string_map_multis_append() - */ -#if !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) - extern f_status_t private_f_string_dynamicss_adjust(const f_number_unsigned_t length, f_string_dynamicss_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The dynamicss to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * - * @see f_string_dynamicss_append_all() - * @see f_string_dynamicss_decrease_by() - * @see f_string_dynamicss_increase() - * @see f_string_dynamicss_increase_by() - * @see f_string_map_multis_append_all() - */ -#if !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_) - extern f_status_t private_f_string_dynamicss_resize(const f_number_unsigned_t length, f_string_dynamicss_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _PRIVATE_F_string_dynamicss_h diff --git a/level_0/f_string/c/string/private-map_multis.c b/level_0/f_string/c/string/private-map_multis.c index 4535fbb..4b62478 100644 --- a/level_0/f_string/c/string/private-map_multis.c +++ b/level_0/f_string/c/string/private-map_multis.c @@ -10,16 +10,25 @@ extern "C" { #if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_) f_status_t private_f_string_map_multis_adjust(const f_number_unsigned_t length, f_string_map_multis_t * const structure) { - f_status_t status = F_okay; + { + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - for (f_number_unsigned_t i = length; i < structure->size; ++i) { + for (f_number_unsigned_t i = length; i < structure->size; ++i) { - status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size); - if (F_status_is_error(status)) return status; + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size); + if (F_status_is_error(status)) return status; - status = private_f_string_dynamics_adjust(0, &structure->array[i].value); - if (F_status_is_error(status)) return status; - } // for + for (j = 0; j < structure->array[i].value.size; ++j) { + + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &structure->array[i].value.array[j].string, &structure->array[i].value.array[j].used, &structure->array[i].value.array[j].size); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &structure->array[i].value.array, &structure->array[i].value.used, &structure->array[i].value.size, &f_string_dynamics_destroy_callback); + if (F_status_is_error(status)) return status; + } // for + } return f_memory_array_adjust(length, sizeof(f_string_map_multi_t), (void **) &structure->array, &structure->used, &structure->size); } @@ -58,16 +67,25 @@ extern "C" { #if !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) f_status_t private_f_string_map_multis_resize(const f_number_unsigned_t length, f_string_map_multis_t * const structure) { - f_status_t status = F_okay; + { + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - for (f_number_unsigned_t i = length; i < structure->size; ++i) { + for (f_number_unsigned_t i = length; i < structure->size; ++i) { - status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size); - if (F_status_is_error(status)) return status; + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size); + if (F_status_is_error(status)) return status; - status = private_f_string_dynamics_resize(0, &structure->array[i].value); - if (F_status_is_error(status)) return status; - } // for + for (j = 0; j < structure->array[i].value.size; ++j) { + + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &structure->array[i].value.array[j].string, &structure->array[i].value.array[j].used, &structure->array[i].value.array[j].size); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &structure->array[i].value.array, &structure->array[i].value.used, &structure->array[i].value.size, &f_string_dynamics_delete_callback); + if (F_status_is_error(status)) return status; + } // for + } return f_memory_array_resize(length, sizeof(f_string_map_multi_t), (void **) &structure->array, &structure->used, &structure->size); } diff --git a/level_0/f_string/c/string/quantitys.h b/level_0/f_string/c/string/quantitys.h index 24b0f80..88744af 100644 --- a/level_0/f_string/c/string/quantitys.h +++ b/level_0/f_string/c/string/quantitys.h @@ -37,16 +37,10 @@ extern "C" { #define macro_f_string_quantitys_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_quantitys_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_quantitys_t_resize(status, quantitys, length) status = f_string_quantitys_resize(length, &quantitys); - #define macro_f_string_quantitys_t_adjust(status, quantitys, length) status = f_string_quantitys_adjust(length, &quantitys); - - #define macro_f_string_quantitys_t_delete_simple(quantitys) f_string_quantitys_resize(0, &quantitys); - #define macro_f_string_quantitys_t_destroy_simple(quantitys) f_string_quantitys_adjust(0, &quantitys); - - #define macro_f_string_quantitys_t_increase(status, step, quantitys) status = f_string_quantitys_increase(step, &quantitys); - #define macro_f_string_quantitys_t_increase_by(status, quantitys, amount) status = f_string_quantitys_increase_by(amount, &quantitys); - #define macro_f_string_quantitys_t_decrease_by(status, quantitys, amount) status = f_string_quantitys_decrease_by(amount, &quantitys); - #define macro_f_string_quantitys_t_decimate_by(status, quantitys, amount) status = f_string_quantitys_decimate_by(amount, &quantitys); + #define macro_f_string_quantitys_t_clear(quantitys) \ + quantitys.array = 0; \ + quantitys.size = 0; \ + quantitys.used = 0; #endif // _di_f_string_quantitys_t_ /** diff --git a/level_0/f_string/c/string/quantityss.h b/level_0/f_string/c/string/quantityss.h index 49516e0..55f574c 100644 --- a/level_0/f_string/c/string/quantityss.h +++ b/level_0/f_string/c/string/quantityss.h @@ -37,18 +37,10 @@ extern "C" { #define macro_f_string_quantityss_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_quantityss_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_quantityss_t_clear(quantityss) macro_f_memory_structures_clear(quantityss) - - #define macro_f_string_quantityss_t_resize(status, quantityss, length) status = f_string_quantityss_resize(length, &quantityss); - #define macro_f_string_quantityss_t_adjust(status, quantityss, length) status = f_string_quantityss_adjust(length, &quantityss); - - #define macro_f_string_quantityss_t_delete_simple(quantityss) f_string_quantityss_resize(0, &quantityss); - #define macro_f_string_quantityss_t_destroy_simple(quantityss) f_string_quantityss_adjust(0, &quantityss); - - #define macro_f_string_quantityss_t_increase(status, step, quantityss) status = f_string_quantityss_increase(step, &quantityss); - #define macro_f_string_quantityss_t_increase_by(status, quantityss, amount) status = f_string_quantityss_increase_by(amount, &quantityss); - #define macro_f_string_quantityss_t_decrease_by(status, quantityss, amount) status = f_string_quantityss_decrease_by(amount, &quantityss); - #define macro_f_string_quantityss_t_decimate_by(status, quantityss, amount) status = f_string_quantityss_decimate_by(amount, &quantityss); + #define macro_f_string_quantityss_t_clear(quantityss) \ + quantityss.array = 0; \ + quantityss.size = 0; \ + quantityss.used = 0; #endif // _di_f_string_quantityss_t_ /** diff --git a/level_0/f_string/c/string/ranges.h b/level_0/f_string/c/string/ranges.h index e30c145..31aec5f 100644 --- a/level_0/f_string/c/string/ranges.h +++ b/level_0/f_string/c/string/ranges.h @@ -37,16 +37,10 @@ extern "C" { #define macro_f_string_ranges_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_ranges_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_ranges_t_resize(status, ranges, length) status = f_string_ranges_resize(length, &ranges); - #define macro_f_string_ranges_t_adjust(status, ranges, length) status = f_string_ranges_adjust(length, &ranges); - - #define macro_f_string_ranges_t_delete_simple(ranges) f_string_ranges_resize(0, &ranges); - #define macro_f_string_ranges_t_destroy_simple(ranges) f_string_ranges_adjust(0, &ranges); - - #define macro_f_string_ranges_t_increase(status, step, ranges) status = f_string_ranges_increase(step, &ranges); - #define macro_f_string_ranges_t_increase_by(status, ranges, amount) status = f_string_ranges_increase_by(amount, &ranges); - #define macro_f_string_ranges_t_decrease_by(status, ranges, amount) status = f_string_ranges_decrease_by(amount, &ranges); - #define macro_f_string_ranges_t_decimate_by(status, ranges, amount) status = f_string_ranges_decimate_by(amount, &ranges); + #define macro_f_string_ranges_t_clear(ranges) \ + ranges.array = 0; \ + ranges.size = 0; \ + ranges.used = 0; #endif // _di_f_string_ranges_t_ /** diff --git a/level_0/f_string/c/string/rangess.h b/level_0/f_string/c/string/rangess.h index 3b20e55..5c30bf9 100644 --- a/level_0/f_string/c/string/rangess.h +++ b/level_0/f_string/c/string/rangess.h @@ -37,18 +37,10 @@ extern "C" { #define macro_f_string_rangess_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_rangess_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_rangess_t_clear(rangess) macro_f_memory_structures_clear(rangess) - - #define macro_f_string_rangess_t_resize(status, rangess, length) status = f_string_rangess_resize(length, &rangess); - #define macro_f_string_rangess_t_adjust(status, rangess, length) status = f_string_rangess_adjust(length, &rangess); - - #define macro_f_string_rangess_t_delete_simple(rangess) f_string_rangess_resize(0, &rangess); - #define macro_f_string_rangess_t_destroy_simple(rangess) f_string_rangess_adjust(0, &rangess); - - #define macro_f_string_rangess_t_increase(status, step, rangess) status = f_string_rangess_increase(step, &rangess); - #define macro_f_string_rangess_t_increase_by(status, rangess, amount) status = f_string_rangess_increase_by(amount, &rangess); - #define macro_f_string_rangess_t_decrease_by(status, rangess, amount) status = f_string_rangess_decrease_by(amount, &rangess); - #define macro_f_string_rangess_t_decimate_by(status, rangess, amount) status = f_string_rangess_decimate_by(amount, &rangess); + #define macro_f_string_rangess_t_clear(rangess) \ + rangess.array = 0; \ + rangess.size = 0; \ + rangess.used = 0; #endif // _di_f_string_rangess_t_ /** diff --git a/level_0/f_string/c/string/static.c b/level_0/f_string/c/string/static.c index 623c024..25d6b93 100644 --- a/level_0/f_string/c/string/static.c +++ b/level_0/f_string/c/string/static.c @@ -146,6 +146,13 @@ extern "C" { const f_string_static_t f_string_ascii_transmission_block_end_s = macro_f_string_static_t_initialize_1(F_string_ascii_transmission_block_end_s, 0, F_string_ascii_transmission_block_end_s_length); #endif // _di_f_string_ascii_s_ +#ifndef _di_f_string_format_s_ + const f_string_static_t f_string_format_Q_double_s = macro_f_string_static_t_initialize_1(F_string_format_Q_double_s, 0, F_string_format_Q_double_s_length); + const f_string_static_t f_string_format_Q_single_s = macro_f_string_static_t_initialize_1(F_string_format_Q_single_s, 0, F_string_format_Q_single_s_length); + const f_string_static_t f_string_format_sentence_end_s = macro_f_string_static_t_initialize_1(F_string_format_sentence_end_s, 0, F_string_format_sentence_end_s_length); + const f_string_static_t f_string_format_sentence_end_quote_s = macro_f_string_static_t_initialize_1(F_string_format_sentence_end_quote_s, 0, F_string_format_sentence_end_quote_s_length); +#endif // _di_f_string_format_s_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string/static.h b/level_0/f_string/c/string/static.h index 7624fc1..05c2b02 100644 --- a/level_0/f_string/c/string/static.h +++ b/level_0/f_string/c/string/static.h @@ -496,6 +496,26 @@ extern "C" { #endif // _di_f_string_ascii_s_ /** + * Provide a static strings focusing on the commonly used print format strings. + */ +#ifndef _di_f_string_format_s_ + #define F_string_format_Q_double_s "%[%[%Q%]%]" + #define F_string_format_Q_single_s "%[%Q%]" + #define F_string_format_sentence_end_s "%[.%]%r" + #define F_string_format_sentence_end_quote_s "%['.%]%r" + + #define F_string_format_Q_double_s_length 10 + #define F_string_format_Q_single_s_length 6 + #define F_string_format_sentence_end_s_length 7 + #define F_string_format_sentence_end_quote_s_length 6 + + extern const f_string_static_t f_string_format_Q_double_s; + extern const f_string_static_t f_string_format_Q_single_s; + extern const f_string_static_t f_string_format_sentence_end_s; + extern const f_string_static_t f_string_format_sentence_end_quote_s; +#endif // _di_f_string_format_s_ + +/** * Define the end of line character. * FLL forbids '\r' and '\r\n' as end of line characters, \r will be silently ignored. */ diff --git a/level_0/f_string/c/string/triple.h b/level_0/f_string/c/string/triple.h index 7df335a..5653d69 100644 --- a/level_0/f_string/c/string/triple.h +++ b/level_0/f_string/c/string/triple.h @@ -33,6 +33,8 @@ extern "C" { #define f_string_triple_t_initialize { f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } + #define macro_f_string_triple_t_initialize_1(a, b, c) { a, b, c } + #define macro_f_string_triple_t_clear(triple) \ triple.a.array = 0; \ triple.a.size = 0; \ @@ -43,18 +45,6 @@ extern "C" { triple.c.array = 0; \ triple.c.size = 0; \ triple.c.used = 0; - - #define macro_f_string_triple_t_initialize_1(a, b, c) { a, b, c } - - #define macro_f_string_triple_t_delete_simple(triple) \ - macro_f_string_dynamic_t_delete_simple(triple.a) \ - macro_f_string_dynamic_t_delete_simple(triple.b) \ - macro_f_string_dynamic_t_delete_simple(triple.c) - - #define macro_f_string_triple_t_destroy_simple(triple) \ - macro_f_string_dynamic_t_destroy_simple(triple.a) \ - macro_f_string_dynamic_t_destroy_simple(triple.b) \ - macro_f_string_dynamic_t_destroy_simple(triple.c) #endif // _di_f_string_triple_t_ #ifdef __cplusplus diff --git a/level_0/f_string/c/string/triples.h b/level_0/f_string/c/string/triples.h index 2cfacc4..5ec7e2c 100644 --- a/level_0/f_string/c/string/triples.h +++ b/level_0/f_string/c/string/triples.h @@ -37,16 +37,10 @@ extern "C" { #define macro_f_string_triples_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_triples_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_triples_t_resize(status, triples, length) status = f_string_triples_resize(length, &triples); - #define macro_f_string_triples_t_adjust(status, triples, length) status = f_string_triples_adjust(length, &triples); - - #define macro_f_string_triples_t_delete_simple(triples) f_string_triples_resize(0, &triples); - #define macro_f_string_triples_t_destroy_simple(triples) f_string_triples_adjust(0, &triples); - - #define macro_f_string_triples_t_increase(status, step, triples) status = f_string_triples_increase(step, triples); - #define macro_f_string_triples_t_increase_by(status, triples, amount) status = f_string_triples_increase_by(amount, triples); - #define macro_f_string_triples_t_decrease_by(status, triples, amount) status = f_string_triples_decrease_by(amount, triples); - #define macro_f_string_triples_t_decimate_by(status, triples, amount) status = f_string_triples_decimate_by(amount, triples); + #define macro_f_string_triples_t_clear(triples) \ + triples.array = 0; \ + triples.size = 0; \ + triples.used = 0; #endif // _di_f_string_triples_t_ /** diff --git a/level_0/f_string/c/string/tripless.h b/level_0/f_string/c/string/tripless.h index 58ed1ff..d4f4ae1 100644 --- a/level_0/f_string/c/string/tripless.h +++ b/level_0/f_string/c/string/tripless.h @@ -37,16 +37,10 @@ extern "C" { #define macro_f_string_tripless_t_initialize_1(array, size, used) { array, size, used } #define macro_f_string_tripless_t_initialize_2(array, length) { array, length, length } - #define macro_f_string_tripless_t_resize(status, tripless, length) status = f_string_tripless_resize(length, &tripless); - #define macro_f_string_tripless_t_adjust(status, tripless, length) status = f_string_tripless_adjust(length, &tripless); - - #define macro_f_string_tripless_t_delete_simple(tripless) f_string_tripless_resize(0, &tripless); - #define macro_f_string_tripless_t_destroy_simple(tripless) f_string_tripless_adjust(0, &tripless); - - #define macro_f_string_tripless_t_increase(status, step, tripless) status = f_string_tripless_increase(step, tripless); - #define macro_f_string_tripless_t_increase_by(status, tripless, amount) status = f_string_tripless_increase_by(amount, tripless); - #define macro_f_string_tripless_t_decrease_by(status, tripless, amount) status = f_string_tripless_decrease_by(amount, tripless); - #define macro_f_string_tripless_t_decimate_by(status, tripless, amount) status = f_string_tripless_decimate_by(amount, tripless); + #define macro_f_string_tripless_t_clear(tripless) \ + tripless.array = 0; \ + tripless.size = 0; \ + tripless.used = 0; #endif // _di_f_string_tripless_t_ /** diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index 5d64f3a..c985c85 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -131,12 +131,10 @@ extern "C" { * Errors (with error bit) from: f_file_role_change(). * Errors (with error bit) from: f_file_stat(). * Errors (with error bit) from: f_file_stat_at(). + * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * Errors (with error bit) from: f_string_dynamic_append_assure(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). - * 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_dynamics_increase_by(). - * Errors (with error bit) from: f_string_dynamics_resize(). * * Errors (with error bit) from: recurse.action(). * Errors (with error bit) from: recurse.handle(). @@ -152,12 +150,10 @@ extern "C" { * @see f_file_role_change() * @see f_file_stat() * @see f_file_stat_at() + * @see f_memory_array_increase_by() + * @see f_memory_array_resize() * @see f_string_dynamic_append_assure() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamic_increase_by() - * @see f_string_dynamic_resize() - * @see f_string_dynamics_increase_by() - * @see f_string_dynamics_resize() * * @see recurse.action() * @see recurse.handle() @@ -203,7 +199,7 @@ 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(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see alphasort() * @see opendir() @@ -211,7 +207,7 @@ extern "C" { * @see versionsort() * * @see f_file_stat_at() - * @see f_string_dynamics_increase_by() + * @see f_memory_array_increase_by() */ #ifndef _di_fl_directory_list_ 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 * const listing); diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index 27d983a..27ca561 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -35,7 +35,7 @@ extern "C" { // Only the directory is to be freed because all others are preserved between recursions. if (F_status_is_error(recurse->state.status)) { - f_string_dynamics_resize(0, &recurse->listing.directory); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.directory.array, &recurse->listing.directory.used, &recurse->listing.directory.size, &f_string_dynamics_delete_callback); recurse->listing.directory.array = directories_original.array; recurse->listing.directory.used = directories_original.used; @@ -102,7 +102,7 @@ extern "C" { recurse->path.used = used_original; - recurse->state.status = f_string_dynamic_increase_by(f_path_separator_s.used + list[k]->array[i].used + 1, &recurse->path); + recurse->state.status = f_memory_array_increase_by(f_path_separator_s.used + list[k]->array[i].used + 1, sizeof(f_char_t), (void **) &recurse->path.string, &recurse->path.used, &recurse->path.size); if (F_status_is_error_not(recurse->state.status)) { recurse->state.status = f_string_dynamic_append_assure(f_path_separator_s, &recurse->path); @@ -159,7 +159,7 @@ extern "C" { recurse->path.used = used_original; - recurse->state.status = f_string_dynamic_increase_by(f_path_separator_s.used + recurse->listing.directory.array[i].used + 1, &recurse->path); + recurse->state.status = f_memory_array_increase_by(f_path_separator_s.used + recurse->listing.directory.array[i].used + 1, sizeof(f_char_t), (void **) &recurse->path.string, &recurse->path.used, &recurse->path.size); if (F_status_is_error_not(recurse->state.status)) { recurse->state.status = f_string_dynamic_append_assure(f_path_separator_s, &recurse->path); @@ -239,7 +239,7 @@ extern "C" { recurse->path.used = used_original; // Only the directory is to be freed because all others are preserved between recursions. - f_string_dynamics_resize(0, &recurse->listing.directory); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &recurse->listing.directory.array, &recurse->listing.directory.used, &recurse->listing.directory.size, &f_string_dynamics_delete_callback); recurse->listing.directory.array = directories_original.array; recurse->listing.directory.used = directories_original.used; @@ -338,14 +338,12 @@ extern "C" { names = &listing->unknown; } - if (names->used == names->size) { - status = f_string_dynamics_increase_by(F_memory_default_allocation_small_d, names); - if (F_status_is_error(status)) break; - } + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &names->array, &names->used, &names->size); + if (F_status_is_error(status)) break; names->array[names->used].used = 0; - status = f_string_dynamic_increase_by(name_directory.used + 1, &names->array[names->used]); + status = f_memory_array_increase_by(name_directory.used + 1, sizeof(f_char_t), (void **) &names->array[names->used].string, &names->array[names->used].used, &names->array[names->used].size); if (F_status_is_error(status)) break; memcpy(names->array[names->used].string, name_directory.string, sizeof(f_char_t) * name_directory.used); @@ -551,7 +549,7 @@ extern "C" { return F_status_set_error(F_string_too_large); } - status = f_string_dynamic_resize(destination->used + total, destination); + status = f_memory_array_resize(destination->used + total, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; } } diff --git a/level_1/fl_directory/c/private-directory.h b/level_1/fl_directory/c/private-directory.h index 320f1c7..4653f29 100644 --- a/level_1/fl_directory/c/private-directory.h +++ b/level_1/fl_directory/c/private-directory.h @@ -28,9 +28,9 @@ extern "C" { * * F_interrupt (with error bit) if stopping due to an interrupt. * + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_append_assure(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). * Errors (with error bit) from: fl_directory_list(). * * Errors (with error bit) from: private_fl_directory_list(). @@ -39,9 +39,9 @@ extern "C" { * Errors (with error bit) from: recurse.action(). * Errors (with error bit) from: recurse.handle(). * + * @see f_memory_array_increase_by() * @see f_string_dynamic_append_assure() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamic_increase_by() * @see fl_directory_do() * * @see private_fl_directory_list() @@ -116,10 +116,10 @@ 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(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see f_file_stat_at() - * @see f_string_dynamics_increase_by() + * @see f_memory_array_increase_by() * * @see fl_directory_do() * @see fl_directory_list() diff --git a/level_1/fl_environment/c/environment.c b/level_1/fl_environment/c/environment.c index c9e275d..d11fad3 100644 --- a/level_1/fl_environment/c/environment.c +++ b/level_1/fl_environment/c/environment.c @@ -90,7 +90,7 @@ 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). - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, paths); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &paths->array, &paths->used, &paths->size); if (F_status_is_error(status)) return status; paths->array[paths->used++].used = 0; @@ -114,7 +114,7 @@ extern "C" { #endif // _en_kevux_path_architecture_bits_ if (total) { - status = f_string_dynamics_increase_by(total, paths); + status = f_memory_array_increase_by(total, sizeof(f_string_dynamic_t), (void **) &paths->array, &paths->used, &paths->size); if (F_status_is_error(status)) return status; total = 0; @@ -132,7 +132,7 @@ extern "C" { status = f_string_dynamic_append_assure(f_path_separator_s, &architecture_bits); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); return status; } @@ -148,15 +148,15 @@ extern "C" { if (i == path.used || path.string[i] == f_path_separator_variable_s.string[0]) { #ifdef _en_kevux_path_architecture_bits_ if (paths->used + 3 > paths->size) { - status = f_string_dynamics_increase(F_memory_default_allocation_small_d + 2, paths); + status = f_memory_array_increase(F_memory_default_allocation_small_d + 2, sizeof(f_string_dynamic_t), (void **) &paths->array, &paths->used, &paths->size); } #else - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, paths); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &paths->array, &paths->used, &paths->size); #endif // _en_kevux_path_architecture_bits_ if (F_status_is_error(status)) { #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); #endif // _en_kevux_path_architecture_bits_ return status; @@ -190,11 +190,11 @@ extern "C" { #ifdef _en_kevux_path_architecture_bits_ if (f_path_architecture_bits_s.used) { - status = f_string_dynamic_increase_by(k + f_path_architecture_bits_s.used, &paths->array[paths->used]); + status = f_memory_array_increase_by(k + f_path_architecture_bits_s.used, sizeof(f_char_t), (void **) &paths->array[paths->used].string, &paths->array[paths->used].used, &paths->array[paths->used].size); if (F_status_is_error(status)) { #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); #endif // _en_kevux_path_architecture_bits_ return status; @@ -207,11 +207,11 @@ extern "C" { } if (f_path_architecture_bits_scripts_s.used) { - status = f_string_dynamic_increase_by(k + f_path_architecture_bits_scripts_s.used, &paths->array[paths->used]); + status = f_memory_array_increase_by(k + f_path_architecture_bits_scripts_s.used, sizeof(f_char_t), (void **) &paths->array[paths->used].string, &paths->array[paths->used].used, &paths->array[paths->used].size); if (F_status_is_error(status)) { #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); #endif // _en_kevux_path_architecture_bits_ return status; @@ -224,11 +224,11 @@ extern "C" { } #endif // _en_kevux_path_architecture_bits_ - status = f_string_dynamic_increase_by(k, &paths->array[paths->used]); + status = f_memory_array_increase_by(k, sizeof(f_char_t), (void **) &paths->array[paths->used].string, &paths->array[paths->used].used, &paths->array[paths->used].size); if (F_status_is_error(status)) { #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); #endif // _en_kevux_path_architecture_bits_ return status; @@ -247,7 +247,8 @@ extern "C" { } // for #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); + if (F_status_is_error(status)) return status; #endif // _en_kevux_path_architecture_bits_ return F_okay; @@ -266,7 +267,7 @@ 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). - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, paths); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &paths->array, &paths->used, &paths->size); if (F_status_is_error(status)) return status; paths->array[paths->used++].used = 0; @@ -291,7 +292,7 @@ extern "C" { #endif // _en_kevux_path_architecture_bits_ if (total) { - status = f_string_dynamics_increase_by(total, paths); + status = f_memory_array_increase_by(total, sizeof(f_string_dynamic_t), (void **) &paths->array, &paths->used, &paths->size); if (F_status_is_error(status)) return status; total = 0; @@ -309,7 +310,7 @@ extern "C" { status = f_string_dynamic_append_assure(f_path_separator_s, &architecture_bits); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); return status; } @@ -325,15 +326,15 @@ extern "C" { if (i == path.used || path.string[r] == f_path_separator_variable_s.string[0]) { #ifdef _en_kevux_path_architecture_bits_ if (paths->used + 3 > paths->size) { - status = f_string_dynamics_increase(F_memory_default_allocation_small_d + 2, paths); + status = f_memory_array_increase(F_memory_default_allocation_small_d + 2, sizeof(f_string_dynamic_t), (void **) &paths->array, &paths->used, &paths->size); } #else - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, paths); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &paths->array, &paths->used, &paths->size); #endif // _en_kevux_path_architecture_bits_ if (F_status_is_error(status)) { #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); #endif // _en_kevux_path_architecture_bits_ return status; @@ -367,11 +368,11 @@ extern "C" { #ifdef _en_kevux_path_architecture_bits_ if (f_path_architecture_bits_s.used) { - status = f_string_dynamic_increase_by(k + f_path_architecture_bits_s.used, &paths->array[paths->used]); + status = f_memory_array_increase_by(k + f_path_architecture_bits_s.used, sizeof(f_char_t), (void **) &paths->array[paths->used].string, &paths->array[paths->used].used, &paths->array[paths->used].size); if (F_status_is_error(status)) { #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); #endif // _en_kevux_path_architecture_bits_ return status; @@ -384,11 +385,11 @@ extern "C" { } if (f_path_architecture_bits_scripts_s.used) { - status = f_string_dynamic_increase_by(k + f_path_architecture_bits_scripts_s.used, &paths->array[paths->used]); + status = f_memory_array_increase_by(k + f_path_architecture_bits_scripts_s.used, sizeof(f_char_t), (void **) &paths->array[paths->used].string, &paths->array[paths->used].used, &paths->array[paths->used].size); if (F_status_is_error(status)) { #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); #endif // _en_kevux_path_architecture_bits_ return status; @@ -401,11 +402,11 @@ extern "C" { } #endif // _en_kevux_path_architecture_bits_ - status = f_string_dynamic_increase_by(k, &paths->array[paths->used]); + status = f_memory_array_increase_by(k, sizeof(f_char_t), (void **) &paths->array[paths->used].string, &paths->array[paths->used].used, &paths->array[paths->used].size); if (F_status_is_error(status)) { #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); #endif // _en_kevux_path_architecture_bits_ return status; @@ -424,7 +425,8 @@ extern "C" { } // for #ifdef _en_kevux_path_architecture_bits_ - f_string_dynamic_resize(0, &architecture_bits); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &architecture_bits.string, &architecture_bits.used, &architecture_bits.size); + if (F_status_is_error(status)) return status; #endif // _en_kevux_path_architecture_bits_ return F_okay; diff --git a/level_1/fl_environment/c/environment.h b/level_1/fl_environment/c/environment.h index b904a98..63aa40e 100644 --- a/level_1/fl_environment/c/environment.h +++ b/level_1/fl_environment/c/environment.h @@ -112,12 +112,12 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_environment_get() (only when _en_kevux_path_architecture_bits_ is defined). - * Errors (with error bit) from: f_string_dynamics_increase(). - * Errors (with error bit) from: f_string_dynamics_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see f_environment_get() - * @see f_string_dynamics_increase() - * @see f_string_dynamics_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() */ #ifndef _di_fl_environment_path_explode_ extern f_status_t fl_environment_path_explode(const f_string_static_t path, f_string_dynamics_t * const paths); @@ -146,12 +146,12 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_environment_get() (only when _en_kevux_path_architecture_bits_ is defined). - * Errors (with error bit) from: f_string_dynamics_increase(). - * Errors (with error bit) from: f_string_dynamics_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see f_environment_get() - * @see f_string_dynamics_increase() - * @see f_string_dynamics_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() */ #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 * const paths); diff --git a/level_1/fl_fss/c/fss/basic.c b/level_1/fl_fss/c/fss/basic.c index 5345c45..ce0e6eb 100644 --- a/level_1/fl_fss/c/fss/basic.c +++ b/level_1/fl_fss/c/fss/basic.c @@ -92,7 +92,7 @@ extern "C" { // Content should be terminated, even if empty. if (complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_end_e) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; destination->string[destination->used++] = f_fss_basic_close_s.string[0]; @@ -121,7 +121,7 @@ extern "C" { if (content.string[range->start] == f_fss_placeholder_s.string[0]) continue; - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; @@ -133,7 +133,7 @@ extern "C" { } // for if (complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_end_e) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; @@ -202,7 +202,7 @@ extern "C" { // Objects cannot be empty, so write a quote empty string. { - const f_status_t status = f_string_dynamic_increase_by(state->step_small + 2, destination); + const f_status_t status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { destination->used = destination_used; @@ -231,7 +231,7 @@ extern "C" { } if (complete != f_fss_complete_trim_e) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; diff --git a/level_1/fl_fss/c/fss/basic.h b/level_1/fl_fss/c/fss/basic.h index 0780d1a..4682ead 100644 --- a/level_1/fl_fss/c/fss/basic.h +++ b/level_1/fl_fss/c/fss/basic.h @@ -125,12 +125,12 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_fss_skip_past_delimit(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see f_fss_skip_past_delimit() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() */ #ifndef _di_fl_fss_basic_content_write_ extern void fl_fss_basic_content_write(const f_string_static_t content, const uint8_t complete, f_string_range_t * const range, f_string_dynamic_t * const destination, f_state_t * const state); @@ -251,14 +251,14 @@ extern "C" { * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_fss_skip_past_delimit(). * Errors (with error bit) from: f_fss_skip_past_space(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see f_fss_is_space() * @see f_fss_skip_past_delimit() * @see f_fss_skip_past_space() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() */ #ifndef _di_fl_fss_basic_object_write_ extern void fl_fss_basic_object_write(const f_string_static_t object, const uint8_t quote, const uint8_t complete, f_string_range_t * const range, f_string_dynamic_t * const destination, f_state_t * const state); diff --git a/level_1/fl_fss/c/fss/basic_list.c b/level_1/fl_fss/c/fss/basic_list.c index f65b878..5a82cf4 100644 --- a/level_1/fl_fss/c/fss/basic_list.c +++ b/level_1/fl_fss/c/fss/basic_list.c @@ -308,7 +308,7 @@ extern "C" { if (state->status == F_okay_stop || state->status == F_okay_eos) { if (complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_end_e) { - const f_status_t status = f_string_dynamic_increase(state->step_large, destination); + const f_status_t status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { state->status = status; @@ -325,7 +325,7 @@ extern "C" { } // Ensure that there is room for a slash delimit and possibly the end of content character. - state->status = f_string_dynamic_increase_by(state->step_small + 3, destination); + state->status = f_memory_array_increase_by(state->step_small + 3, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; const f_number_unsigned_t destination_used = destination->used; @@ -370,7 +370,7 @@ extern "C" { if (content.string[range->start] == f_fss_placeholder_s.string[0]) continue; if (content.string[range->start] != f_fss_slash_s.string[0]) break; - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; @@ -391,7 +391,7 @@ extern "C" { if (content.string[range->start] == f_fss_eol_s.string[0] || range->start >= content.used || range->start > range->stop) { // Increase by total slashes + 1, along with the basic list open and possible newline. - state->status = f_string_dynamic_increase_by(slash_count + 3, destination); + state->status = f_memory_array_increase_by(slash_count + 3, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; while (--slash_count) { @@ -409,7 +409,7 @@ extern "C" { continue; } - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_basic_list_open_s.string[0]; @@ -436,7 +436,7 @@ extern "C" { if (content.string[range->start] == f_fss_eol_s.string[0] || range->start >= content.used || range->start > range->stop) { // Increase by slash and basic list open and possible newline. - state->status = f_string_dynamic_increase_by(state->step_small + 3, destination); + state->status = f_memory_array_increase_by(state->step_small + 3, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; @@ -450,7 +450,7 @@ extern "C" { continue; } - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_basic_list_open_s.string[0]; @@ -488,7 +488,7 @@ extern "C" { width = macro_f_utf_byte_width(content.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -507,7 +507,7 @@ extern "C" { } if (complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_end_e) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; @@ -864,7 +864,7 @@ extern "C" { if (state->status == F_okay_stop || state->status == F_okay_eos) { if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e) { { - const f_status_t status = f_string_dynamic_increase_by(state->step_small + 2, destination); + const f_status_t status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { state->status = status; @@ -903,7 +903,7 @@ extern "C" { if (object.string[range->start] == f_fss_comment_s.string[0]) { // When a comment is found, escape it. - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; @@ -938,7 +938,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -988,7 +988,7 @@ extern "C" { slash_count *= 2; } - state->status = f_string_dynamic_increase_by(slash_count, destination); + state->status = f_memory_array_increase_by(slash_count, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; while (--slash_count) { @@ -1007,7 +1007,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -1037,7 +1037,7 @@ extern "C" { } if (complete != f_fss_complete_trim_e) { - state->status = f_string_dynamic_increase(state->step_small + 2, destination); + state->status = f_memory_array_increase(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; diff --git a/level_1/fl_fss/c/fss/basic_list.h b/level_1/fl_fss/c/fss/basic_list.h index 514d023..8a77dd2 100644 --- a/level_1/fl_fss/c/fss/basic_list.h +++ b/level_1/fl_fss/c/fss/basic_list.h @@ -143,17 +143,17 @@ extern "C" { * Errors (with error bit) from: f_fss_is_graph(). * Errors (with error bit) from: f_fss_skip_past_delimit(). * Errors (with error bit) from: f_fss_skip_past_space(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_append(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). * * @see f_fss_is_graph() * @see f_fss_skip_past_delimit() * @see f_fss_skip_past_space() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_string_dynamic_append() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() * @see f_utf_buffer_increment() */ #ifndef _di_fl_fss_basic_list_content_write_ @@ -267,16 +267,16 @@ extern "C" { * * Errors (with error bit) from: f_fss_is_graph(). * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_fss_skip_past_delimit(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). * * @see f_fss_is_graph() * @see f_fss_is_space() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_fss_skip_past_delimit() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() * @see f_utf_buffer_increment() */ #ifndef _di_fl_fss_basic_list_object_write_ diff --git a/level_1/fl_fss/c/fss/embedded_list.c b/level_1/fl_fss/c/fss/embedded_list.c index a5d492d..acf68d8 100644 --- a/level_1/fl_fss/c/fss/embedded_list.c +++ b/level_1/fl_fss/c/fss/embedded_list.c @@ -817,7 +817,7 @@ extern "C" { if (range->start > range->stop || range->start >= content.used) { if (complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_end_e) { - const f_status_t status = f_string_dynamic_increase_by(state->step_small + 2, destination); + const f_status_t status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { state->status = status; @@ -864,7 +864,7 @@ extern "C" { do_prepend = F_false; } - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = content.string[range->start]; @@ -883,7 +883,7 @@ extern "C" { if (content.string[range->start] == f_fss_placeholder_s.string[0]) continue; if (content.string[range->start] != f_fss_slash_s.string[0]) break; - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; @@ -904,7 +904,7 @@ extern "C" { if (range->start >= content.used || range->start > range->stop || content.string[range->start] == f_fss_eol_s.string[0]) { // Increase by total slashes + 1 embedded list open/close. - state->status = f_string_dynamic_increase_by(slash_count + 2, destination); + state->status = f_memory_array_increase_by(slash_count + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; if (content.string[range->start] == f_fss_embedded_list_open_s.string[0]) { @@ -929,7 +929,7 @@ extern "C" { } // Increase by character at "start" and possible newline. - state->status = f_string_dynamic_increase_by(state->step_small + 2, destination); + state->status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = content.string[start]; @@ -979,7 +979,7 @@ extern "C" { } // for if (r < ignore->used) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = content.string[start]; @@ -990,7 +990,7 @@ extern "C" { } // Increase by slash and extended list open and possible newline. - state->status = f_string_dynamic_increase_by(state->step_small + 3, destination); + state->status = f_memory_array_increase_by(state->step_small + 3, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; @@ -1004,7 +1004,7 @@ extern "C" { continue; } - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = content.string[start]; @@ -1044,7 +1044,7 @@ extern "C" { width = macro_f_utf_byte_width(content.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -1063,7 +1063,7 @@ extern "C" { } if (complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_end_e) { - state->status = f_string_dynamic_increase_by(state->step_small + 3, destination); + state->status = f_memory_array_increase_by(state->step_small + 3, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; if (!ends_on_eol) { @@ -1454,7 +1454,8 @@ extern "C" { if (state->status == F_data_not_stop || state->status == F_data_not_eos) { if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e) { { - const f_status_t status = f_string_dynamic_increase_by(state->step_small + 2, destination); + const f_status_t status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); + if (F_status_is_error(status)) { state->status = status; @@ -1473,7 +1474,7 @@ extern "C" { } // Ensure that there is room for a slash delimit, the object open character, and the end of line character. - state->status = f_string_dynamic_increase_by(state->step_small + 4, destination); + state->status = f_memory_array_increase_by(state->step_small + 4, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; const f_number_unsigned_t destination_used = destination->used; @@ -1496,7 +1497,7 @@ extern "C" { if (object.string[range->start] == f_fss_comment_s.string[0]) { // When a comment is found, escape it. - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; @@ -1531,7 +1532,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -1584,7 +1585,7 @@ extern "C" { slash_count *= 2; } - state->status = f_string_dynamic_increase_by(slash_count, destination); + state->status = f_memory_array_increase_by(slash_count, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; while (--slash_count) { @@ -1620,7 +1621,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -1653,7 +1654,7 @@ extern "C" { } if (complete != f_fss_complete_trim_e) { - state->status = f_string_dynamic_increase_by(state->step_small + 3, destination); + state->status = f_memory_array_increase_by(state->step_small + 3, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; diff --git a/level_1/fl_fss/c/fss/embedded_list.h b/level_1/fl_fss/c/fss/embedded_list.h index 8d7fe21..6170e65 100644 --- a/level_1/fl_fss/c/fss/embedded_list.h +++ b/level_1/fl_fss/c/fss/embedded_list.h @@ -151,17 +151,17 @@ extern "C" { * Errors (with error bit) from: f_fss_is_graph(). * Errors (with error bit) from: f_fss_skip_past_delimit(). * Errors (with error bit) from: f_fss_skip_past_space(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: f_string_dynamic_append(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). * * @see f_fss_is_graph() * @see f_fss_skip_past_delimit() * @see f_fss_skip_past_space() + * @see f_memory_array_increase() * @see f_string_dynamic_append() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see f_utf_buffer_increment() */ #ifndef _di_fl_fss_embedded_list_content_write_ @@ -276,15 +276,15 @@ extern "C" { * Errors (with error bit) from: f_fss_is_graph(). * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_fss_skip_past_delimit(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). * * @see f_fss_is_graph() * @see f_fss_is_space() * @see f_fss_skip_past_delimit() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memoy_array_increase() + * @see f_memory_array_increase_by() * @see f_utf_buffer_increment() */ #ifndef _di_fl_fss_embedded_list_object_write_ diff --git a/level_1/fl_fss/c/fss/extended.c b/level_1/fl_fss/c/fss/extended.c index 0e66a0d..e3e1254 100644 --- a/level_1/fl_fss/c/fss/extended.c +++ b/level_1/fl_fss/c/fss/extended.c @@ -165,7 +165,7 @@ extern "C" { if (state->status == F_data_not_stop || state->status == F_data_not_eos) { // Content that is empty must be represented by a quote empty string. - status = f_string_dynamic_increase_by(state->step_small + 4, destination); + status = f_memory_array_increase_by(state->step_small + 4, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { state->status = status; @@ -189,7 +189,7 @@ extern "C" { } // Ensure that there is room, including the slash delimit and possibly the end of content characters. - status = f_string_dynamic_increase_by(state->step_small + 2, destination); + status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { state->status = status; @@ -263,7 +263,7 @@ void fl_fss_extended_object_write(const f_string_static_t object, const uint8_t if (state->status == F_data_not_stop || state->status == F_data_not_eos) { // Objects cannot be empty, so write a quote empty string. - status = f_string_dynamic_increase_by(state->step_small + 2, destination); + status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { destination->used = destination_used; @@ -292,7 +292,7 @@ void fl_fss_extended_object_write(const f_string_static_t object, const uint8_t } if (complete != f_fss_complete_trim_e) { - status = f_string_dynamic_increase(state->step_large, destination); + status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { destination->used = destination_used; diff --git a/level_1/fl_fss/c/fss/extended.h b/level_1/fl_fss/c/fss/extended.h index 53dcd80..5bceb80 100644 --- a/level_1/fl_fss/c/fss/extended.h +++ b/level_1/fl_fss/c/fss/extended.h @@ -141,15 +141,15 @@ extern "C" { * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_fss_skip_past_delimit(). * Errors (with error bit) from: f_fss_skip_past_space(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). * * @see f_fss_is_space() * @see f_fss_skip_past_delimit() * @see f_fss_skip_past_space() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_utf_buffer_increment() * @see fl_fss_basic_object_write() * @see fl_fss_extended_object_write() @@ -275,14 +275,14 @@ extern "C" { * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_fss_skip_past_delimit(). * Errors (with error bit) from: f_fss_skip_past_space(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * * @see f_fss_is_space() * @see f_fss_skip_past_delimit() * @see f_fss_skip_past_space() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() */ #ifndef _di_fl_fss_extended_object_write_ extern void fl_fss_extended_object_write(const f_string_static_t object, const uint8_t quote, const uint8_t complete, f_string_range_t * const range, f_string_dynamic_t * const destination, f_state_t * const state); diff --git a/level_1/fl_fss/c/fss/extended_list.c b/level_1/fl_fss/c/fss/extended_list.c index 2a57565..214bd3c 100644 --- a/level_1/fl_fss/c/fss/extended_list.c +++ b/level_1/fl_fss/c/fss/extended_list.c @@ -250,7 +250,7 @@ extern "C" { if (range->start > range->stop || range->start >= content.used) { if (complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_end_e) { { - const f_status_t status = f_string_dynamic_increase_by(state->step_small + 2, destination); + const f_status_t status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { state->status = status; @@ -267,7 +267,7 @@ extern "C" { } // Ensure that there is room for a slash delimit and possibly the end of content characters. - state->status = f_string_dynamic_increase_by(state->step_small + 4, destination); + state->status = f_memory_array_increase_by(state->step_small + 4, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; const f_number_unsigned_t destination_used = destination->used; @@ -295,7 +295,7 @@ extern "C" { slash_count = 1; if (do_prepend) { - state->status = f_string_dynamic_increase_by(state->step_small + prepend->used, destination); + state->status = f_memory_array_increase_by(state->step_small + prepend->used, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; state->status = f_string_dynamic_append(*prepend, destination); @@ -304,7 +304,7 @@ extern "C" { do_prepend = F_false; } else { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; } @@ -324,7 +324,7 @@ extern "C" { if (content.string[range->start] == f_fss_placeholder_s.string[0]) continue; if (content.string[range->start] != f_fss_slash_s.string[0]) break; - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; @@ -346,7 +346,7 @@ extern "C" { // Do nothing. } else if (content.string[range->start] == f_fss_eol_s.string[0] || range->start >= content.used || range->start > range->stop) { - state->status = f_string_dynamic_increase_by(state->step_small + 2, destination); + state->status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; @@ -365,7 +365,7 @@ extern "C" { } // Increase by character at "start" and possible newline. - state->status = f_string_dynamic_increase_by(state->step_small + 2, destination); + state->status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = content.string[start]; @@ -415,7 +415,7 @@ extern "C" { } // for if (r < ignore->used) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = content.string[start]; @@ -426,7 +426,7 @@ extern "C" { } // Increase by slash and extended list close. - state->status = f_string_dynamic_increase_by(state->step_small + 2, destination); + state->status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; @@ -440,7 +440,7 @@ extern "C" { continue; } - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = content.string[start]; @@ -480,7 +480,7 @@ extern "C" { width = macro_f_utf_byte_width(content.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -499,7 +499,8 @@ extern "C" { } if (complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_end_e) { - state->status = f_string_dynamic_increase_by(state->step_small + 3, destination); + state->status = f_memory_array_increase_by(state->step_small + 3, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); + if (F_status_is_error(state->status)) { destination->used = destination_used; @@ -893,7 +894,7 @@ extern "C" { if (state->status == F_data_not_stop || state->status == F_data_not_eos) { if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e) { { - const f_status_t status = f_string_dynamic_increase_by(state->step_small + 2, destination); + const f_status_t status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) { state->status = status; @@ -913,7 +914,7 @@ extern "C" { } // Ensure that there is room for a slash delimit, the object open character, and the end of line character. - state->status = f_string_dynamic_increase_by(state->step_small + 4, destination); + state->status = f_memory_array_increase_by(state->step_small + 4, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; const f_number_unsigned_t destination_used = destination->used; @@ -936,7 +937,7 @@ extern "C" { if (object.string[range->start] == f_fss_comment_s.string[0]) { // When a comment is found, escape it. - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; @@ -971,7 +972,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -1024,7 +1025,7 @@ extern "C" { slash_count *= 2; } - state->status = f_string_dynamic_increase_by(slash_count, destination); + state->status = f_memory_array_increase_by(slash_count, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; while (--slash_count) { @@ -1060,7 +1061,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -1093,7 +1094,7 @@ extern "C" { } if (complete != f_fss_complete_trim_e) { - state->status = f_string_dynamic_increase_by(state->step_small + 3, destination); + state->status = f_memory_array_increase_by(state->step_small + 3, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = destination_used; diff --git a/level_1/fl_fss/c/fss/extended_list.h b/level_1/fl_fss/c/fss/extended_list.h index a8d962d..ad908b6 100644 --- a/level_1/fl_fss/c/fss/extended_list.h +++ b/level_1/fl_fss/c/fss/extended_list.h @@ -149,17 +149,17 @@ extern "C" { * Errors (with error bit) from: f_fss_is_graph(). * Errors (with error bit) from: f_fss_skip_past_delimit(). * Errors (with error bit) from: f_fss_skip_past_space(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: f_string_dynamic_append(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). * * @see f_fss_is_graph() * @see f_fss_skip_past_delimit() * @see f_fss_skip_past_space() + * @see f_memory_array_increase() * @see f_string_dynamic_append() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see f_utf_buffer_increment() */ #ifndef _di_fl_fss_extended_list_content_write_ @@ -274,15 +274,15 @@ extern "C" { * Errors (with error bit) from: f_fss_is_graph(). * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_fss_skip_past_delimit(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). * * @see f_fss_is_graph() * @see f_fss_is_space() * @see f_fss_skip_past_delimit() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_utf_buffer_increment() */ #ifndef _di_fl_fss_extended_list_object_write_ diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index f35e326..df75c6b 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -20,7 +20,7 @@ extern "C" { if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) continue; if (buffer.string[range->start] == f_fss_eol_s.string[0]) break; - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = buffer.string[range->start]; @@ -753,7 +753,7 @@ extern "C" { } // Ensure that there is room for the potential start and stop quotes, a potential delimit at start, and the potential object open character. - state->status = f_string_dynamic_increase_by(state->step_small + 5, destination); + state->status = f_memory_array_increase_by(state->step_small + 5, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; const f_number_unsigned_t input_start = range->start; @@ -815,13 +815,13 @@ extern "C" { // If this is the first quote, then only a single delimit slash is needed. if (item_first == input_start) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; } else { - state->status = f_string_dynamic_increase_by(item_total, destination); + state->status = f_memory_array_increase_by(item_total, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < item_total; ++i) { @@ -830,7 +830,7 @@ extern "C" { } } - state->status = f_string_dynamic_increase_by(item_total, destination); + state->status = f_memory_array_increase_by(item_total, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < item_total; ++i) { @@ -854,7 +854,7 @@ extern "C" { if (range->start > range->stop || range->start >= object.used) { - state->status = f_string_dynamic_increase_by(item_total + 1, destination); + state->status = f_memory_array_increase_by(item_total + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < item_total; ++i) { @@ -879,7 +879,7 @@ extern "C" { quoted_is = F_true; - state->status = f_string_dynamic_increase_by(item_total + 1, destination); + state->status = f_memory_array_increase_by(item_total + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; // Add the slashes that delimit the slashes. @@ -895,7 +895,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(item_total + width + 1, destination); + state->status = f_memory_array_increase_by(item_total + width + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < item_total; ++i) { @@ -915,7 +915,7 @@ extern "C" { commented = F_true; } - state->status = f_string_dynamic_increase_by(item_total + 1, destination); + state->status = f_memory_array_increase_by(item_total + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < item_total; ++i) { @@ -944,7 +944,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(item_total + width, destination); + state->status = f_memory_array_increase_by(item_total + width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; // There is nothing to delimit, so all slashes should be printed as is. @@ -962,7 +962,7 @@ extern "C" { // The very first quote, must be escaped, when quoting is disabled. if (item_first == input_start) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[used_start + 1] = f_fss_slash_s.string[0]; @@ -973,7 +973,7 @@ extern "C" { if (range->start > range->stop || range->start >= object.used) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = quote_char; @@ -982,7 +982,7 @@ extern "C" { } if (object.string[range->start] == quote_char) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = quote_char; @@ -1003,7 +1003,7 @@ extern "C" { } if (item_first != input_start) { - state->status = f_string_dynamic_increase(state->step_large, destination); + state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = f_fss_slash_s.string[0]; @@ -1014,7 +1014,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(width + 1, destination); + state->status = f_memory_array_increase_by(width + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; destination->string[destination->used++] = quote_char; @@ -1040,7 +1040,7 @@ extern "C" { width = macro_f_utf_byte_width(object.string[range->start]); - state->status = f_string_dynamic_increase_by(width, destination); + state->status = f_memory_array_increase_by(width, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) break; for (i = 0; i < width; ++i) { @@ -1059,7 +1059,7 @@ extern "C" { } if (quoted_is) { - f_string_dynamic_increase_by(state->step_small + 2, destination); + state->status = f_memory_array_increase_by(state->step_small + 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) { destination->used = used_start; diff --git a/level_1/fl_fss/c/private-fss.h b/level_1/fl_fss/c/private-fss.h index a966e18..a769749 100644 --- a/level_1/fl_fss/c/private-fss.h +++ b/level_1/fl_fss/c/private-fss.h @@ -39,9 +39,9 @@ extern "C" { * * F_interrupt (with error bit) if stopping due to an interrupt. * - * Errors (with error bit) from: f_string_dynamic_increase(). + * Errors (with error bit) from: f_memory_array_increase(). * - * @see f_string_dynamic_increase() + * @see f_memory_array_increase() * @see fl_fss_basic_list_content_write() * @see fl_fss_embedded_list_content_write() * @see fl_fss_extended_list_content_write() @@ -206,15 +206,15 @@ extern "C" { * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_fss_skip_past_delimit(). * Errors (with error bit) from: f_fss_skip_past_space(). - * Errors (with error bit) from: f_string_dynamic_increase(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). * * @see f_fss_is_space() * @see f_fss_skip_past_delimit() * @see f_fss_skip_past_space() - * @see f_string_dynamic_increase() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_utf_buffer_increment() * @see fl_fss_basic_object_write() * @see fl_fss_extended_object_write() diff --git a/level_1/fl_utf_file/c/utf_file.c b/level_1/fl_utf_file/c/utf_file.c index 21bde1d..f4c215c 100644 --- a/level_1/fl_utf_file/c/utf_file.c +++ b/level_1/fl_utf_file/c/utf_file.c @@ -338,13 +338,8 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_okay) { - if (range.start + *written == total) { - return F_okay_stop; - } - - if (range.start + *written == destination.used) { - return F_okay_eos; - } + if (range.start + *written == total) return F_okay_stop; + if (range.start + *written == destination.used) return F_okay_eos; } return status; diff --git a/level_2/fll_error/c/error.c b/level_2/fll_error/c/error.c index e28883f..c7e4c8f 100644 --- a/level_2/fll_error/c/error.c +++ b/level_2/fll_error/c/error.c @@ -44,8 +44,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QAccess denied while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -58,8 +58,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QCurrent user is not allowed to use the given group while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -72,8 +72,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QCurrent user is not allowed to use the given owner while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -86,8 +86,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QInvalid directory while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -100,7 +100,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', not empty.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -114,7 +114,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', already in an error state->%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -128,8 +128,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -142,7 +142,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', failed to close.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -156,7 +156,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', is closed.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -170,8 +170,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFile descriptor error while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -184,8 +184,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QMax file descriptors reached while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -198,8 +198,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QInvalid file descriptor while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -212,7 +212,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', %Q is empty.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -226,7 +226,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', flush failed.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -240,7 +240,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', found.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -254,7 +254,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', could not find.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -268,7 +268,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', already open.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -282,8 +282,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QMax open files reached while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -296,8 +296,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QOverflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -310,7 +310,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', purge failed.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -324,8 +324,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QRead failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -338,8 +338,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QSeek failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -352,8 +352,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QStat failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -366,8 +366,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QSynchronize failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -380,7 +380,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[' is an unknown file type.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -394,8 +394,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUTF failure while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -408,8 +408,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QInvalid UTF while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -422,8 +422,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnderflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -436,7 +436,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', write failure.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -450,8 +450,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QLoop while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -464,8 +464,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QInvalid %Q name '%]", print->to, print->context, print->prefix, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -478,8 +478,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QNumber overflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -492,8 +492,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QNumber underflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -510,8 +510,8 @@ extern "C" { private_fll_error_print_function(print, function); fl_print_format(" for the %Q '%]", print->to, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -524,8 +524,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QProhibited by system while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -538,7 +538,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', %Q is read only.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -554,7 +554,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[', %Q is write only.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -569,8 +569,8 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QInvalid or missing directory in path while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -583,7 +583,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[' is a directory.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -598,7 +598,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[' is a file.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -614,7 +614,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[' due to an invalid directory in the path.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -628,7 +628,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[' is a %Q.%]%r", print->to, 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); @@ -653,7 +653,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QThe argument for the parameter '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, parameter, print->notable); fl_print_format("%[' must not be an empty string.%]%r", print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); @@ -667,10 +667,10 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, argument, print->notable); fl_print_format("%[' is not a valid number for the parameter '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, parameter, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -683,10 +683,10 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, argument, print->notable); fl_print_format("%[' is negative, which is not allowed for the parameter '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, parameter, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -699,10 +699,10 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, argument, print->notable); fl_print_format("%[' is too large for the parameter '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, parameter, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -715,10 +715,10 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, argument, print->notable); fl_print_format("%[' is positive, which is not allowed for the parameter '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, parameter, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } @@ -731,10 +731,10 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, argument, print->notable); fl_print_format("%[' is too small for the parameter '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, parameter, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); funlockfile(print->to.stream); } diff --git a/level_2/fll_error/c/private-error.c b/level_2/fll_error/c/private-error.c index ed3adf6..c42815e 100644 --- a/level_2/fll_error/c/private-error.c +++ b/level_2/fll_error/c/private-error.c @@ -278,7 +278,7 @@ extern "C" { flockfile(print->to.stream); fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%['%S%S.%]%r", print->to, print->context, message ? ", " : "", message ? message : "", print->context, f_string_eol_s); funlockfile(print->to.stream); diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 98dd087..a9ea4b7 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -11,11 +11,13 @@ extern "C" { if (!arguments) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status_t status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments); - if (F_status_is_error(status)) return status; + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &arguments->array, &arguments->used, &arguments->size); + if (F_status_is_error(status)) return status; - status = private_fll_execute_arguments_add(source, arguments); - if (F_status_is_error(status)) return status; + status = private_fll_execute_arguments_add(source, arguments); + if (F_status_is_error(status)) return status; + } return F_okay; } @@ -27,11 +29,13 @@ extern "C" { if (!arguments) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status_t status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments); - if (F_status_is_error(status)) return status; + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &arguments->array, &arguments->used, &arguments->size); + if (F_status_is_error(status)) return status; - status = private_fll_execute_arguments_add_parameter(prefix, name, value, arguments); - if (F_status_is_error(status)) return status; + status = private_fll_execute_arguments_add_parameter(prefix, name, value, arguments); + if (F_status_is_error(status)) return status; + } return F_okay; } @@ -43,7 +47,7 @@ extern "C" { if (!arguments) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status_t status = f_string_dynamics_increase_by(size, arguments); + f_status_t status = f_memory_array_increase_by(size, sizeof(f_string_dynamic_t), (void **) &arguments->array, &arguments->used, &arguments->size); for (f_number_unsigned_t i = 0; F_status_is_error_not(status) && i < size; ++i) { @@ -60,7 +64,7 @@ extern "C" { if (!arguments) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status_t status = f_string_dynamics_increase_by(size, arguments); + f_status_t status = f_memory_array_increase_by(size, sizeof(f_string_dynamic_t), (void **) &arguments->array, &arguments->used, &arguments->size); for (f_number_unsigned_t i = 0; F_status_is_error_not(status) && i < size; ++i) { @@ -135,10 +139,10 @@ extern "C" { status = fl_environment_path_explode(path, &paths); } - f_string_dynamic_resize(0, &path); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path.string, &path.used, &path.size); if (F_status_is_error(status)) { - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); return status; } @@ -174,14 +178,14 @@ extern "C" { } if (F_status_is_error(status)) { - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); return status; } } // for if (!found) { - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); return F_status_set_error(F_file_found_not); } @@ -192,7 +196,7 @@ extern "C" { memcpy(&program_path, found->string, sizeof(f_char_t) * found->used); - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); fixed_arguments[0] = program_path; @@ -312,7 +316,7 @@ extern "C" { status = f_file_exists(program.used ? program : arguments.array[0], F_true); if (status != F_true) { - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); return F_status_set_error(F_file_found_not); } @@ -335,10 +339,10 @@ extern "C" { status = fl_environment_path_explode(path, &paths); } - f_string_dynamic_resize(0, &path); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path.string, &path.used, &path.size); if (F_status_is_error(status)) { - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); return status; } @@ -374,14 +378,14 @@ extern "C" { } if (F_status_is_error(status)) { - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); return status; } } // for if (!found) { - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); return F_status_set_error(F_file_found_not); } @@ -395,7 +399,7 @@ extern "C" { program_name.string = program_path; program_name.used = found->used; - f_string_dynamics_resize(0, &paths); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &paths.array, &paths.used, &paths.size, &f_string_dynamics_delete_callback); if (parameter && (parameter->option & FL_execute_parameter_option_path_d)) { fixed_arguments[0] = program_path; diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index 2f848bc..be74a00 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -71,12 +71,12 @@ extern "C" { * F_okay on success. * * 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_dynamics_increase(). + * Errors (with error bit) from: f_memory_array_resize(). + * Errors (with error bit) from: f_memory_array_increase(). * * @see f_string_dynamic_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamics_increase() + * @see f_memory_array_resize() + * @see f_memory_array_increase() */ #ifndef _di_fll_execute_arguments_add_ extern f_status_t fll_execute_arguments_add(const f_string_static_t source, f_string_dynamics_t * const arguments); @@ -107,12 +107,12 @@ extern "C" { * F_okay 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_dynamics_increase(). + * Errors (with error bit) from: f_memory_array_resize(). + * Errors (with error bit) from: f_memory_array_increase(). * * @see f_string_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamics_increase() + * @see f_memory_array_resize() + * @see f_memory_array_increase() */ #ifndef _di_fll_execute_arguments_add_parameter_ 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 * const arguments); @@ -145,12 +145,12 @@ extern "C" { * F_okay 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_dynamics_increase(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_resize(). * * @see f_string_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamics_increase() + * @see f_memory_array_increase() + * @see f_memory_array_resize() */ #ifndef _di_fll_execute_arguments_add_parameter_set_ 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_number_unsigned_t size, f_string_dynamics_t * const arguments); @@ -173,12 +173,12 @@ extern "C" { * F_okay 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_dynamics_increase(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_resize(). * * @see f_string_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamics_increase() + * @see f_memory_array_increase() + * @see f_memory_array_resize() */ #ifndef _di_fll_execute_arguments_add_set_ extern f_status_t fll_execute_arguments_add_set(const f_string_static_t source[], const f_number_unsigned_t size, f_string_dynamics_t *arguments); @@ -310,8 +310,7 @@ extern "C" { * Errors (with error bit) from: f_limit_process(). * Errors (with error bit) from: f_signal_mask(). * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamics_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * Errors (with error bit) from: f_thread_signal_mask(). * Errors (with error bit) from: fl_environment_path_explode(). * @@ -341,7 +340,7 @@ extern "C" { * @see f_limit_process() * @see f_signal_mask() * @see f_string_dynamic_append() - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() * @see f_thread_signal_mask() * @see fl_control_group_apply() * @see fl_environment_path_explode() diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index bdb5a04..ccbdbbf 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -10,11 +10,13 @@ extern "C" { arguments->array[arguments->used].used = 0; - f_status_t status = f_string_dynamic_increase_by(source.used + 1, &arguments->array[arguments->used]); - if (F_status_is_error(status)) return status; + { + f_status_t status = f_memory_array_increase_by(source.used + 1, sizeof(f_char_t), (void **) &arguments->array[arguments->used].string, &arguments->array[arguments->used].used, &arguments->array[arguments->used].size); + if (F_status_is_error(status)) return status; - status = f_string_dynamic_append(source, &arguments->array[arguments->used]); - if (F_status_is_error(status)) return status; + status = f_string_dynamic_append(source, &arguments->array[arguments->used]); + if (F_status_is_error(status)) return status; + } ++arguments->used; @@ -27,24 +29,26 @@ extern "C" { arguments->array[arguments->used].used = 0; - f_status_t status = f_string_dynamic_increase_by(prefix.used + name.used + 1, &arguments->array[arguments->used]); - if (F_status_is_error(status)) return status; + { + f_status_t status = f_memory_array_increase_by(prefix.used + name.used + 1, sizeof(f_char_t), (void **) &arguments->array[arguments->used].string, &arguments->array[arguments->used].used, &arguments->array[arguments->used].size); + if (F_status_is_error(status)) return status; - status = f_string_dynamic_append(prefix, &arguments->array[arguments->used]); - if (F_status_is_error(status)) return status; + status = f_string_dynamic_append(prefix, &arguments->array[arguments->used]); + if (F_status_is_error(status)) return status; - ++arguments->used; + ++arguments->used; - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments); - if (F_status_is_error(status)) return status; + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &arguments->array, &arguments->used, &arguments->size); + if (F_status_is_error(status)) return status; - arguments->array[arguments->used].used = 0; + arguments->array[arguments->used].used = 0; - status = f_string_dynamic_increase_by(value.used + 1, &arguments->array[arguments->used]); - if (F_status_is_error(status)) return status; + status = f_memory_array_increase_by(value.used + 1, sizeof(f_char_t), (void **) &arguments->array[arguments->used].string, &arguments->array[arguments->used].used, &arguments->array[arguments->used].size); + if (F_status_is_error(status)) return status; - status = f_string_dynamic_append(value, &arguments->array[arguments->used]); - if (F_status_is_error(status)) return status; + status = f_string_dynamic_append(value, &arguments->array[arguments->used]); + if (F_status_is_error(status)) return status; + } ++arguments->used; @@ -272,7 +276,7 @@ extern "C" { f_file_read_block(file, &response); if (!response.used || response.string[0] == f_string_ascii_1_s.string[0]) { - f_string_dynamic_resize(0, &response); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &response.string, &response.used, &response.size); close(descriptors[0]); @@ -289,7 +293,7 @@ extern "C" { return F_child; } - f_string_dynamic_resize(0, &response); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &response.string, &response.used, &response.size); } if (parameter && parameter->signals) { @@ -454,7 +458,7 @@ extern "C" { f_file_read_block(file, &response); if (!response.used || response.string[0] == f_string_ascii_1_s.string[0]) { - f_string_dynamic_resize(0, &response); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &response.string, &response.used, &response.size); close(descriptors[0]); @@ -471,7 +475,7 @@ extern "C" { return F_child; } - f_string_dynamic_resize(0, &response); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &response.string, &response.used, &response.size); } if (parameter && parameter->signals) { diff --git a/level_2/fll_execute/c/private-execute.h b/level_2/fll_execute/c/private-execute.h index eb32fa4..3b4e4e2 100644 --- a/level_2/fll_execute/c/private-execute.h +++ b/level_2/fll_execute/c/private-execute.h @@ -28,13 +28,13 @@ extern "C" { * @return * F_okay on success. * - * 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_dynamics_increase(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_increase_by() - * @see f_string_dynamic_resize() - * @see f_string_dynamics_increase() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() + * @see f_memory_array_resize() */ #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 * const arguments) F_attribute_visibility_internal_d; @@ -58,12 +58,12 @@ extern "C" { * F_okay 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_dynamics_increase(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_resize(). * * @see f_string_append() - * @see f_string_dynamic_resize() - * @see f_string_dynamics_increase() + * @see f_memory_array_increase() + * @see f_memory_array_resize() * @see fll_execute_arguments_add_parameter() * @see fll_execute_arguments_add_parameter_set() * @see fll_execute_arguments_dynamic_add_parameter() diff --git a/level_2/fll_file/c/private-file.c b/level_2/fll_file/c/private-file.c index 4171c63..5daa74a 100644 --- a/level_2/fll_file/c/private-file.c +++ b/level_2/fll_file/c/private-file.c @@ -60,11 +60,11 @@ extern "C" { status = f_file_mode_set(path_sub, mode); } // for - f_string_dynamics_resize(0, list[i]); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &list[i]->array, &list[i]->used, &list[i]->size, &f_string_dynamics_delete_callback); } // for } - f_string_dynamics_resize(0, &listing.unknown); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &listing.unknown.array, &listing.unknown.used, &listing.unknown.size, &f_string_dynamics_delete_callback); f_string_static_t path_sub = f_string_static_t_initialize; @@ -159,7 +159,7 @@ extern "C" { status = f_file_role_change(path_sub, uid, gid, dereference); } // for - f_string_dynamics_resize(0, list[i]); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &list[i]->array, &list[i]->used, &list[i]->size, &f_string_dynamics_delete_callback); } // for } diff --git a/level_2/fll_fss/c/fss.c b/level_2/fll_fss/c/fss.c index 2afe1b1..4fa4bed 100644 --- a/level_2/fll_fss/c/fss.c +++ b/level_2/fll_fss/c/fss.c @@ -256,7 +256,7 @@ extern "C" { return F_status_set_error(F_array_too_large); } - status = f_string_dynamics_increase_by(content->used, values[j]); + status = f_memory_array_increase_by(content->used, sizeof(f_string_dynamic_t), (void **) &values[j]->array, &values[j]->used, &values[j]->size); if (F_status_is_error(status)) return status; if (indexs) { @@ -320,7 +320,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return status; } @@ -332,7 +332,7 @@ extern "C" { status = f_compare_dynamic_partial_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return status; } @@ -344,7 +344,7 @@ extern "C" { matches[j] = F_true; } - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); break; } @@ -357,39 +357,16 @@ extern "C" { } if (values[j]->used == values[j]->size) { - if (values[j]->used + F_fss_default_allocation_step_d > F_number_t_size_unsigned_d) { - if (values[j]->used == F_number_t_size_unsigned_d) { - f_string_dynamic_resize(0, &name); + status = f_memory_array_increase(F_fss_default_allocation_step_d, sizeof(f_string_map_t), (void **) &values[j]->array, &values[j]->used, &values[j]->size); - return F_status_set_error(F_array_too_large); - } - - macro_f_string_maps_t_resize(status, (*values[j]), values[j]->used + 1); - - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); - - return status; - } - - if (indexs) { - status = f_memory_array_resize(indexs[j]->used + 1, sizeof(f_number_unsigned_t), (void **) &indexs[j]->array, &indexs[j]->used, &indexs[j]->size); - if (F_status_is_error(status)) return status; - } + if (F_status_is_error_not(status)) { + status = f_memory_array_increase(F_fss_default_allocation_step_d, sizeof(f_number_unsigned_t), (void **) &indexs[j]->array, &indexs[j]->used, &indexs[j]->size); } - else { - macro_f_string_maps_t_resize(status, (*values[j]), values[j]->used + F_fss_default_allocation_step_d); - - if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); - return status; - } + if (F_status_is_error(status)) { + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); - if (indexs) { - status = f_memory_array_increase(F_fss_default_allocation_step_d, sizeof(f_number_unsigned_t), (void **) &indexs[j]->array, &indexs[j]->used, &indexs[j]->size); - if (F_status_is_error(status)) return status; - } + return status; } } @@ -399,7 +376,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[1], &map->value); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return status; } @@ -420,7 +397,7 @@ extern "C" { } // for } // for - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return F_okay; } @@ -482,7 +459,7 @@ extern "C" { } if (contents.array[i].used > 1) { - status = f_string_dynamics_increase_by(contents.array[i].used - 1, &map_multi->value); + status = f_memory_array_increase_by(contents.array[i].used - 1, sizeof(f_string_dynamic_t), (void **) &map_multi->value.array, &map_multi->value.used, &map_multi->value.size); if (F_status_is_error(status)) return status; for (k = 1; k < contents.array[i].used; ++k) { @@ -610,7 +587,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return status; } @@ -622,7 +599,7 @@ extern "C" { status = f_compare_dynamic_partial_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return status; } @@ -667,7 +644,7 @@ extern "C" { if (contents.array[i].used == 1) continue; } - status = f_string_dynamics_increase(F_fss_default_allocation_step_small_d, &map_multi->value); + status = f_memory_array_increase(F_fss_default_allocation_step_small_d, sizeof(f_string_dynamic_t), (void **) &map_multi->value.array, &map_multi->value.used, &map_multi->value.size); if (F_status_is_error(status)) return status; for (k = 1; k < contents.array[i].used; ++k) { @@ -680,7 +657,7 @@ extern "C" { } // for } // for - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return F_okay; } @@ -727,7 +704,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return status; } @@ -739,7 +716,7 @@ extern "C" { status = f_compare_dynamic_partial_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return status; } @@ -747,7 +724,7 @@ extern "C" { if (status == F_equal_to) { matched = F_true; - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); break; } } // for @@ -786,7 +763,7 @@ extern "C" { status = f_string_dynamic_partial_mash_nulless(glue, buffer, contents.array[i].array[1], &map->value); if (F_status_is_error(status)) { - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return status; } @@ -794,7 +771,7 @@ extern "C" { } // for } // for - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return F_okay; } @@ -886,7 +863,7 @@ extern "C" { matches[j] = F_true; } - status = f_string_dynamics_increase(F_fss_default_allocation_step_small_d, values[j]); + status = f_memory_array_increase(F_fss_default_allocation_step_small_d, sizeof(f_string_dynamic_t), (void **) &values[j]->array, &values[j]->used, &values[j]->size); if (F_status_is_error(status)) return status; if (indexs) { diff --git a/level_2/fll_fss/c/fss/basic.c b/level_2/fll_fss/c/fss/basic.c index 72453cd..e1893e3 100644 --- a/level_2/fll_fss/c/fss/basic.c +++ b/level_2/fll_fss/c/fss/basic.c @@ -197,7 +197,7 @@ extern "C" { if (F_status_is_error(state->status)) return; } else { - state->status = f_string_dynamic_increase(state->step_small, destination); + state->status = f_memory_array_increase(state->step_small, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; destination->string[destination->used++] = f_string_eol_s.string[0]; diff --git a/level_2/fll_fss/c/fss/basic.h b/level_2/fll_fss/c/fss/basic.h index 4bf02dc..1f3506c 100644 --- a/level_2/fll_fss/c/fss/basic.h +++ b/level_2/fll_fss/c/fss/basic.h @@ -117,11 +117,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_basic_content_write(). * Errors (with error bit) from: fl_fss_basic_object_write(). * - * @see f_string_dynamic_increase() + * @see f_memory_array_increase() * @see fl_fss_basic_content_write() * @see fl_fss_basic_object_write() */ diff --git a/level_2/fll_fss/c/fss/basic_list.h b/level_2/fll_fss/c/fss/basic_list.h index b0c6746..328c741 100644 --- a/level_2/fll_fss/c/fss/basic_list.h +++ b/level_2/fll_fss/c/fss/basic_list.h @@ -116,11 +116,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_basic_list_content_write(). * Errors (with error bit) from: fl_fss_basic_list_object_write(). * - * @see f_string_dynamic_increase() + * @see f_memory_array_increase() * @see fl_fss_basic_list_content_write() * @see fl_fss_basic_list_object_write() */ diff --git a/level_2/fll_fss/c/fss/embedded_list.h b/level_2/fll_fss/c/fss/embedded_list.h index 5eadd03..6864e7b 100644 --- a/level_2/fll_fss/c/fss/embedded_list.h +++ b/level_2/fll_fss/c/fss/embedded_list.h @@ -121,11 +121,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_embedded_list_content_write(). * Errors (with error bit) from: fl_fss_embedded_list_object_write(). * - * @see f_string_dynamic_increase() + * @see f_memory_array_increase() * @see fl_fss_embedded_list_content_write() * @see fl_fss_embedded_list_object_write() */ diff --git a/level_2/fll_fss/c/fss/extended.h b/level_2/fll_fss/c/fss/extended.h index a0291bc..2bf678f 100644 --- a/level_2/fll_fss/c/fss/extended.h +++ b/level_2/fll_fss/c/fss/extended.h @@ -120,11 +120,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_extended_content_write(). * Errors (with error bit) from: fl_fss_extended_object_write(). * - * @see f_string_dynamic_increase() + * @see f_memory_array_increase() * @see fl_fss_extended_content_write() * @see fl_fss_extended_object_write() */ diff --git a/level_2/fll_fss/c/fss/extended_list.h b/level_2/fll_fss/c/fss/extended_list.h index 438cb17..619a546 100644 --- a/level_2/fll_fss/c/fss/extended_list.h +++ b/level_2/fll_fss/c/fss/extended_list.h @@ -125,11 +125,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_extended_list_content_write(). * Errors (with error bit) from: fl_fss_extended_list_object_write(). * - * @see f_string_dynamic_increase() + * @see f_memory_array_increase() * @see fl_fss_extended_list_content_write() * @see fl_fss_extended_list_object_write() */ diff --git a/level_2/fll_fss/c/fss/payload.c b/level_2/fll_fss/c/fss/payload.c index 4937a97..9e20a12 100644 --- a/level_2/fll_fss/c/fss/payload.c +++ b/level_2/fll_fss/c/fss/payload.c @@ -234,7 +234,7 @@ extern "C" { if (state->status == F_okay || state->status == F_okay_stop || state->status == F_okay_eos || state->status == F_okay_eol) { if (f_compare_dynamic(f_fss_payload_s, object) == F_equal_to) { - state->status = f_string_dynamic_increase_by(content.used, destination); + state->status = f_memory_array_increase_by(content.used, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; f_number_unsigned_t i = 0; diff --git a/level_2/fll_fss/c/fss/payload.h b/level_2/fll_fss/c/fss/payload.h index a50f02b..772fa61 100644 --- a/level_2/fll_fss/c/fss/payload.h +++ b/level_2/fll_fss/c/fss/payload.h @@ -143,11 +143,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_increase(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_basic_list_content_write(). * Errors (with error bit) from: fl_fss_basic_list_object_write(). * - * @see f_string_dynamic_increase() + * @see f_memory_array_increase() * @see fl_fss_basic_list_content_write() * @see fl_fss_basic_list_object_write() */ diff --git a/level_2/fll_iki/c/iki.h b/level_2/fll_iki/c/iki.h index 970376f..3ba4de6 100644 --- a/level_2/fll_iki/c/iki.h +++ b/level_2/fll_iki/c/iki.h @@ -52,11 +52,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() + * @see f_memory_array_resize() */ #ifndef _di_fll_iki_content_escape_ extern f_status_t fll_iki_content_escape(const f_string_static_t content, const f_string_static_t quote, f_string_dynamic_t * const escaped); @@ -83,11 +83,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() + * @see f_memory_array_resize() */ #ifndef _di_fll_iki_content_partial_escape_ extern f_status_t fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote, f_string_dynamic_t * const escaped); @@ -115,11 +115,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() + * @see f_memory_array_resize() */ #ifndef _di_fll_iki_content_partial_unescape_ extern f_status_t fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote, f_string_dynamic_t * const unescaped); @@ -145,11 +145,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() + * @see f_memory_array_resize() */ #ifndef _di_fll_iki_content_unescape_ extern f_status_t fll_iki_content_unescape(const f_string_static_t content, const f_string_static_t quote, f_string_dynamic_t * const unescaped); diff --git a/level_2/fll_iki/c/private-iki.c b/level_2/fll_iki/c/private-iki.c index 89d17dd..ac1b77c 100644 --- a/level_2/fll_iki/c/private-iki.c +++ b/level_2/fll_iki/c/private-iki.c @@ -12,7 +12,7 @@ extern "C" { // Ensure escaped is at least the same size as content. if (content.used > escaped->size) { - status = f_string_dynamic_resize(content.used, escaped); + status = f_memory_array_resize(content.used, sizeof(f_char_t), (void **) &escaped->string, &escaped->used, &escaped->size); if (F_status_is_error(status)) return status; } @@ -24,7 +24,7 @@ extern "C" { if (content.string[i] == quote) { if (escaped->used + delimits + 2 > escaped->size) { - status = f_string_dynamic_increase_by(delimits + 2, escaped); + status = f_memory_array_increase_by(delimits + 2, sizeof(f_char_t), (void **) &escaped->string, &escaped->used, &escaped->size); if (F_status_is_error(status)) return status; } @@ -39,7 +39,7 @@ extern "C" { } else if (content.string[i]) { if (escaped->used + 1 > escaped->size) { - status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, escaped); + status = f_memory_array_increase_by(F_memory_default_allocation_small_d, sizeof(f_char_t), (void **) &escaped->string, &escaped->used, &escaped->size); if (F_status_is_error(status)) return status; } @@ -57,7 +57,7 @@ extern "C" { // Delimits found at the end must be escaped to prevent escaping the end quote. if (delimits) { if (escaped->used + delimits > escaped->size) { - status = f_string_dynamic_increase_by(delimits, escaped); + status = f_memory_array_increase_by(delimits, sizeof(f_char_t), (void **) &escaped->string, &escaped->used, &escaped->size); if (F_status_is_error(status)) return status; } @@ -77,7 +77,7 @@ extern "C" { // Ensure escaped is at least the same size as content. if (content.used > unescaped->size) { - status = f_string_dynamic_resize(content.used, unescaped); + status = f_memory_array_resize(content.used, sizeof(f_char_t), (void **) &unescaped->string, &unescaped->used, &unescaped->size); if (F_status_is_error(status)) return status; } @@ -115,7 +115,7 @@ extern "C" { delimits /= 2; if (unescaped->used + delimits + 1 > unescaped->size) { - status = f_string_dynamic_increase_by(delimits + 1, unescaped); + status = f_memory_array_increase_by(delimits + 1, sizeof(f_char_t), (void **) &unescaped->string, &unescaped->used, &unescaped->size); if (F_status_is_error(status)) return status; } @@ -132,7 +132,7 @@ extern "C" { } else if (content.string[j]) { if (unescaped->used + (j - i) + 1 > unescaped->size) { - status = f_string_dynamic_increase_by((j - i) + 1, unescaped); + status = f_memory_array_increase_by((j - i) + 1, sizeof(f_char_t), (void **) &unescaped->string, &unescaped->used, &unescaped->size); if (F_status_is_error(status)) return status; } @@ -162,7 +162,7 @@ extern "C" { delimits /= 2; if (unescaped->used + delimits > unescaped->size) { - status = f_string_dynamic_increase_by(delimits, unescaped); + status = f_memory_array_increase_by(delimits, sizeof(f_char_t), (void **) &unescaped->string, &unescaped->used, &unescaped->size); if (F_status_is_error(status)) return status; } @@ -175,7 +175,7 @@ extern "C" { } else if (content.string[i]) { if (unescaped->used + 1 > unescaped->size) { - status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, unescaped); + status = f_memory_array_increase_by(F_memory_default_allocation_small_d, sizeof(f_char_t), (void **) &unescaped->string, &unescaped->used, &unescaped->size); if (F_status_is_error(status)) return status; } diff --git a/level_2/fll_iki/c/private-iki.h b/level_2/fll_iki/c/private-iki.h index 5a7a3bf..caf3920 100644 --- a/level_2/fll_iki/c/private-iki.h +++ b/level_2/fll_iki/c/private-iki.h @@ -36,11 +36,11 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() + * @see f_memory_array_resize() */ #if !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_) extern f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const f_char_t quote, f_string_dynamic_t * const escaped) F_attribute_visibility_internal_d; @@ -68,11 +68,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * - * Errors (with error bit) from: f_string_dynamic_resize(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * - * @see f_string_dynamic_resize() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() + * @see f_memory_array_resize() */ #if !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_) extern f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const f_char_t quote, f_string_dynamic_t * const unescaped) F_attribute_visibility_internal_d; diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index 6a2b45c..6d15b31 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -115,7 +115,7 @@ extern "C" { for (f_number_unsigned_t i = 0; i < values.used; ++i) { if (arguments[values.array[i]].used) { - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, destination); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) break; destination->array[destination->used].used = 0; @@ -175,7 +175,7 @@ extern "C" { for (f_number_unsigned_t i = 0; i < values.used; ++i) { if (arguments[values.array[i]].used) { - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, destination); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) break; destination->array[destination->used].used = 0; @@ -224,7 +224,7 @@ extern "C" { } } // for - f_string_dynamic_resize(0, &ripped); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &ripped.string, &ripped.used, &ripped.size); if (F_status_is_error(status)) return status; if (start == destination->used) return F_data_not; diff --git a/level_2/fll_program/c/program/print.c b/level_2/fll_program/c/program/print.c index 3ce37ca..5aa0ca8 100644 --- a/level_2/fll_program/c/program/print.c +++ b/level_2/fll_program/c/program/print.c @@ -63,10 +63,10 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe%] ", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, variable, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, variable, print->set->notable); fl_print_format("%[ is missing or has a length of%] ", print->to, print->set->error, print->set->error); fl_print_format("%[0%]", print->to, print->set->notable, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -241,12 +241,12 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value, print->set->notable); fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); fl_print_format("%[' must not be less than %]", print->to, print->set->error, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, than, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, than, print->set->notable); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -265,12 +265,12 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value, print->set->notable); fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); fl_print_format("%[' must not be more than %]", print->to, print->set->error, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, than, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, than, print->set->notable); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -289,7 +289,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value, print->set->notable); fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); fl_print_format("%[' is not a valid integer.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); @@ -311,7 +311,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value, print->set->notable); fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); fl_print_format("%[' is not a valid negative integer.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); @@ -333,7 +333,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value, print->set->notable); fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); fl_print_format("%[' is not a valid positive integer.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); @@ -377,7 +377,7 @@ extern "C" { fl_print_format("%[%QThe parameter%] ", print->to, print->set->error, print->prefix, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); fl_print_format("%[ is specified, but%] ", print->to, print->set->error, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, amount, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, amount, print->set->notable); fl_print_format(" %[values are not given.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -420,7 +420,7 @@ extern "C" { fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, value, print->set->notable); fl_print_format("%[' may only be specified once for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -440,7 +440,7 @@ extern "C" { fl_print_format("%[%QFailure while processing the parameter '%]", print->to, print->set->error, print->prefix, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -459,12 +459,12 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe start range value '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value_start, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value_start, print->set->notable); fl_print_format("%[' may not be greater than the stop value '%]", print->to, print->set->error, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value_stop, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value_stop, print->set->notable); fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -657,7 +657,7 @@ extern "C" { fl_print_format("%]%[Received signal code %]", print->to, print->set->reset, print->set->warning, print->set->warning); fl_print_format("%[%u%]", print->to, print->set->notable, signal, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->warning, print->set->warning, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->warning, print->set->warning, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/byte_dump/c/main/common.c b/level_3/byte_dump/c/main/common.c index f342cee..ab1ab90 100644 --- a/level_3/byte_dump/c/main/common.c +++ b/level_3/byte_dump/c/main/common.c @@ -335,14 +335,14 @@ extern "C" { } if (main->program.parameters.remaining.used) { - main->setting.state.status = f_string_dynamics_increase_by(main->program.parameters.remaining.used, &main->setting.files); + main->setting.state.status = f_memory_array_increase_by(main->program.parameters.remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.files.array, &main->setting.files.used, &main->setting.files.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & byte_dump_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - byte_dump_print_error(&main->program.error, macro_byte_dump_f(f_string_dynamics_increase_by)); + byte_dump_print_error(&main->program.error, macro_byte_dump_f(f_memory_array_increase_by)); return; } diff --git a/level_3/byte_dump/c/main/common/print.c b/level_3/byte_dump/c/main/common/print.c index b989ef3..c89e350 100644 --- a/level_3/byte_dump/c/main/common/print.c +++ b/level_3/byte_dump/c/main/common/print.c @@ -10,7 +10,7 @@ extern "C" { "f_console_parameter_process", "f_file_exists", "f_file_stream_open", - "f_string_dynamics_increase_by", + "f_memory_array_increase_by", "f_thread_create", "fl_conversion_dynamic_to_unsigned_detect", "fll_program_parameter_process_context_standard", diff --git a/level_3/byte_dump/c/main/common/print.h b/level_3/byte_dump/c/main/common/print.h index b97bc89..fbdc29c 100644 --- a/level_3/byte_dump/c/main/common/print.h +++ b/level_3/byte_dump/c/main/common/print.h @@ -43,7 +43,7 @@ extern "C" { byte_dump_f_f_console_parameter_process_e, byte_dump_f_f_file_exists_e, byte_dump_f_f_file_stream_open_e, - byte_dump_f_f_string_dynamics_increase_by_e, + byte_dump_f_f_memory_array_increase_by_e, byte_dump_f_f_thread_create_e, byte_dump_f_fl_conversion_dynamic_to_unsigned_detect_e, byte_dump_f_fll_program_parameter_process_context_standard_e, diff --git a/level_3/byte_dump/c/main/common/type.c b/level_3/byte_dump/c/main/common/type.c index c492d91..444cbc4 100644 --- a/level_3/byte_dump/c/main/common/type.c +++ b/level_3/byte_dump/c/main/common/type.c @@ -19,7 +19,7 @@ extern "C" { if (!setting) return F_status_set_error(F_parameter); - f_string_dynamics_resize(0, &setting->files); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->files.array, &setting->files.used, &setting->files.size, &f_string_dynamics_delete_callback); return F_okay; } diff --git a/level_3/byte_dump/c/main/print/error.c b/level_3/byte_dump/c/main/print/error.c index 79b6999..1da1b9c 100644 --- a/level_3/byte_dump/c/main/print/error.c +++ b/level_3/byte_dump/c/main/print/error.c @@ -39,8 +39,8 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%r%[Invalid UTF-8 codes were detected for file '%]", print->to, f_string_eol_s, print->set->error, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, name.used ? name : f_string_ascii_minus_s, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, name.used ? name : f_string_ascii_minus_s, print->set->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -69,7 +69,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%Qread() failed for '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, name.used ? name : f_string_ascii_minus_s, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, name.used ? name : f_string_ascii_minus_s, print->set->notable); fl_print_format("%['.%]%r%r", print->to, print->set->error, print->set->error, f_string_eol_s, f_string_eol_s); f_file_stream_unlock(print->to); @@ -96,7 +96,7 @@ extern "C" { fl_print_format("%[%ul%]", print->to, print->set->notable, main->setting.last, print->set->notable); fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%r%r%]", print->to, print->set->notable, f_console_symbol_long_normal_s, byte_dump_long_last_s, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -113,14 +113,14 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, number, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, number, print->set->notable); fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%r%Q%]", print->to, print->set->notable, f_console_symbol_long_normal_s, name, print->set->notable); fl_print_format("%[' can only be a number (inclusively) between %]", print->to, print->set->error, print->set->error); fl_print_format("%[ul%]", print->to, print->set->notable, minimum, print->set->notable); fl_print_format(" %[and%] ", print->to, print->set->error, print->set->error); fl_print_format("%[ul%]", print->to, print->set->notable, maximum, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/control/c/main/common.c b/level_3/control/c/main/common.c index 375979f..a29e3f9 100644 --- a/level_3/control/c/main/common.c +++ b/level_3/control/c/main/common.c @@ -442,28 +442,28 @@ extern "C" { main->cache.large.used = 0; if (main->cache.large.size > control_default_buffer_limit_soft_large_d) { - main->setting.state.status = f_string_dynamic_resize(control_default_buffer_limit_soft_large_d, &main->cache.large); + main->setting.state.status = f_memory_array_resize(control_default_buffer_limit_soft_large_d, sizeof(f_char_t), (void **) &main->cache.large.string, &main->cache.large.used, &main->cache.large.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & control_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - control_print_error(&main->program.error, macro_control_f(f_string_dynamic_resize)); + control_print_error(&main->program.error, macro_control_f(f_memory_array_resize)); return; } } if (main->program.parameters.remaining.used) { - main->setting.state.status = f_string_dynamics_increase_by(main->program.parameters.remaining.used, &main->setting.actions); + main->setting.state.status = f_memory_array_increase_by(main->program.parameters.remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.actions.array, &main->setting.actions.used, &main->setting.actions.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & control_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - control_print_error(&main->program.error, macro_control_f(f_string_dynamics_increase_by)); + control_print_error(&main->program.error, macro_control_f(f_memory_array_increase_by)); return; } diff --git a/level_3/control/c/main/common/print.c b/level_3/control/c/main/common/print.c index 99c5491..046aa49 100644 --- a/level_3/control/c/main/common/print.c +++ b/level_3/control/c/main/common/print.c @@ -15,13 +15,13 @@ extern "C" { "f_file_stream_open", "f_file_stream_read", "f_fss_apply_delimit", + "f_memory_array_increase_by", + "f_memory_array_resize", "f_socket_connect", "f_socket_create", "f_string_dynamic_append", "f_string_dynamic_append_assure", "f_string_dynamic_partial_append_nulless", - "f_string_dynamic_resize", - "f_string_dynamics_increase_by", "f_thread_create", "fll_fss_extended_read", "fll_program_parameter_process_context_standard", diff --git a/level_3/control/c/main/common/print.h b/level_3/control/c/main/common/print.h index 5826af1..9dd3584 100644 --- a/level_3/control/c/main/common/print.h +++ b/level_3/control/c/main/common/print.h @@ -48,13 +48,13 @@ extern "C" { control_f_f_file_stream_open_e, control_f_f_file_stream_read_e, control_f_f_fss_apply_delimit_e, + control_f_f_memory_array_increase_by_e, + control_f_f_memory_array_resize_e, control_f_f_socket_connect_e, control_f_f_socket_create_e, control_f_f_string_dynamic_append_e, control_f_f_string_dynamic_append_assure_e, control_f_f_string_dynamic_partial_append_nulless_e, - control_f_f_string_dynamic_resize_e, - control_f_f_string_dynamics_increase_by_e, control_f_f_thread_create_e, control_f_fll_fss_extended_read_e, control_f_fll_program_parameter_process_context_standard_e, diff --git a/level_3/control/c/main/common/type.c b/level_3/control/c/main/common/type.c index 9d67178..ec6ca68 100644 --- a/level_3/control/c/main/common/type.c +++ b/level_3/control/c/main/common/type.c @@ -12,9 +12,9 @@ extern "C" { fll_program_data_delete(&main->program); control_setting_delete(&main->setting); - f_string_dynamic_resize(0, &main->cache.large); - f_string_dynamic_resize(0, &main->cache.small); - f_string_dynamic_resize(0, &main->cache.packet); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache.large.string, &main->cache.large.used, &main->cache.large.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache.small.string, &main->cache.small.used, &main->cache.small.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache.packet.string, &main->cache.packet.used, &main->cache.packet.size); f_string_ranges_resize(0, &main->cache.objects); f_string_rangess_resize(0, &main->cache.contents); @@ -34,11 +34,11 @@ extern "C" { if (!setting) return F_status_set_error(F_parameter); - f_string_dynamic_resize(0, &setting->name_socket); - f_string_dynamic_resize(0, &setting->path_settings); - f_string_dynamic_resize(0, &setting->path_socket); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->name_socket.string, &setting->name_socket.used, &setting->name_socket.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->path_settings.string, &setting->path_settings.used, &setting->path_settings.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->path_socket.string, &setting->path_socket.used, &setting->path_socket.size); - f_string_dynamics_resize(0, &setting->actions); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->actions.array, &setting->actions.used, &setting->actions.size, &f_string_dynamics_delete_callback); return F_okay; } diff --git a/level_3/control/c/main/common/type.h b/level_3/control/c/main/common/type.h index 192320e..599ee38 100644 --- a/level_3/control/c/main/common/type.h +++ b/level_3/control/c/main/common/type.h @@ -182,7 +182,6 @@ extern "C" { * This does not alter main.setting.state.status. * * @see f_memory_array_resize() - * @see f_string_dynamic_resize() * @see f_string_ranges_resize() * @see f_string_rangess_resize() * @see fll_program_data_delete() @@ -204,8 +203,8 @@ extern "C" { * * F_parameter (with error bit) if a parameter is invalid. * - * @see f_string_dynamic_resize() - * @see f_string_dynamics_resize() + * @see f_memory_array_resize() + * @see f_memory_arrays_resize() */ #ifndef _di_control_setting_delete_ extern f_status_t control_setting_delete(control_setting_t * const setting); diff --git a/level_3/control/c/main/packet.c b/level_3/control/c/main/packet.c index 55a12cf..e0dfdfc 100644 --- a/level_3/control/c/main/packet.c +++ b/level_3/control/c/main/packet.c @@ -40,7 +40,7 @@ extern "C" { return; } - main->setting.state.status = f_string_dynamic_resize(length, &main->cache.packet); + main->setting.state.status = f_memory_array_resize(length, sizeof(f_char_t), (void **) &main->cache.packet.string, &main->cache.packet.used, &main->cache.packet.size); if (F_status_is_error(main->setting.state.status)) return; } @@ -200,7 +200,7 @@ extern "C" { return; } - main->setting.state.status = f_string_dynamic_increase_by(length, &main->cache.large); + main->setting.state.status = f_memory_array_increase_by(length, sizeof(f_char_t), (void **) &main->cache.large.string, &main->cache.large.used, &main->cache.large.size); if (F_status_is_error(main->setting.state.status)) return; main->setting.state.status = f_socket_read(&main->setting.socket, f_socket_flag_wait_all_e, (void *) head, &length); diff --git a/level_3/control/c/main/packet.h b/level_3/control/c/main/packet.h index 2c50698..bf8fc1d 100644 --- a/level_3/control/c/main/packet.h +++ b/level_3/control/c/main/packet.h @@ -27,15 +27,15 @@ extern "C" { * * F_too_large (with error bit) If the message is too large for the packet format to transmit. * + * Errors (with error bit) from: f_memory_array_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: fll_fss_extended_write(). * Errors (with error bit) from: fll_fss_payload_write(). * + * @see f_memory_array_resize() * @see f_string_append() * @see f_string_dynamic_append() - * @see f_string_dynamic_resize() */ #ifndef _di_control_packet_build_ extern void control_packet_build(control_main_t * const main); @@ -90,16 +90,16 @@ extern "C" { * F_too_large (with error bit) If the received packet specifies a size that is too large or the actual size is larger than the specified size. * F_too_small (with error bit) If the received packet actual size is smaller than the specified size. * + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_socket_read(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). * Errors (with error bit) from: fl_conversion_dynamic_partial_to_unsigned_detect(). * Errors (with error bit) from: fll_fss_extended_read(). * Errors (with error bit) from: fll_fss_basic_list_read(). * @param header * The control payload packet header data. * + * @see f_memory_array_increase_by() * @see f_socket_read() - * @see f_string_dynamic_increase_by() * @see fl_conversion_dynamic_partial_to_unsigned_detect() * @see f_fss_apply_delimit() * @see fl_status_string_from() diff --git a/level_3/control/c/main/print/error.c b/level_3/control/c/main/print/error.c index 21f04fa..f469e0a 100644 --- a/level_3/control/c/main/print/error.c +++ b/level_3/control/c/main/print/error.c @@ -41,9 +41,9 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QReceived error response for " CONTROL_action_s " '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%q%]", print->to, print->set->notable, control_action_type_name(header.action), print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, control_action_type_name(header.action), print->set->notable); fl_print_format("%[' with status '%]", print->to, print->set->error, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, string_status, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, string_status, print->set->notable); fl_print_format("%[' (%]", print->to, print->set->error, print->set->error); fl_print_format("%[%ui%]", print->to, print->set->notable, header.status, print->set->notable); @@ -71,9 +71,9 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, control_action_type_name(header.action), print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, control_action_type_name(header.action), print->set->notable); fl_print_format("%[' failed with status '%]", print->to, print->set->error, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, string_status, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, string_status, print->set->notable); fl_print_format("%[' (%]", print->to, print->set->error, print->set->error); fl_print_format("%[%ui%]", print->to, print->set->notable, header.status, print->set->notable); @@ -111,7 +111,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' is not a known controller action.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -129,7 +129,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' a rule base name cannot be an empty string.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -147,7 +147,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' a rule directory path cannot be an empty string.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -165,7 +165,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' a rule name cannot be an empty string.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -183,7 +183,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' requires either a full rule name or a rule directory path along with the rule base name.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -201,7 +201,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' has too few arguments.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -219,9 +219,9 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' when used with '%]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format("%[%Q%]", print->to, print->set->notable, with, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, with, print->set->notable); fl_print_format("%[' has too few arguments.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -239,7 +239,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' has too many arguments.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -257,9 +257,9 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' when used with '%]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format("%[%Q%]", print->to, print->set->notable, with, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, with, print->set->notable); fl_print_format("%[' has too many arguments.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -277,10 +277,10 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action parameter '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, action, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, action, print->set->notable); fl_print_format("%[' does not know the argument '%]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format("%[%Q%]", print->to, print->set->notable, with, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, with, print->set->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -369,8 +369,8 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QFailed to connect to the socket file '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, path_socket, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, path_socket, print->set->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -387,7 +387,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe controller socket file '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, path_socket, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, path_socket, print->set->notable); fl_print_format("%[' could not be found and is required.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -405,7 +405,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe controller socket file '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, path_socket, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, path_socket, print->set->notable); fl_print_format("%[' is not a socket file.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/control/c/main/print/message.c b/level_3/control/c/main/print/message.c index 0a7c034..ed68aff 100644 --- a/level_3/control/c/main/print/message.c +++ b/level_3/control/c/main/print/message.c @@ -55,7 +55,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("The action '", print->to); - fl_print_format("%[%q%]", print->to, print->set->notable, control_action_type_name(header.action), print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, control_action_type_name(header.action), print->set->notable); if (header.status == F_done) { fl_print_format("' is performed", print->to); diff --git a/level_3/control/c/main/print/warning.c b/level_3/control/c/main/print/warning.c index 74a902d..da05cc4 100644 --- a/level_3/control/c/main/print/warning.c +++ b/level_3/control/c/main/print/warning.c @@ -13,7 +13,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe received response header '%]", print->to, print->set->warning, print->prefix, print->set->warning); - fl_print_format("%[%Q%]", print->to, print->set->notable, response_header, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, response_header, print->set->notable); fl_print_format("%[' is repeated.%]%r", print->to, print->set->warning, print->set->warning, f_string_eol_s); f_file_stream_unlock(print->to); @@ -34,7 +34,7 @@ extern "C" { fl_print_format("%[%ui%]", print->to, print->set->notable, status_of, print->set->notable); fl_print_format("%[, failing with status code%] ", print->to, print->set->warning, status_error, print->set->warning); fl_print_format("%[%ui%]", print->to, print->set->notable, status_error, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->warning, print->set->warning, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->warning, print->set->warning, f_string_eol_s); f_file_stream_unlock(print->to); @@ -51,7 +51,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe action '%]", print->to, print->set->warning, print->prefix, print->set->warning); - fl_print_format("%[%q%]", print->to, print->set->notable, control_action_type_name(header.action), print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, control_action_type_name(header.action), print->set->notable); fl_print_format("%[' could not be performed because the service is busy.%]%r", print->to, print->set->warning, print->set->warning, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/controller/c/common.c b/level_3/controller/c/common.c index 1d47805..b02580b 100644 --- a/level_3/controller/c/common.c +++ b/level_3/controller/c/common.c @@ -219,8 +219,8 @@ extern "C" { macro_f_color_context_t_delete_simple(main->program.context); - f_string_dynamic_resize(0, &main->program.path_pid); - f_string_dynamic_resize(0, &main->program.path_setting); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->program.path_pid.string, &main->program.path_pid.used, &main->program.path_pid.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->program.path_setting.string, &main->program.path_setting.used, &main->program.path_setting.size); return F_okay; } diff --git a/level_3/controller/c/common/private-cache.c b/level_3/controller/c/common/private-cache.c index 017e7c4..f2692c4 100644 --- a/level_3/controller/c/common/private-cache.c +++ b/level_3/controller/c/common/private-cache.c @@ -8,21 +8,21 @@ extern "C" { #ifndef _di_controller_cache_action_delete_simple_ void controller_cache_action_delete_simple(controller_cache_action_t * const cache) { - f_string_dynamic_resize(0, &cache->name_action); - f_string_dynamic_resize(0, &cache->name_file); - f_string_dynamic_resize(0, &cache->name_item); - f_string_dynamic_resize(0, &cache->generic); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &cache->name_action.string, &cache->name_action.used, &cache->name_action.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &cache->name_file.string, &cache->name_file.used, &cache->name_file.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &cache->name_item.string, &cache->name_item.used, &cache->name_item.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &cache->generic.string, &cache->generic.used, &cache->generic.size); } #endif // _di_controller_cache_action_delete_simple_ #ifndef _di_controller_cache_delete_simple_ void controller_cache_delete_simple(controller_cache_t * const cache) { - f_string_dynamic_resize(0, &cache->buffer_file); - f_string_dynamic_resize(0, &cache->buffer_item); - f_string_dynamic_resize(0, &cache->buffer_path); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &cache->buffer_file.string, &cache->buffer_file.used, &cache->buffer_file.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &cache->buffer_item.string, &cache->buffer_item.used, &cache->buffer_item.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &cache->buffer_path.string, &cache->buffer_path.used, &cache->buffer_path.size); - f_string_dynamics_resize(0, &cache->expanded); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &cache->expanded.array, &cache->expanded.used, &cache->expanded.size, &f_string_dynamics_delete_callback); f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &cache->stack.array, &cache->stack.used, &cache->stack.size); diff --git a/level_3/controller/c/common/private-cache.h b/level_3/controller/c/common/private-cache.h index 5048a29..95f0a7f 100644 --- a/level_3/controller/c/common/private-cache.h +++ b/level_3/controller/c/common/private-cache.h @@ -125,7 +125,7 @@ extern "C" { * @param cache * The cache to deallocate. * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_controller_cache_action_delete_simple_ extern void controller_cache_action_delete_simple(controller_cache_action_t * const cache) F_attribute_visibility_internal_d; @@ -140,7 +140,6 @@ extern "C" { * @see controller_cache_action_delete_simple() * * @see f_memory_array_resize() - * @see f_string_dynamic_resize() * @see f_string_ranges_resize() * @see f_string_rangess_resize() */ diff --git a/level_3/controller/c/common/private-control.c b/level_3/controller/c/common/private-control.c index 9ae947e..5a27322 100644 --- a/level_3/controller/c/common/private-control.c +++ b/level_3/controller/c/common/private-control.c @@ -8,12 +8,12 @@ extern "C" { #ifndef _di_controller_control_delete_simple_ void controller_control_delete_simple(controller_control_t * const control) { - f_string_dynamic_resize(0, &control->cache_1); - f_string_dynamic_resize(0, &control->cache_2); - f_string_dynamic_resize(0, &control->cache_3); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &control->cache_1.string, &control->cache_1.used, &control->cache_1.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &control->cache_2.string, &control->cache_2.used, &control->cache_2.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &control->cache_3.string, &control->cache_3.used, &control->cache_3.size); - f_string_dynamic_resize(0, &control->input); - f_string_dynamic_resize(0, &control->output); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &control->input.string, &control->input.used, &control->input.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &control->output.string, &control->output.used, &control->output.size); } #endif // _di_controller_control_delete_simple_ diff --git a/level_3/controller/c/common/private-entry.c b/level_3/controller/c/common/private-entry.c index f59aba7..08a2372 100644 --- a/level_3/controller/c/common/private-entry.c +++ b/level_3/controller/c/common/private-entry.c @@ -8,21 +8,21 @@ extern "C" { #ifndef _di_controller_entry_action_delete_simple_ void controller_entry_action_delete_simple(controller_entry_action_t * const action) { - f_string_dynamics_resize(0, &action->parameters); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size, &f_string_dynamics_delete_callback); } #endif // _di_controller_entry_action_delete_simple_ #ifndef _di_controller_entry_actions_delete_simple_ void controller_entry_actions_delete_simple(controller_entry_actions_t * const actions) { + // @todo Determine if this should be replaced with a resize callback strategy. actions->used = actions->size; while (actions->used) { controller_entry_action_delete_simple(&actions->array[--actions->used]); } // while - f_memory_delete(actions->size, sizeof(controller_entry_action_t), (void **) & actions->array); - actions->size = 0; + f_memory_array_resize(0, sizeof(controller_entry_action_t), (void **) &actions->array, &actions->used, &actions->size); } #endif // _di_controller_entry_actions_delete_simple_ @@ -52,7 +52,7 @@ extern "C" { #ifndef _di_controller_entry_item_delete_simple_ void controller_entry_item_delete_simple(controller_entry_item_t * const item) { - f_string_dynamic_resize(0, &item->name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &item->name.string, &item->name.used, &item->name.size); controller_entry_actions_delete_simple(&item->actions); } @@ -61,14 +61,14 @@ extern "C" { #ifndef _di_controller_entry_items_delete_simple_ void controller_entry_items_delete_simple(controller_entry_items_t * const items) { + // @todo Determine if this should be replaced with a resize callback strategy. items->used = items->size; while (items->used) { controller_entry_item_delete_simple(&items->array[--items->used]); } // while - f_memory_delete(items->size, sizeof(controller_entry_item_t), (void **) & items->array); - items->size = 0; + f_memory_array_resize(0, sizeof(controller_entry_item_t), (void **) &items->array, &items->used, &items->size); } #endif // _di_controller_entry_items_delete_simple_ diff --git a/level_3/controller/c/common/private-entry.h b/level_3/controller/c/common/private-entry.h index 9be2711..f35e861 100644 --- a/level_3/controller/c/common/private-entry.h +++ b/level_3/controller/c/common/private-entry.h @@ -272,7 +272,7 @@ extern "C" { * @param action * The action to deallocate. * - * @see f_string_dynamics_resize() + * @see f_memory_arrays_resize() */ #ifndef _di_controller_entry_action_delete_simple_ extern void controller_entry_action_delete_simple(controller_entry_action_t * const action) F_attribute_visibility_internal_d; @@ -319,7 +319,7 @@ extern "C" { * @param item * The item to deallocate. * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_controller_entry_item_delete_simple_ extern void controller_entry_item_delete_simple(controller_entry_item_t * const item) F_attribute_visibility_internal_d; diff --git a/level_3/controller/c/common/private-process.c b/level_3/controller/c/common/private-process.c index c0ef342..2be224f 100644 --- a/level_3/controller/c/common/private-process.c +++ b/level_3/controller/c/common/private-process.c @@ -62,7 +62,7 @@ extern "C" { controller_pids_resize(0, &process->childs); controller_rule_delete_simple(&process->rule); - f_string_dynamics_resize(0, &process->path_pids); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &process->path_pids.array, &process->path_pids.used, &process->path_pids.size, &f_string_dynamics_delete_callback); f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &process->stack.array, &process->stack.used, &process->stack.size); } diff --git a/level_3/controller/c/common/private-process.h b/level_3/controller/c/common/private-process.h index c20aa16..a43b575 100644 --- a/level_3/controller/c/common/private-process.h +++ b/level_3/controller/c/common/private-process.h @@ -218,7 +218,7 @@ extern "C" { * @param process * The process to deallocate. * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() * @see f_thread_condition_delete() * @see f_thread_mutex_delete() */ diff --git a/level_3/controller/c/common/private-rule.c b/level_3/controller/c/common/private-rule.c index 48d9a33..a0ba892 100644 --- a/level_3/controller/c/common/private-rule.c +++ b/level_3/controller/c/common/private-rule.c @@ -13,7 +13,8 @@ extern "C" { #ifndef _di_controller_rule_action_delete_simple_ void controller_rule_action_delete_simple(controller_rule_action_t * const action) { - f_string_dynamics_resize(0, &action->parameters); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size, &f_string_dynamics_delete_callback); + f_memory_array_resize(0, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); } #endif // _di_controller_rule_action_delete_simple_ @@ -58,16 +59,15 @@ extern "C" { #ifndef _di_controller_rule_delete_simple_ void controller_rule_delete_simple(controller_rule_t * const rule) { - f_string_dynamic_resize(0, &rule->alias); - f_string_dynamic_resize(0, &rule->engine); - f_string_dynamic_resize(0, &rule->name); - f_string_dynamic_resize(0, &rule->path); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &rule->engine.string, &rule->engine.used, &rule->engine.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &rule->name.string, &rule->name.used, &rule->name.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &rule->path.string, &rule->path.used, &rule->path.size); f_string_maps_resize(0, &rule->define); f_string_maps_resize(0, &rule->parameter); - f_string_dynamics_resize(0, &rule->engine_arguments); - f_string_dynamics_resize(0, &rule->environment); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &rule->engine_arguments.array, &rule->engine_arguments.used, &rule->engine_arguments.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &rule->environment.array, &rule->environment.used, &rule->environment.size, &f_string_dynamics_delete_callback); macro_f_int32s_t_delete_simple(rule->affinity) macro_f_control_group_t_delete_simple(rule->cgroup) @@ -86,7 +86,7 @@ extern "C" { #ifndef _di_controller_rule_item_delete_simple_ void controller_rule_item_delete_simple(controller_rule_item_t * const item) { - f_string_dynamic_resize(0, &item->pid_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &item->pid_file.string, &item->pid_file.used, &item->pid_file.size); controller_rule_actions_delete_simple(&item->actions); } @@ -109,9 +109,9 @@ extern "C" { #ifndef _di_controller_rule_on_delete_simple_ void controller_rule_on_delete_simple(controller_rule_on_t * const on) { - f_string_dynamics_resize(0, &on->need); - f_string_dynamics_resize(0, &on->want); - f_string_dynamics_resize(0, &on->wish); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &on->need.array, &on->need.used, &on->need.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &on->want.array, &on->want.used, &on->want.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &on->wish.array, &on->wish.used, &on->wish.size, &f_string_dynamics_delete_callback); } #endif // _di_controller_rule_on_delete_simple_ diff --git a/level_3/controller/c/common/private-rule.h b/level_3/controller/c/common/private-rule.h index df75278..2ff136e 100644 --- a/level_3/controller/c/common/private-rule.h +++ b/level_3/controller/c/common/private-rule.h @@ -460,7 +460,7 @@ extern "C" { * @param action * The action to deallocate. * - * @see f_string_dynamics_resize() + * @see f_memory_arrays_resize() */ #ifndef _di_controller_rule_action_delete_simple_ extern void controller_rule_action_delete_simple(controller_rule_action_t * const action) F_attribute_visibility_internal_d; @@ -515,7 +515,7 @@ extern "C" { * * @see controller_rule_items_delete_simple() * @see f_capability_delete() - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_controller_rule_delete_simple_ extern void controller_rule_delete_simple(controller_rule_t * const rule) F_attribute_visibility_internal_d; @@ -527,7 +527,7 @@ extern "C" { * @param item * The item to deallocate. * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_controller_rule_item_delete_simple_ extern void controller_rule_item_delete_simple(controller_rule_item_t * const item) F_attribute_visibility_internal_d; @@ -552,7 +552,7 @@ extern "C" { * @param on * The on to deallocate. * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_controller_rule_on_delete_simple_ extern void controller_rule_on_delete_simple(controller_rule_on_t * const on) F_attribute_visibility_internal_d; diff --git a/level_3/controller/c/common/private-setting.c b/level_3/controller/c/common/private-setting.c index f703980..8e4affe 100644 --- a/level_3/controller/c/common/private-setting.c +++ b/level_3/controller/c/common/private-setting.c @@ -8,13 +8,13 @@ extern "C" { #ifndef _di_controller_setting_delete_simple_ void controller_setting_delete_simple(controller_setting_t * const setting) { - f_string_dynamic_resize(0, &setting->name_entry); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->name_entry.string, &setting->name_entry.used, &setting->name_entry.size); - f_string_dynamic_resize(0, &setting->path_cgroup); - f_string_dynamic_resize(0, &setting->path_control); - f_string_dynamic_resize(0, &setting->path_current); - f_string_dynamic_resize(0, &setting->path_pid); - f_string_dynamic_resize(0, &setting->path_setting); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->path_cgroup.string, &setting->path_cgroup.used, &setting->path_cgroup.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->path_control.string, &setting->path_control.used, &setting->path_control.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->path_current.string, &setting->path_current.used, &setting->path_current.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->path_pid.string, &setting->path_pid.used, &setting->path_pid.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->path_setting.string, &setting->path_setting.used, &setting->path_setting.size); controller_control_delete_simple(&setting->control); diff --git a/level_3/controller/c/common/private-setting.h b/level_3/controller/c/common/private-setting.h index d37e1dc..f861cdb 100644 --- a/level_3/controller/c/common/private-setting.h +++ b/level_3/controller/c/common/private-setting.h @@ -115,7 +115,8 @@ extern "C" { * * @see controller_entry_delete_simple() * @see controller_rules_delete_simple() - * @see f_string_dynamic_resize() + * + * @see f_memory_array_resize() */ #ifndef _di_controller_setting_delete_simple_ extern void controller_setting_delete_simple(controller_setting_t * const setting) F_attribute_visibility_internal_d; diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index d30b20d..9b9e5ee 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -256,7 +256,7 @@ extern "C" { fl_print_format("%r%[%QThe parameter '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); fl_print_format("%[' must not be specified with the parameter '%]", main->error.to, main->error.context, main->error.context); fl_print_format("%[%r%r%]", main->error.to, main->context.set.notable, f_console_symbol_long_normal_s, controller_long_daemon_s, main->context.set.notable); - fl_print_format("%['.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, main->error.to, main->error.context, main->error.context, f_string_eol_s); controller_unlock_print_flush(main->error.to, 0); } @@ -345,7 +345,7 @@ extern "C" { controller_lock_print(main->warning.to, 0); fl_print_format("%r%[%QThe pid file '%]", main->warning.to, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context); - fl_print_format("%[%Q%]", main->warning.to, main->warning.notable, setting.path_pid, main->warning.notable); + fl_print_format(f_string_format_Q_single_s.string, main->warning.to, main->warning.notable, setting.path_pid, main->warning.notable); fl_print_format("%[' must not be specified with the parameter '%]", main->warning.to, main->warning.context, main->warning.context); fl_print_format("%[%i%]", main->warning.to, main->warning.notable, main->pid, main->warning.notable); fl_print_format("%[' doesn't contain the expected number, not deleting file.%]%r", main->warning.to, main->warning.context, main->warning.context, f_string_eol_s); diff --git a/level_3/controller/c/controller/private-controller.c b/level_3/controller/c/controller/private-controller.c index 91ceabc..fd48205 100644 --- a/level_3/controller/c/controller/private-controller.c +++ b/level_3/controller/c/controller/private-controller.c @@ -158,7 +158,7 @@ extern "C" { status = f_directory_exists(path_directory); } - f_string_dynamic_resize(0, &path_directory); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_directory.string, &path_directory.used, &path_directory.size); if (F_status_is_error(status)) return status; @@ -234,7 +234,7 @@ extern "C" { } } - f_string_dynamic_resize(0, &pid_buffer); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &pid_buffer.string, &pid_buffer.used, &pid_buffer.size); return status; } @@ -288,7 +288,7 @@ extern "C" { } } - f_string_dynamic_resize(0, &pid_buffer); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &pid_buffer.string, &pid_buffer.used, &pid_buffer.size); return status; } @@ -414,7 +414,7 @@ extern "C" { if (global->setting->path_control.used) { fl_print_format("%rControl socket '", global->main->output.to, f_string_eol_s); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); fl_print_format("'.%r", global->main->output.to, f_string_eol_s); } @@ -454,7 +454,7 @@ extern "C" { if (F_status_set_fine(status) == F_read_only) { fl_print_format("%r%[%QThe pid file '%]", global->main->warning.to, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context); - fl_print_format("%[%Q%]", global->main->warning.to, global->main->warning.notable, global->setting->path_pid, global->main->warning.notable); + fl_print_format(f_string_format_Q_single_s.string, global->main->warning.to, global->main->warning.notable, global->setting->path_pid, global->main->warning.notable); fl_print_format("%[' could not be written because the destination is read only.%]%r", global->main->warning.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); } else { @@ -507,7 +507,7 @@ extern "C" { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%r%[%QControl socket '%]", global->main->warning.to, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); fl_print_format("' .%r", global->main->output.to, f_string_eol_s); fl_print_format("%[' cannot be found while read only mode is enabled and so the Control socket is unavailable.%]%r", global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); @@ -528,10 +528,10 @@ extern "C" { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%r%[%QControl socket '%]", global->main->warning.to, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); fl_print_format("%[' could not be created, code %]", global->main->output.to, global->main->warning.context, global->main->warning.context); fl_print_format("%[%ui%]", global->main->output.to, global->main->context.set.notable, F_status_set_fine(status), global->main->context.set.notable); - fl_print_format("%[.%]%r", global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); controller_unlock_print_flush(global->main->output.to, global->thread); } @@ -567,10 +567,10 @@ extern "C" { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%r%[%QControl socket '%]", global->main->warning.to, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); fl_print_format("%[' could not be bound, code %]", global->main->output.to, global->main->warning.context, global->main->warning.context); fl_print_format("%[%ui%]", global->main->output.to, global->main->context.set.notable, F_status_set_fine(status), global->main->context.set.notable); - fl_print_format("%[.%]%r", global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); controller_unlock_print_flush(global->main->output.to, global->thread); } @@ -595,10 +595,10 @@ extern "C" { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%r%[%QControl socket '%]", global->main->warning.to, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); fl_print_format("%[' failed to set file roles, code %]", global->main->output.to, global->main->warning.context, global->main->warning.context); fl_print_format("%[%ui%]", global->main->output.to, global->main->context.set.notable, F_status_set_fine(status), global->main->context.set.notable); - fl_print_format("%[.%]%r", global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); controller_unlock_print_flush(global->main->output.to, global->thread); } @@ -624,10 +624,10 @@ extern "C" { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%r%[%QControl socket '%]", global->main->warning.to, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); fl_print_format("%[' failed to set file mode, code %]", global->main->output.to, global->main->warning.context, global->main->warning.context); fl_print_format("%[%ui%]", global->main->output.to, global->main->context.set.notable, F_status_set_fine(status), global->main->context.set.notable); - fl_print_format("%[.%]%r", global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, global->main->output.to, global->main->warning.context, global->main->warning.context, f_string_eol_s); controller_unlock_print_flush(global->main->output.to, global->thread); } @@ -640,7 +640,7 @@ extern "C" { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%rControl socket '", global->main->output.to, f_string_eol_s); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable); fl_print_format("' created.%r", global->main->output.to, f_string_eol_s); controller_unlock_print_flush(global->main->output.to, global->thread); diff --git a/level_3/controller/c/entry/private-entry.c b/level_3/controller/c/entry/private-entry.c index 6368b50..266d1f4 100644 --- a/level_3/controller/c/entry/private-entry.c +++ b/level_3/controller/c/entry/private-entry.c @@ -217,8 +217,8 @@ extern "C" { controller_lock_print(global.main->warning.to, global.thread); fl_print_format("%r%[%QUnknown %r item action '%]", global.main->warning.to, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context); - fl_print_format("%[%Q%]", global.main->warning.to, global.main->warning.notable, cache->action.name_action, global.main->warning.notable); - fl_print_format("%['.%]%r", global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->warning.to, global.main->warning.notable, cache->action.name_action, global.main->warning.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->warning, cache->action); @@ -263,7 +263,7 @@ extern "C" { f_file_stream_lock(global.main->error.to); fl_print_format("%r%[%QThe %r item action '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, cache->action.name_action, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, cache->action.name_action, global.main->error.notable); fl_print_format("%[' requires ", global.main->error.to, global.main->error.context); if (at_least == at_most) { @@ -304,10 +304,10 @@ extern "C" { } if (allocate) { - status = f_string_dynamics_increase_by(allocate, &action->parameters); + status = f_memory_array_increase_by(allocate, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, global.thread); action->status = status; @@ -324,10 +324,10 @@ extern "C" { if (cache->content_actions.array[i].array[j].start > cache->content_actions.array[i].array[j].stop) continue; - status = f_string_dynamic_increase_by((cache->content_actions.array[i].array[j].stop - cache->content_actions.array[i].array[j].start) + 1, &action->parameters.array[j]); + status = f_memory_array_increase_by((cache->content_actions.array[i].array[j].stop - cache->content_actions.array[i].array[j].start) + 1, sizeof(f_char_t), (void **) &action->parameters.array[j].string, &action->parameters.array[j].used, &action->parameters.array[j].size); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, global.thread); break; } @@ -404,9 +404,9 @@ extern "C" { f_file_stream_lock(global.main->error.to); fl_print_format("%r%[%QThe %r item action second parameter '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, action->parameters.array[1], global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, action->parameters.array[1], global.main->error.notable); fl_print_format("%[' must be a base path name, such as '%]", global.main->error.to, global.main->error.context, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, cache->buffer_path, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, cache->buffer_path, global.main->error.notable); fl_print_format("%['.%]", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); f_file_stream_unlock(global.main->error.to); @@ -462,7 +462,7 @@ extern "C" { fl_print_format("%[', or '%]", global.main->error.to, global.main->error.context, global.main->error.context); fl_print_format("%[%r%]", global.main->error.to, global.main->error.notable, controller_wait_s, global.main->error.notable); fl_print_format("%[' but instead has '%]", global.main->error.to, global.main->error.context, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, action->parameters.array[j], global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, action->parameters.array[j], global.main->error.notable); fl_print_format("%['.%]", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); f_file_stream_unlock(global.main->error.to); @@ -517,7 +517,7 @@ extern "C" { fl_print_format("%[', or '%]", global.main->error.to, global.main->error.context, global.main->error.context); fl_print_format("%[%r%]", global.main->error.to, global.main->error.notable, controller_stop_s, global.main->error.notable); fl_print_format("%[' but instead has '%]", global.main->error.to, global.main->error.context, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, action->parameters.array[0], global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, action->parameters.array[0], global.main->error.notable); fl_print_format("%['.%]", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); f_file_stream_unlock(global.main->error.to); @@ -554,7 +554,7 @@ extern "C" { f_file_stream_lock(global.main->error.to); fl_print_format("%r%[%QThe %r item action parameter '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, action->parameters.array[1], global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, action->parameters.array[1], global.main->error.notable); fl_print_format("%[' is not a valid supported number.%]", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); f_file_stream_unlock(global.main->error.to); @@ -580,7 +580,7 @@ extern "C" { fl_print_format("%r%[%QThe %r item action may only have '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context); fl_print_format("%[%r%]", global.main->error.to, global.main->error.notable, controller_wait_s, global.main->error.notable); fl_print_format("%[' but instead has '%]", global.main->error.to, global.main->error.context, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, action->parameters.array[0], global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, action->parameters.array[0], global.main->error.notable); fl_print_format("%['.%]", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); f_file_stream_unlock(global.main->error.to); @@ -713,7 +713,7 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QThe %r item named '%]", global.main->error.to, f_string_eol_s, global.main->error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, entry->items.array[i].name, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, entry->items.array[i].name, global.main->error.notable); fl_print_format("%[' cannot be executed because recursion is not allowed.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->error, cache->action); @@ -775,7 +775,7 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QThe %r item named '%]", global.main->error.to, f_string_eol_s, global.main->error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, actions->array[cache->ats.array[at_j]].parameters.array[0], global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, actions->array[cache->ats.array[at_j]].parameters.array[0], global.main->error.notable); fl_print_format("%[' does not exist.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->error, cache->action); @@ -928,7 +928,7 @@ extern "C" { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%rThe %r item action '", global->main->output.to, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.title, cache->action.name_action, global->main->context.set.title); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.title, cache->action.name_action, global->main->context.set.title); if (entry_action->parameters.used) { fl_print_format(" %[", global->main->output.to, global->main->context.set.notable); @@ -960,7 +960,7 @@ extern "C" { controller_lock_print(output->to, global->thread); fl_print_format("%r%[%QThe %r item action '%]", output->to, f_string_eol_s, output->context, output->prefix, is_entry ? controller_entry_s : controller_exit_s, output->context); - fl_print_format("%[%Q%]", output->to, output->notable, cache->action.name_action, output->notable); + fl_print_format(f_string_format_Q_single_s.string, output->to, output->notable, cache->action.name_action, output->notable); if (entry_action->parameters.used) { @@ -1100,7 +1100,7 @@ extern "C" { controller_lock_print(global->main->output.to, global->thread); fl_print_format("%rProcessing %r item '", global->main->output.to, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s); - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.title, cache->action.name_item, global->main->context.set.title); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.title, cache->action.name_item, global->main->context.set.title); fl_print_format("'.%r", global->main->output.to, f_string_eol_s); controller_unlock_print_flush(global->main->output.to, global->thread); @@ -1310,7 +1310,7 @@ extern "C" { for (f_number_unsigned_t k = 0; k < entry_action->parameters.used; ++k) { - fl_print_format("%[%Q%]", global->main->output.to, global->main->context.set.title, entry_action->parameters.array[k], global->main->context.set.title); + fl_print_format(f_string_format_Q_single_s.string, global->main->output.to, global->main->context.set.title, entry_action->parameters.array[k], global->main->context.set.title); if (k + 1 < entry_action->parameters.used) { f_print_dynamic_raw(f_string_space_s, global->main->output.to); @@ -1342,8 +1342,8 @@ extern "C" { controller_lock_print(global->main->error.to, global->thread); fl_print_format("%r%[%QExecution failed, unable to find program or script '%]", global->main->error.to, f_string_eol_s, global->main->error.context, global->main->error.prefix, global->main->error.context); - fl_print_format("%[%Q%]", global->main->error.to, global->main->error.notable, entry_action->parameters.array[0], global->main->error.notable); - fl_print_format("%['.%]%r", global->main->error.to, global->main->error.context, global->main->error.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global->main->error.to, global->main->error.notable, entry_action->parameters.array[0], global->main->error.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global->main->error.to, global->main->error.context, global->main->error.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global->main->error, cache->action); @@ -1683,8 +1683,8 @@ extern "C" { controller_lock_print(global.main->warning.to, global.thread); fl_print_format("%r%[%QIgnoring duplicate %r item '%]", global.main->warning.to, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context); - fl_print_format("%[%Q%]", global.main->warning.to, global.main->warning.notable, cache->action.name_file, global.main->warning.notable); - fl_print_format("%['.%]%r", global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->warning.to, global.main->warning.notable, cache->action.name_file, global.main->warning.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->warning, cache->action); @@ -1829,7 +1829,7 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QThe required %r item '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, action->parameters.array[0], global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, action->parameters.array[0], global.main->error.notable); fl_print_format("%[' does not exist.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->error, cache->action); @@ -1946,12 +1946,12 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QThe %r item setting '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, controller_control_s, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, controller_control_s, global.main->error.notable); fl_print_format("%[' does not support the option '%]", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); fl_print_format("%[%/Q%]", global.main->error.to, global.main->error.notable, cache->buffer_file, cache->content_actions.array[i].array[1], global.main->error.notable); - fl_print_format("%['.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->error, cache->action); diff --git a/level_3/controller/c/entry/private-entry.h b/level_3/controller/c/entry/private-entry.h index a04a96a..ba799df 100644 --- a/level_3/controller/c/entry/private-entry.h +++ b/level_3/controller/c/entry/private-entry.h @@ -59,19 +59,19 @@ extern "C" { * F_okay on success. * * Errors (with error bit) from: controller_entry_actions_increase_by(). - * Errors (with error bit) from: f_fss_count_lines(). * Errors (with error bit) from: f_fss_apply_delimit(). - * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_fss_count_lines(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_rip_dynamic_partial_nulless(). - * Errors (with error bit) from: f_string_dynamics_increase_by(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * Errors (with error bit) from: fll_fss_extended_read(). * * @see controller_entry_actions_increase_by() - * @see f_fss_count_lines() - * @see f_string_dynamic_partial_append_nulless() - * @see f_string_dynamics_increase_by() * @see f_fss_apply_delimit() + * @see f_fss_count_lines() + * @see f_memory_array_increase_by() * @see f_rip_dynamic_partial_nulless() + * @see f_string_dynamic_partial_append_nulless() * @see fll_fss_extended_read() */ #ifndef _di_controller_entry_actions_read_ diff --git a/level_3/controller/c/entry/private-entry_print.c b/level_3/controller/c/entry/private-entry_print.c index b87d75a..0c167dd 100644 --- a/level_3/controller/c/entry/private-entry_print.c +++ b/level_3/controller/c/entry/private-entry_print.c @@ -84,7 +84,7 @@ extern "C" { if (cache.name_action.used) { fl_print_format("action '%]", output.to, output.context); - fl_print_format("%[%Q%]", output.to, output.notable, cache.name_action, output.notable); + fl_print_format(f_string_format_Q_single_s.string, output.to, output.notable, cache.name_action, output.notable); fl_print_format("%[' on line%] ", output.to, output.context, output.context); fl_print_format("%[%un%]", output.to, output.notable, cache.line_action, output.notable); fl_print_format("%[ for ", output.to, output.context); @@ -92,7 +92,7 @@ extern "C" { if (cache.name_item.used) { fl_print_format("%r item '%]", output.to, is_entry ? controller_entry_s : controller_exit_s, output.context); - fl_print_format("%[%Q%]", output.to, output.notable, cache.name_item, output.notable); + fl_print_format(f_string_format_Q_single_s.string, output.to, output.notable, cache.name_item, output.notable); fl_print_format("%[' on line%] ", output.to, output.context, output.context); fl_print_format("%[%un%]", output.to, output.notable, cache.line_item, output.notable); fl_print_format("%[ for ", output.to, output.context); @@ -151,7 +151,7 @@ extern "C" { controller_lock_print(global.main->warning.to, global.thread); fl_print_format("%r%[%QThe %Q item setting '%]", global.main->warning.to, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context); - fl_print_format("%[%Q%]", global.main->warning.to, global.main->warning.notable, cache.action.name_action, global.main->warning.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->warning.to, global.main->warning.notable, cache.action.name_action, global.main->warning.notable); fl_print_format("%[' is being ignored.%]%r", global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->warning, cache.action); @@ -168,7 +168,7 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QThe %Q item setting '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, cache.action.name_action, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, cache.action.name_action, global.main->error.notable); fl_print_format("%[' requires at least %]", global.main->error.to, global.main->error.context, global.main->error.context); fl_print_format("%[%un%]", global.main->error.to, global.main->error.notable, minimum, global.main->error.notable); fl_print_format("%[ and at most %]", global.main->error.to, global.main->error.context, global.main->error.context); @@ -189,7 +189,7 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QThe %Q item setting '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, cache.action.name_action, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, cache.action.name_action, global.main->error.notable); fl_print_format("%[' requires exactly %]", global.main->error.to, global.main->error.context, global.main->error.context); fl_print_format("%[%un%]", global.main->error.to, global.main->error.notable, total, global.main->error.notable); fl_print_format("%[ Content.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); @@ -208,8 +208,8 @@ extern "C" { controller_lock_print(global.main->warning.to, global.thread); fl_print_format("%r%[%QUnknown %r item setting '%]", global.main->warning.to, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context); - fl_print_format("%[%Q%]", global.main->warning.to, global.main->warning.notable, cache.action.name_action, global.main->warning.notable); - fl_print_format("%['.%]%r", global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->warning.to, global.main->warning.notable, cache.action.name_action, global.main->warning.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->warning, cache.action); @@ -225,10 +225,10 @@ extern "C" { controller_lock_print(global.main->warning.to, global.thread); fl_print_format("%r%[%QThe %Q item setting '%]", global.main->warning.to, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context); - fl_print_format("%[%Q%]", global.main->warning.to, global.main->warning.notable, cache.action.name_action, global.main->warning.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->warning.to, global.main->warning.notable, cache.action.name_action, global.main->warning.notable); fl_print_format("%[' has an unknown value '%]", global.main->warning.to, global.main->warning.context, global.main->warning.context); fl_print_format("%[%/Q%]", global.main->warning.to, global.main->warning.notable, cache.buffer_file, cache.content_actions.array[index].array[0], global.main->warning.notable); - fl_print_format("%['.%]%r", global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); controller_entry_print_error_cache(is_entry, global.main->warning, cache.action); diff --git a/level_3/controller/c/lock/private-lock_print.c b/level_3/controller/c/lock/private-lock_print.c index 0d53d9e..b0b9bb9 100644 --- a/level_3/controller/c/lock/private-lock_print.c +++ b/level_3/controller/c/lock/private-lock_print.c @@ -36,7 +36,7 @@ extern "C" { } } - fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print.to, print.context, print.context, f_string_eol_s); controller_unlock_print_flush(print.to, thread); } diff --git a/level_3/controller/c/rule/private-rule.c b/level_3/controller/c/rule/private-rule.c index 67fd274..d0f7621 100644 --- a/level_3/controller/c/rule/private-rule.c +++ b/level_3/controller/c/rule/private-rule.c @@ -69,14 +69,14 @@ extern "C" { if (object && object->start <= object->stop) { if (content) { - status = f_string_dynamics_increase_by(content->used + 1, &action->parameters); + status = f_memory_array_increase_by(content->used + 1, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size); } else { - status = f_string_dynamics_increase(controller_common_allocation_small_d, &action->parameters); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size); } if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->error, F_status_set_fine(status), content ? "f_string_dynamics_increase_by" : "f_string_dynamics_increase", F_true); + controller_print_error(global.thread, global.main->error, F_status_set_fine(status), content ? "f_memory_array_increase_by" : "f_memory_array_increase", F_true); return status; } @@ -113,10 +113,10 @@ extern "C" { } if (content && content->used) { - status = f_string_dynamics_increase_by(content->used, &action->parameters); + status = f_memory_array_increase_by(content->used, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true); + controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_memory_array_increase_by", F_true); return status; } @@ -268,10 +268,10 @@ extern "C" { if (item->type == controller_rule_item_type_script_e || item->type == controller_rule_item_type_utility_e) { actions->array[actions->used].parameters.used = 0; - status = f_string_dynamics_increase(controller_common_allocation_small_d, &actions->array[actions->used].parameters); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &actions->array[actions->used].parameters.array, &actions->array[actions->used].parameters.used, &actions->array[actions->used].parameters.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); + controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_memory_array_increase", F_true); return status; } @@ -452,7 +452,7 @@ extern "C" { fl_print_format("%[%r%]%[', '%]", global.main->error.to, global.main->error.notable, controller_start_s, global.main->error.notable, global.main->error.context, global.main->error.context); fl_print_format("%[%r%]%[', or '%]", global.main->error.to, global.main->error.notable, controller_stop_s, global.main->error.notable, global.main->error.context, global.main->error.context); fl_print_format("%[%r%]", global.main->error.to, global.main->error.notable, controller_thaw_s, global.main->error.notable, global.main->error.context); - fl_print_format("%['.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_rule_print_error_cache(global.main->error, cache->action, F_true); @@ -485,7 +485,7 @@ extern "C" { fl_print_format("%[' as the second value, only the following are allowed: '%]", global.main->error.to, global.main->error.context, global.main->error.context); fl_print_format("%[%r%]%[' or '%]", global.main->error.to, global.main->error.notable, controller_stop_s, global.main->error.notable, global.main->error.context, global.main->error.context); fl_print_format("%[%r%]", global.main->error.to, global.main->error.notable, controller_thaw_s, global.main->error.notable, global.main->error.context); - fl_print_format("%['.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_rule_print_error_cache(global.main->error, cache->action, F_true); @@ -514,7 +514,7 @@ extern "C" { fl_print_format("%[%r%]", global.main->error.to, global.main->error.notable, controller_rerun_s, global.main->error.notable); fl_print_format("%[' has an unknown value '%]", global.main->error.to, global.main->error.context, global.main->error.context); fl_print_format("%[%/Q%]", global.main->error.to, global.main->error.notable, cache->buffer_item, cache->content_action.array[i], global.main->error.notable); - fl_print_format("%['.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_rule_print_error_cache(global.main->error, cache->action, F_true); @@ -554,7 +554,7 @@ extern "C" { fl_print_format("%r%[%QUnknown value '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context); fl_print_format("%[%/Q%]", global.main->error.to, global.main->error.notable, cache->buffer_item, cache->content_action.array[i], global.main->error.notable); fl_print_format("%[' for rule item action '%]%[%r%]", global.main->error.to, global.main->error.context, global.main->error.context, global.main->error.notable, controller_with_s, global.main->error.notable); - fl_print_format("%['.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_rule_print_error_cache(global.main->error, cache->action, F_true); @@ -568,10 +568,10 @@ extern "C" { } // for } else if (item->type == controller_rule_item_type_script_e || item->type == controller_rule_item_type_utility_e) { - status = f_string_dynamics_increase(controller_common_allocation_small_d, &actions->array[actions->used].parameters); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &actions->array[actions->used].parameters.array, &actions->array[actions->used].parameters.used, &actions->array[actions->used].parameters.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); + controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_memory_array_increase", F_true); return status; } @@ -695,7 +695,7 @@ extern "C" { status = F_status_set_fine(status); if (status != F_valid_not && status != F_number && status != F_number_decimal && status != F_number_overflow && status != F_number_underflow && status != F_number_negative) { - controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); + controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true); } else { controller_lock_print(global.main->error.to, global.thread); @@ -1626,10 +1626,10 @@ extern "C" { return status; } - status = f_string_dynamics_increase(controller_common_allocation_small_d, &process->path_pids); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &process->path_pids.array, &process->path_pids.used, &process->path_pids.size); if (F_status_is_error(status)) { - controller_print_error(thread, main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); + controller_print_error(thread, main->error, F_status_set_fine(status), "f_memory_array_increase", F_true); return status; } @@ -1939,7 +1939,7 @@ extern "C" { return F_okay; } - f_status_t status = f_string_dynamics_increase_by(action.parameters.used, &process->cache.expanded); + f_status_t status = f_memory_array_increase_by(action.parameters.used, sizeof(f_string_dynamic_t), (void **) &process->cache.expanded.array, &process->cache.expanded.used, &process->cache.expanded.size); if (F_status_is_error(status)) return status; f_number_unsigned_t i = 0; @@ -1958,7 +1958,7 @@ extern "C" { iki_data = &action.ikis.array[process->cache.expanded.used]; // Allocate enough room plus an extra buffer to help reduce reallocations. - status = f_string_dynamic_increase_by(action.parameters.array[process->cache.expanded.used].used + controller_common_allocation_large_d, buffer); + status = f_memory_array_increase_by(action.parameters.array[process->cache.expanded.used].used + controller_common_allocation_large_d, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); // Apply the IKI delimits. for (i = 0; i < iki_data->delimits.used; ++i) { @@ -2220,7 +2220,7 @@ extern "C" { if (parameters->array[codes[i]].result & f_console_result_value_e) { const f_number_unsigned_t index = parameters->array[codes[i]].values.array[parameters->array[codes[i]].values.used - 1]; - status = f_string_dynamic_increase_by(symbols[i].used + expands[i].used + f_string_ascii_space_s.used + argv[index].used + 1, destination); + status = f_memory_array_increase_by(symbols[i].used + expands[i].used + f_string_ascii_space_s.used + argv[index].used + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; status = f_string_dynamic_append(symbols[i], destination); @@ -2238,7 +2238,7 @@ extern "C" { } else { if (parameters->array[codes[i]].result & f_console_result_found_e) { - status = f_string_dynamic_increase_by(symbols[i].used + expands[i].used + 1, destination); + status = f_memory_array_increase_by(symbols[i].used + expands[i].used + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; status = f_string_dynamic_append(symbols[i], destination); @@ -2264,7 +2264,7 @@ extern "C" { if (f_compare_dynamic_partial_string(buffer.string, source, buffer.used, content) == F_equal_to) { if (values[i] && parameters->array[codes[i]].result & f_console_result_value_e || !values[i] && (parameters->array[codes[i]].result & f_console_result_found_e)) { - status = f_string_dynamic_increase_by(symbols[i].used + expands[i].used + 1, destination); + status = f_memory_array_increase_by(symbols[i].used + expands[i].used + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; status = f_string_dynamic_append(symbols[i], destination); @@ -2475,8 +2475,8 @@ extern "C" { controller_lock_print(global.main->warning.to, global.thread); fl_print_format("%r%[%QUnknown rule item action '%]", global.main->warning.to, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context); - fl_print_format("%[%Q%]", global.main->warning.to, global.main->warning.notable, cache->action.name_action, global.main->warning.notable); - fl_print_format("%['.%]%r", global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->warning.to, global.main->warning.notable, cache->action.name_action, global.main->warning.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); controller_rule_print_error_cache(global.main->warning, cache->action, F_true); @@ -2493,8 +2493,8 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QFSS Extended List is not allowed for the rule item action '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, cache->action.name_action, global.main->error.notable); - fl_print_format("%['.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, cache->action.name_action, global.main->error.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_unlock_print_flush(global.main->error.to, global.thread); } @@ -2989,14 +2989,14 @@ extern "C" { if (process->rule.items.used) { fl_print_format("%r%[%QThe rule '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, process->rule.name, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, process->rule.name, global.main->error.notable); fl_print_format("%[' has no '%]", global.main->error.to, global.main->error.context, global.main->error.context); fl_print_format("%[%r%]", global.main->error.to, global.main->error.notable, controller_rule_action_type_name(process->action), global.main->error.notable); fl_print_format("%[' action to execute.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); } else { fl_print_format("%r%[%QThe rule '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, process->rule.name, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, process->rule.name, global.main->error.notable); fl_print_format("%[ has no known '%]", global.main->error.to, global.main->error.context, global.main->error.context); fl_print_format("%[%r %r%]", global.main->error.to, global.main->error.notable, controller_rule_s, controller_type_s, global.main->error.notable); fl_print_format("%[' (such as '%]", global.main->error.to, global.main->error.context, global.main->error.context); @@ -3444,7 +3444,7 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QThe rule '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, process->rule.alias, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, process->rule.alias, global.main->error.notable); fl_print_format("%[' is already on the execution dependency stack, this recursion is prohibited.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_rule_print_error_cache(global.main->error, process->cache.action, F_true); @@ -3882,8 +3882,8 @@ extern "C" { controller_lock_print(global.main->warning.to, global.thread); fl_print_format("%r%[%QUnknown rule item '%]", global.main->warning.to, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context); - fl_print_format("%[%Q%]", global.main->warning.to, global.main->warning.notable, cache->action.name_item, global.main->warning.notable); - fl_print_format("%['.%]%r", global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->warning.to, global.main->warning.notable, cache->action.name_item, global.main->warning.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); controller_rule_print_error_cache(global.main->warning, cache->action, F_true); @@ -4079,8 +4079,8 @@ extern "C" { controller_lock_print(global.main->warning.to, global.thread); fl_print_format("%r%[%QUnknown rule setting '%]", global.main->warning.to, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context); - fl_print_format("%[%Q%]", global.main->warning.to, global.main->warning.notable, cache->action.name_item, global.main->warning.notable); - fl_print_format("%['.%]%r", global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->warning.to, global.main->warning.notable, cache->action.name_item, global.main->warning.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->warning.to, global.main->warning.context, global.main->warning.context, f_string_eol_s); controller_rule_print_error_cache(global.main->warning, cache->action, F_false); @@ -4364,10 +4364,10 @@ extern "C" { for (j = 1; j < cache->content_actions.array[i].used; ++j) { - status = f_string_dynamics_increase(controller_common_allocation_small_d, &rule->cgroup.groups); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &rule->cgroup.groups.array, &rule->cgroup.groups.used, &rule->cgroup.groups.size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamics_increase", F_true, F_false); + controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); break; } @@ -4487,8 +4487,8 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QUnknown resource limit type '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, cache->action.name_action, global.main->error.notable); - fl_print_format("%['.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, cache->action.name_action, global.main->error.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_rule_print_error_cache(global.main->error, cache->action, F_true); @@ -4652,7 +4652,7 @@ extern "C" { rule->engine_arguments.used = 0; if (cache->content_actions.array[i].used > 1) { - status = f_string_dynamics_increase_by(cache->content_actions.array[i].used - 1, &rule->engine_arguments); + status = f_memory_array_increase_by(cache->content_actions.array[i].used - 1, sizeof(f_string_dynamic_t), (void **) &rule->engine_arguments.array, &rule->engine_arguments.used, &rule->engine_arguments.size); for (j = 1; F_status_is_error_not(status) && j < cache->content_actions.array[i].used; ++j, ++rule->engine_arguments.used) { @@ -4708,7 +4708,7 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QRule setting has an invalid name '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, *setting_value, global.main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, *setting_value, global.main->error.notable); fl_print_format("%[', there must be at least 1 graph character.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_rule_print_error_cache(global.main->error, cache->action, F_false); @@ -5339,10 +5339,10 @@ extern "C" { for (j = 0; j < cache->content_actions.array[i].used; ++j) { - status = f_string_dynamics_increase(controller_common_allocation_small_d, setting_values); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values.array, &setting_values.used, &setting_values.size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamics_increase", F_true, F_false); + controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -5410,8 +5410,8 @@ extern "C" { controller_lock_print(global.main->error.to, global.thread); fl_print_format("%r%[%QRule setting has an invalid environment variable name '%]", global.main->error.to, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context); - fl_print_format("%[%Q%]", global.main->error.to, global.main->error.notable, setting_values->array[setting_values->used], global.main->error.notable); - fl_print_format("%['.%]%r", global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, global.main->error.to, global.main->error.notable, setting_values->array[setting_values->used], global.main->error.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->error.to, global.main->error.context, global.main->error.context, f_string_eol_s); controller_rule_print_error_cache(global.main->error, cache->action, F_false); @@ -5576,10 +5576,10 @@ extern "C" { continue; } - status = f_string_dynamics_increase_by(controller_common_allocation_small_d, setting_values); + status = f_memory_array_increase_by(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true, F_false); + controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, F_false); } } diff --git a/level_3/controller/c/rule/private-rule.h b/level_3/controller/c/rule/private-rule.h index 4024f56..9fb2d97 100644 --- a/level_3/controller/c/rule/private-rule.h +++ b/level_3/controller/c/rule/private-rule.h @@ -90,16 +90,15 @@ extern "C" { * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: f_string_dynamics_increase(). - * Errors (with error bit) from: f_string_dynamics_increase_by(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_iki_read(). * * @see f_fss_count_lines() * @see f_memory_array_increase() * @see f_memory_array_increase_by() * @see f_string_dynamic_partial_append_nulless() - * @see f_string_dynamics_increase() - * @see f_string_dynamics_increase_by() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see fl_iki_read() */ #ifndef _di_controller_rule_parameters_read_ @@ -704,18 +703,18 @@ extern "C" { * * F_valid_not (with error bit) on success but there were one or more invalid settings encountered. * - * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: f_rip_dynamic_partial_nulless(). - * Errors (with error bit) from: f_string_dynamics_increase(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * Errors (with error bit) from: f_string_maps_increase(). * Errors (with error bit) from: fll_fss_extended_read(). * * Errors (with error bit) from: controller_path_canonical_relative(). * + * @see f_memory_array_increase() + * @see f_rip_dynamic_partial_nulless() * @see f_string_dynamic_partial_append_nulless() - * @see f_string_dynamics_increase() * @see f_string_maps_increase() - * @see f_rip_dynamic_partial_nulless() * @see fll_fss_extended_read() * * @see controller_path_canonical_relative() diff --git a/level_3/controller/c/rule/private-rule_print.c b/level_3/controller/c/rule/private-rule_print.c index 0f5695c..722eff4 100644 --- a/level_3/controller/c/rule/private-rule_print.c +++ b/level_3/controller/c/rule/private-rule_print.c @@ -38,7 +38,7 @@ extern "C" { if (cache.name_action.used) { fl_print_format("%r '%]", print.to, item ? controller_action_s : controller_value_s, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, cache.name_action, print.notable); + fl_print_format(f_string_format_Q_single_s.string, print.to, print.notable, cache.name_action, print.notable); fl_print_format("%[' on line%] ", print.to, print.context, print.context); fl_print_format("%[%un%]", print.to, print.notable, cache.line_action, print.notable); fl_print_format("%[ for ", print.to, print.context); @@ -46,7 +46,7 @@ extern "C" { if (cache.name_item.used) { fl_print_format("rule %r '%]", print.to, item ? controller_item_s : controller_settings_s, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, cache.name_item, print.notable); + fl_print_format(f_string_format_Q_single_s.string, print.to, print.notable, cache.name_item, print.notable); fl_print_format("%[' on line%] ", print.to, print.context, print.context); fl_print_format("%[%un%]", print.to, print.notable, cache.line_item, print.notable); fl_print_format("%[ for ", print.to, print.context); @@ -86,7 +86,7 @@ extern "C" { controller_lock_print(print->to, (controller_thread_t *) process->main_thread); fl_print_format("%r%[%QThe %r '%]", print->to, f_string_eol_s, print->context, print->prefix, script_is ? controller_engine_s : controller_program_s, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); if (status == F_control_group || status == F_limit || status == F_processor || status == F_schedule) { fl_print_format("%[' failed to setup the '%]%[", print->to, print->context, print->context, print->notable); @@ -316,7 +316,7 @@ extern "C" { else { fl_print_format("%[' failed with the execute error code %]", print->to, print->context, print->context); fl_print_format("%[%i%]", print->to, print->notable, code, print->notable); - fl_print_format("%[.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->context, print->context, f_string_eol_s); } } else { @@ -334,7 +334,7 @@ extern "C" { if (print.verbosity == f_console_verbosity_quiet_e) return; fl_print_format("%r%[%QThe rule '%]", print.to, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, alias, print.notable); + fl_print_format(f_string_format_Q_single_s.string, print.to, print.notable, alias, print.notable); fl_print_format("%[' is not designating a pid file.%]%r", print.to, print.context, print.context, f_string_eol_s); } #endif // _di_controller_rule_action_print_error_missing_pid_ @@ -345,7 +345,7 @@ extern "C" { if (print.verbosity == f_console_verbosity_quiet_e) return; fl_print_format("%r%[%QThe %r rule '%]", print.to, f_string_eol_s, print.context, print.prefix, need_want_wish, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, value, print.notable); + fl_print_format(f_string_format_Q_single_s.string, print.to, print.notable, value, print.notable); fl_print_format("%[' %S.%]%r", print.to, print.context, why, print.context, f_string_eol_s); } #endif // _di_controller_rule_item_print_error_need_want_wish_ @@ -356,7 +356,7 @@ extern "C" { if (print.verbosity == f_console_verbosity_quiet_e) return; fl_print_format("%r%[%QThe rule '%]", print.to, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, alias, print.notable); + fl_print_format(f_string_format_Q_single_s.string, print.to, print.notable, alias, print.notable); fl_print_format("%[' is no longer loaded.%]%r", print.to, print.context, print.context, f_string_eol_s); } #endif // _di_controller_rule_item_print_error_rule_not_loaded_ diff --git a/level_3/controller/c/thread/private-thread.c b/level_3/controller/c/thread/private-thread.c index e8935fa..b707a1f 100644 --- a/level_3/controller/c/thread/private-thread.c +++ b/level_3/controller/c/thread/private-thread.c @@ -135,7 +135,8 @@ extern "C" { // Deallocate the PID files. if (process->path_pids.used) { process->path_pids.used = 0; - f_string_dynamics_resize(0, &process->path_pids); + + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &process->path_pids.array, &process->path_pids.used, &process->path_pids.size, &f_string_dynamics_delete_callback); } // Deallocate any rules in the space that is declared to be unused. @@ -238,7 +239,7 @@ extern "C" { controller_lock_print(main->error.to, &thread); fl_print_format("%r%[%QThe pid file '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - fl_print_format("%[%Q%]", main->error.to, main->error.notable, setting->path_pid, main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, main->error.to, main->error.notable, setting->path_pid, main->error.notable); fl_print_format("%[' must not already exist.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s); controller_unlock_print_flush(main->error.to, &thread); diff --git a/level_3/controller/c/thread/private-thread_entry.c b/level_3/controller/c/thread/private-thread_entry.c index 9a17526..6385b8e 100644 --- a/level_3/controller/c/thread/private-thread_entry.c +++ b/level_3/controller/c/thread/private-thread_entry.c @@ -48,7 +48,7 @@ extern "C" { controller_lock_print(main->error.to, entry->global->thread); fl_print_format("%r%[%QThe pid file '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - fl_print_format("%[%Q%]", main->error.to, main->error.notable, entry->setting->path_pid, main->error.notable); + fl_print_format(f_string_format_Q_single_s.string, main->error.to, main->error.notable, entry->setting->path_pid, main->error.notable); fl_print_format("%[' must not already exist.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s); controller_unlock_print_flush(main->error.to, entry->global->thread); @@ -87,8 +87,8 @@ extern "C" { controller_lock_print(main->error.to, entry->global->thread); fl_print_format("%r%[%QFailed while processing requested failsafe item '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - fl_print_format("%[%Q%]", main->error.to, main->error.notable, entry->global->setting->entry.items.array[entry->global->setting->failsafe_item_id].name, main->error.notable); - fl_print_format("%['.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, main->error.to, main->error.notable, entry->global->setting->entry.items.array[entry->global->setting->failsafe_item_id].name, main->error.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, main->error.to, main->error.context, main->error.context, f_string_eol_s); controller_unlock_print_flush(main->error.to, entry->global->thread); } @@ -216,8 +216,8 @@ extern "C" { controller_lock_print(main->error.to, entry->global->thread); fl_print_format("%r%[%QFailed while processing requested failsafe item '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - fl_print_format("%[%Q%]", main->error.to, main->error.notable, entry->global->setting->entry.items.array[entry->global->setting->failsafe_item_id].name, main->error.notable); - fl_print_format("%['.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, main->error.to, main->error.notable, entry->global->setting->entry.items.array[entry->global->setting->failsafe_item_id].name, main->error.notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, main->error.to, main->error.context, main->error.context, f_string_eol_s); controller_unlock_print_flush(main->error.to, entry->global->thread); } diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index 7b205a8..c8066fd 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -410,9 +410,9 @@ extern "C" { } // for if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_mash)); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &defines.string, &defines.used, &defines.size); - f_string_dynamic_resize(0, &defines); + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_mash)); return 0; } @@ -456,7 +456,7 @@ extern "C" { main->setting.state.status = fll_execute_arguments_add_parameter_set(prefixs, names, values, 9, &main->cache_arguments); - f_string_dynamic_resize(0, &defines); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &defines.string, &defines.used, &defines.size); if (F_status_is_error(main->setting.state.status)) { fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add_parameter_set)); diff --git a/level_3/fake/c/main/build.h b/level_3/fake/c/main/build.h index 459cc9e..053c5c3 100644 --- a/level_3/fake/c/main/build.h +++ b/level_3/fake/c/main/build.h @@ -63,10 +63,10 @@ extern "C" { * Errors (with error bit) from: f_file_exists() * Errors (with error bit) from: f_file_name_base() * Errors (with error bit) from: f_file_name_directory() + * Errors (with error bit) from: f_memory_array_resize() * Errors (with error bit) from: f_string_append_nulless() * Errors (with error bit) from: f_string_dynamic_append() * Errors (with error bit) from: f_string_dynamic_append_nulless() - * Errors (with error bit) from: f_string_dynamic_resize() * Errors (with error bit) from: fl_directory_create() * Errors (with error bit) from: fl_directory_do() * @param mode @@ -96,9 +96,9 @@ extern "C" { * @see f_file_exists() * @see f_file_name_base() * @see f_file_name_directory() + * @see f_memory_array_resize() * @see f_string_append_nulless() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamic_resize() * @see fl_directory_create() * @see fl_directory_do() * @see fll_program_print_signal_received() diff --git a/level_3/fake/c/main/build/load.c b/level_3/fake/c/main/build/load.c index 4c924f4..9fb2ba9 100644 --- a/level_3/fake/c/main/build/load.c +++ b/level_3/fake/c/main/build/load.c @@ -172,10 +172,10 @@ extern "C" { f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &delimits.array, &delimits.used, &delimits.size); } - f_string_dynamic_resize(0, &buffer); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &buffer.string, &buffer.used, &buffer.size); - macro_f_string_ranges_t_delete_simple(objects); - macro_f_string_rangess_t_delete_simple(contents); + f_string_ranges_resize(0, &objects); + f_string_rangess_resize(0, &contents); } // Error when required settings are not specified. @@ -590,10 +590,10 @@ extern "C" { settings_mode_names[j].used = 0; - main->setting.state.status = f_string_dynamic_increase_by(settings_value[j]->used + f_string_ascii_minus_s.used + modes->array[i].used, &settings_mode_names[j]); + main->setting.state.status = f_memory_array_increase_by(settings_value[j]->used + f_string_ascii_minus_s.used + modes->array[i].used, sizeof(f_char_t), (void **) &settings_mode_names[j].string, &settings_mode_names[j].used, &settings_mode_names[j].size); if (F_status_is_error(main->setting.state.status)) { - function = macro_fake_f(f_string_dynamic_increase_by); + function = macro_fake_f(f_memory_array_increase_by); break; } @@ -627,7 +627,7 @@ extern "C" { } // for for (j = 0; j < fake_build_setting_total_d; ++j) { - f_string_dynamic_resize(0, &settings_mode_names[j]); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &settings_mode_names[j].string, &settings_mode_names[j].used, &settings_mode_names[j].size); } // for // The string "build_libraries" is appended after all modes to help assist with static linker file issues. @@ -1176,10 +1176,10 @@ extern "C" { } } else { - main->setting.state.status = f_string_dynamic_increase_by(settings_single_source[i]->array[settings_single_source[i]->used - 1].used + 1, settings_single_destination[i]); + main->setting.state.status = f_memory_array_increase_by(settings_single_source[i]->array[settings_single_source[i]->used - 1].used + 1, sizeof(f_char_t), (void **) &settings_single_destination[i]->string, &settings_single_destination[i]->used, &settings_single_destination[i]->size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); break; } @@ -1210,46 +1210,46 @@ extern "C" { } } - f_string_dynamics_resize(0, &build_compiler); - f_string_dynamics_resize(0, &build_indexer); - f_string_dynamics_resize(0, &build_language); - f_string_dynamics_resize(0, &build_name); - f_string_dynamics_resize(0, &build_script); - f_string_dynamics_resize(0, &build_shared); - f_string_dynamics_resize(0, &build_sources_object); - f_string_dynamics_resize(0, &build_sources_object_shared); - f_string_dynamics_resize(0, &build_sources_object_static); - f_string_dynamics_resize(0, &build_static); - f_string_dynamics_resize(0, &has_path_standard); - f_string_dynamics_resize(0, &path_headers); - f_string_dynamics_resize(0, &path_language); - f_string_dynamics_resize(0, &path_library_script); - f_string_dynamics_resize(0, &path_library_shared); - f_string_dynamics_resize(0, &path_library_static); - f_string_dynamics_resize(0, &path_object_script); - f_string_dynamics_resize(0, &path_object_shared); - f_string_dynamics_resize(0, &path_object_static); - f_string_dynamics_resize(0, &path_program_script); - f_string_dynamics_resize(0, &path_program_shared); - f_string_dynamics_resize(0, &path_program_static); - f_string_dynamics_resize(0, &path_sources); - f_string_dynamics_resize(0, &path_sources_object); - f_string_dynamics_resize(0, &preserve_path_headers); - f_string_dynamics_resize(0, &process_post); - f_string_dynamics_resize(0, &process_pre); - f_string_dynamics_resize(0, &search_exclusive); - f_string_dynamics_resize(0, &search_shared); - f_string_dynamics_resize(0, &search_static); - f_string_dynamics_resize(0, &version_file); - f_string_dynamics_resize(0, &version_major); - f_string_dynamics_resize(0, &version_major_prefix); - f_string_dynamics_resize(0, &version_micro); - f_string_dynamics_resize(0, &version_micro_prefix); - f_string_dynamics_resize(0, &version_minor); - f_string_dynamics_resize(0, &version_minor_prefix); - f_string_dynamics_resize(0, &version_nano); - f_string_dynamics_resize(0, &version_nano_prefix); - f_string_dynamics_resize(0, &version_target); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_compiler.array, &build_compiler.used, &build_compiler.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_indexer.array, &build_indexer.used, &build_indexer.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_language.array, &build_language.used, &build_language.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_name.array, &build_name.used, &build_name.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_script.array, &build_script.used, &build_script.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_shared.array, &build_shared.used, &build_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_sources_object.array, &build_sources_object.used, &build_sources_object.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_sources_object_shared.array, &build_sources_object_shared.used, &build_sources_object_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_sources_object_static.array, &build_sources_object_static.used, &build_sources_object_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_static.array, &build_static.used, &build_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &has_path_standard.array, &has_path_standard.used, &has_path_standard.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_headers.array, &path_headers.used, &path_headers.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_language.array, &path_language.used, &path_language.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_library_script.array, &path_library_script.used, &path_library_script.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_library_shared.array, &path_library_shared.used, &path_library_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_library_static.array, &path_library_static.used, &path_library_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_object_script.array, &path_object_script.used, &path_object_script.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_object_shared.array, &path_object_shared.used, &path_object_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_object_static.array, &path_object_static.used, &path_object_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_program_script.array, &path_program_script.used, &path_program_script.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_program_shared.array, &path_program_shared.used, &path_program_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_program_static.array, &path_program_static.used, &path_program_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_sources.array, &path_sources.used, &path_sources.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &path_sources_object.array, &path_sources_object.used, &path_sources_object.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &preserve_path_headers.array, &preserve_path_headers.used, &preserve_path_headers.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &process_post.array, &process_post.used, &process_post.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &process_pre.array, &process_pre.used, &process_pre.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &search_exclusive.array, &search_exclusive.used, &search_exclusive.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &search_shared.array, &search_shared.used, &search_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &search_static.array, &search_static.used, &search_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_file.array, &version_file.used, &version_file.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_major.array, &version_major.used, &version_major.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_major_prefix.array, &version_major_prefix.used, &version_major_prefix.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_micro.array, &version_micro.used, &version_micro.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_micro_prefix.array, &version_micro_prefix.used, &version_micro_prefix.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_minor.array, &version_minor.used, &version_minor.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_minor_prefix.array, &version_minor_prefix.used, &version_minor_prefix.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_nano.array, &version_nano.used, &version_nano.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_nano_prefix.array, &version_nano_prefix.used, &version_nano_prefix.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_target.array, &version_target.used, &version_target.size, &f_string_dynamics_delete_callback); } #endif // _di_fake_build_load_setting_process_ @@ -1430,7 +1430,7 @@ extern "C" { } } // for - f_string_dynamic_resize(0, &settings_file_base); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &settings_file_base.string, &settings_file_base.used, &settings_file_base.size); } #endif // _di_fake_build_load_stage_ diff --git a/level_3/fake/c/main/build/load.h b/level_3/fake/c/main/build/load.h index 1a17451..f0fc786 100644 --- a/level_3/fake/c/main/build/load.h +++ b/level_3/fake/c/main/build/load.h @@ -126,10 +126,10 @@ extern "C" { * * F_failure (with error bit) on error. * + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_path_directory_cleanup(). * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). * Errors (with error bit) from: fll_fss_snatch_apart(). * @param checks * If TRUE, perform certain "required" sanity checks. @@ -149,10 +149,10 @@ extern "C" { * All build related setting data from the build setting file are loaded into this. * These setting will have any specified mode property applied. * + * @see f_memory_array_increase_by() * @see f_path_directory_cleanup() * @see f_string_dynamic_append() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamic_increase_by() * @see fll_fss_snatch_apart() */ #ifndef _di_fake_build_load_setting_process_ diff --git a/level_3/fake/c/main/common.c b/level_3/fake/c/main/common.c index 17dac75..189077f 100644 --- a/level_3/fake/c/main/common.c +++ b/level_3/fake/c/main/common.c @@ -290,14 +290,14 @@ extern "C" { // De-allocate memory before replacing it with a statically allocated string. if (variable[i]->size) { - main->setting.state.status = f_string_dynamic_resize(0, variable[i]); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &variable[i]->string, &variable[i]->used, &variable[i]->size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_resize)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_resize)); return; } @@ -327,14 +327,14 @@ extern "C" { // De-allocate memory before replacing it with a statically allocated string. if (variable[i]->size) { - main->setting.state.status = f_string_dynamic_resize(0, variable[i]); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &variable[i]->string, &variable[i]->used, &variable[i]->size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_resize)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_resize)); return; } @@ -525,7 +525,7 @@ extern "C" { // Shrink an overly long string. if (dynamic->size > fake_max_over_string_d) { - f_string_dynamic_resize(fake_allocation_large_d, dynamic); + f_memory_array_resize(fake_allocation_large_d, sizeof(f_char_t), (void **) &dynamic->string, &dynamic->used, &dynamic->size); } dynamic->used = 0; @@ -539,7 +539,7 @@ extern "C" { // Shrink an overly long array. if (dynamics->size > fake_max_over_array_d) { - f_string_dynamics_resize(fake_allocation_large_d, dynamics); + f_memory_arrays_resize(fake_allocation_large_d, sizeof(f_string_dynamic_t), (void **) &dynamics->array, &dynamics->used, &dynamics->size, &f_string_dynamics_delete_callback); } while (dynamics->used) { diff --git a/level_3/fake/c/main/common.h b/level_3/fake/c/main/common.h index 4bc07cc..dc243b2 100644 --- a/level_3/fake/c/main/common.h +++ b/level_3/fake/c/main/common.h @@ -31,8 +31,8 @@ extern "C" { * * Errors (with error bit) from: f_console_parameter_process(). * Errors (with error bit) from: f_memory_array_increase_by(). + * Errors (with error bit) from: f_memory_array_resize(). * Errors (with error bit) from: f_path_directory_cleanup(). - * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_utf_is_word_dash_plus(). * Errors (with error bit) from: fll_program_parameter_additional_rip(). * Errors (with error bit) from: fll_program_parameter_process_context(). @@ -40,8 +40,8 @@ extern "C" { * * @see f_console_parameter_process() * @see f_memory_array_increase_by() + * @see f_memory_array_resize() * @see f_path_directory_cleanup() - * @see f_string_dynamic_resize() * @see f_utf_is_word_dash_plus() * @see fll_program_parameter_additional_rip() * @see fll_program_parameter_process_context() @@ -89,7 +89,7 @@ extern "C" { * @param dynamic * The string to shrink. * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_fake_string_dynamic_reset_ extern void fake_string_dynamic_reset(f_string_dynamic_t * const dynamic); @@ -103,7 +103,7 @@ extern "C" { * @param dynamic * The string to shrink. * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_fake_string_dynamics_reset_ extern void fake_string_dynamics_reset(f_string_dynamics_t * const dynamics); diff --git a/level_3/fake/c/main/common/print.c b/level_3/fake/c/main/common/print.c index 8c0c913..003077e 100644 --- a/level_3/fake/c/main/common/print.c +++ b/level_3/fake/c/main/common/print.c @@ -50,6 +50,7 @@ extern "C" { "f_memory_array_increase", "f_memory_array_increase_by", "f_memory_array_resize", + "f_memory_arrays_resize", "f_path_change", "f_path_current", "f_path_directory_cleanup", @@ -57,15 +58,10 @@ extern "C" { "f_string_dynamic_append", "f_string_dynamic_append_assure", "f_string_dynamic_append_nulless", - "f_string_dynamic_increase_by", "f_string_dynamic_mash", "f_string_dynamic_partial_append", "f_string_dynamic_partial_append_nulless", "f_string_dynamic_prepend", - "f_string_dynamic_resize", - "f_string_dynamics_increase", - "f_string_dynamics_increase_by", - "f_string_dynamics_resize", "f_string_map_multis_resize", "f_thread_create", "f_utf_is_word_dash_plus", diff --git a/level_3/fake/c/main/common/print.h b/level_3/fake/c/main/common/print.h index 2002323..fc147d7 100644 --- a/level_3/fake/c/main/common/print.h +++ b/level_3/fake/c/main/common/print.h @@ -83,6 +83,7 @@ extern "C" { fake_f_f_memory_array_increase_e, fake_f_f_memory_array_increase_by_e, fake_f_f_memory_array_resize_e, + fake_f_f_memory_arrays_resize_e, fake_f_f_path_change_e, fake_f_f_path_current_e, fake_f_f_path_directory_cleanup_e, @@ -90,15 +91,10 @@ extern "C" { fake_f_f_string_dynamic_append_e, fake_f_f_string_dynamic_append_assure_e, fake_f_f_string_dynamic_append_nulless_e, - fake_f_f_string_dynamic_increase_by_e, fake_f_f_string_dynamic_mash_e, fake_f_f_string_dynamic_partial_append_e, fake_f_f_string_dynamic_partial_append_nulless_e, fake_f_f_string_dynamic_prepend_e, - fake_f_f_string_dynamic_resize_e, - fake_f_f_string_dynamics_increase_e, - fake_f_f_string_dynamics_increase_by_e, - fake_f_f_string_dynamics_resize_e, fake_f_f_string_map_multis_resize_e, fake_f_f_thread_create_e, fake_f_f_utf_is_word_dash_plus_e, diff --git a/level_3/fake/c/main/common/type.c b/level_3/fake/c/main/common/type.c index bfad29f..5ef2803 100644 --- a/level_3/fake/c/main/common/type.c +++ b/level_3/fake/c/main/common/type.c @@ -19,85 +19,84 @@ extern "C" { if (!build_setting) return; - f_string_dynamic_resize(0, &build_setting->build_compiler); - f_string_dynamic_resize(0, &build_setting->build_indexer); - f_string_dynamic_resize(0, &build_setting->build_name); - f_string_dynamic_resize(0, &build_setting->build_sources_object); - f_string_dynamic_resize(0, &build_setting->build_sources_object_shared); - f_string_dynamic_resize(0, &build_setting->build_sources_object_static); - f_string_dynamic_resize(0, &build_setting->path_headers); - f_string_dynamic_resize(0, &build_setting->path_language); - f_string_dynamic_resize(0, &build_setting->path_library_script); - f_string_dynamic_resize(0, &build_setting->path_library_shared); - f_string_dynamic_resize(0, &build_setting->path_library_static); - f_string_dynamic_resize(0, &build_setting->path_object_script); - f_string_dynamic_resize(0, &build_setting->path_object_shared); - f_string_dynamic_resize(0, &build_setting->path_object_static); - f_string_dynamic_resize(0, &build_setting->path_program_script); - f_string_dynamic_resize(0, &build_setting->path_program_shared); - f_string_dynamic_resize(0, &build_setting->path_program_static); - f_string_dynamic_resize(0, &build_setting->path_sources); - f_string_dynamic_resize(0, &build_setting->path_sources_object); - f_string_dynamic_resize(0, &build_setting->process_post); - f_string_dynamic_resize(0, &build_setting->process_pre); - f_string_dynamic_resize(0, &build_setting->version_major); - f_string_dynamic_resize(0, &build_setting->version_major_prefix); - f_string_dynamic_resize(0, &build_setting->version_micro); - f_string_dynamic_resize(0, &build_setting->version_micro_prefix); - f_string_dynamic_resize(0, &build_setting->version_minor); - f_string_dynamic_resize(0, &build_setting->version_minor_prefix); - f_string_dynamic_resize(0, &build_setting->version_nano); - f_string_dynamic_resize(0, &build_setting->version_nano_prefix); - - f_string_dynamics_resize(0, &build_setting->build_indexer_arguments); - f_string_dynamics_resize(0, &build_setting->build_libraries); - f_string_dynamics_resize(0, &build_setting->build_libraries_shared); - f_string_dynamics_resize(0, &build_setting->build_libraries_static); - f_string_dynamics_resize(0, &build_setting->build_objects_library); - f_string_dynamics_resize(0, &build_setting->build_objects_library_shared); - f_string_dynamics_resize(0, &build_setting->build_objects_library_static); - f_string_dynamics_resize(0, &build_setting->build_objects_program); - f_string_dynamics_resize(0, &build_setting->build_objects_program_shared); - f_string_dynamics_resize(0, &build_setting->build_objects_program_static); - f_string_dynamics_resize(0, &build_setting->build_sources_documentation); - f_string_dynamics_resize(0, &build_setting->build_sources_headers); - f_string_dynamics_resize(0, &build_setting->build_sources_headers_shared); - f_string_dynamics_resize(0, &build_setting->build_sources_headers_static); - f_string_dynamics_resize(0, &build_setting->build_sources_library); - f_string_dynamics_resize(0, &build_setting->build_sources_library_shared); - f_string_dynamics_resize(0, &build_setting->build_sources_library_static); - f_string_dynamics_resize(0, &build_setting->build_sources_program); - f_string_dynamics_resize(0, &build_setting->build_sources_program_shared); - f_string_dynamics_resize(0, &build_setting->build_sources_program_static); - f_string_dynamics_resize(0, &build_setting->build_sources_script); - f_string_dynamics_resize(0, &build_setting->build_sources_setting); - f_string_dynamics_resize(0, &build_setting->defines); - f_string_dynamics_resize(0, &build_setting->defines_library); - f_string_dynamics_resize(0, &build_setting->defines_library_shared); - f_string_dynamics_resize(0, &build_setting->defines_library_static); - f_string_dynamics_resize(0, &build_setting->defines_object); - f_string_dynamics_resize(0, &build_setting->defines_object_shared); - f_string_dynamics_resize(0, &build_setting->defines_object_static); - f_string_dynamics_resize(0, &build_setting->defines_program); - f_string_dynamics_resize(0, &build_setting->defines_program_shared); - f_string_dynamics_resize(0, &build_setting->defines_program_static); - f_string_dynamics_resize(0, &build_setting->defines_shared); - f_string_dynamics_resize(0, &build_setting->defines_static); - f_string_dynamics_resize(0, &build_setting->environment); - f_string_dynamics_resize(0, &build_setting->flags); - f_string_dynamics_resize(0, &build_setting->flags_library); - f_string_dynamics_resize(0, &build_setting->flags_library_shared); - f_string_dynamics_resize(0, &build_setting->flags_library_static); - f_string_dynamics_resize(0, &build_setting->flags_object); - f_string_dynamics_resize(0, &build_setting->flags_object_shared); - f_string_dynamics_resize(0, &build_setting->flags_object_static); - f_string_dynamics_resize(0, &build_setting->flags_program); - f_string_dynamics_resize(0, &build_setting->flags_program_shared); - f_string_dynamics_resize(0, &build_setting->flags_program_static); - f_string_dynamics_resize(0, &build_setting->flags_shared); - f_string_dynamics_resize(0, &build_setting->flags_static); - f_string_dynamics_resize(0, &build_setting->modes); - f_string_dynamics_resize(0, &build_setting->modes_default); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->build_compiler.string, &build_setting->build_compiler.used, &build_setting->build_compiler.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->build_indexer.string, &build_setting->build_indexer.used, &build_setting->build_indexer.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->build_name.string, &build_setting->build_name.used, &build_setting->build_name.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->build_sources_object.string, &build_setting->build_sources_object.used, &build_setting->build_sources_object.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->build_sources_object_shared.string, &build_setting->build_sources_object_shared.used, &build_setting->build_sources_object_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->build_sources_object_static.string, &build_setting->build_sources_object_static.used, &build_setting->build_sources_object_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_headers.string, &build_setting->path_headers.used, &build_setting->path_headers.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_language.string, &build_setting->path_language.used, &build_setting->path_language.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_library_script.string, &build_setting->path_library_script.used, &build_setting->path_library_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_library_shared.string, &build_setting->path_library_shared.used, &build_setting->path_library_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_library_static.string, &build_setting->path_library_static.used, &build_setting->path_library_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_object_script.string, &build_setting->path_object_script.used, &build_setting->path_object_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_object_shared.string, &build_setting->path_object_shared.used, &build_setting->path_object_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_object_static.string, &build_setting->path_object_static.used, &build_setting->path_object_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_program_script.string, &build_setting->path_program_script.used, &build_setting->path_program_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_program_shared.string, &build_setting->path_program_shared.used, &build_setting->path_program_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_program_static.string, &build_setting->path_program_static.used, &build_setting->path_program_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_sources_object.string, &build_setting->path_sources_object.used, &build_setting->path_sources_object.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->process_post.string, &build_setting->process_post.used, &build_setting->process_post.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->process_pre.string, &build_setting->process_pre.used, &build_setting->process_pre.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_major.string, &build_setting->version_major.used, &build_setting->version_major.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_major_prefix.string, &build_setting->version_major_prefix.used, &build_setting->version_major_prefix.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_micro.string, &build_setting->version_micro.used, &build_setting->version_micro.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_micro_prefix.string, &build_setting->version_micro_prefix.used, &build_setting->version_micro_prefix.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_minor.string, &build_setting->version_minor.used, &build_setting->version_minor.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_minor_prefix.string, &build_setting->version_minor_prefix.used, &build_setting->version_minor_prefix.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_nano.string, &build_setting->version_nano.used, &build_setting->version_nano.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_nano_prefix.string, &build_setting->version_nano_prefix.used, &build_setting->version_nano_prefix.size); + + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_indexer_arguments.array, &build_setting->build_indexer_arguments.used, &build_setting->build_indexer_arguments.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_libraries.array, &build_setting->build_libraries.used, &build_setting->build_libraries.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_libraries_shared.array, &build_setting->build_libraries_shared.used, &build_setting->build_libraries_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_libraries_static.array, &build_setting->build_libraries_static.used, &build_setting->build_libraries_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_objects_library.array, &build_setting->build_objects_library.used, &build_setting->build_objects_library.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_objects_library_shared.array, &build_setting->build_objects_library_shared.used, &build_setting->build_objects_library_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_objects_library_static.array, &build_setting->build_objects_library_static.used, &build_setting->build_objects_library_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_objects_program.array, &build_setting->build_objects_program.used, &build_setting->build_objects_program.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_objects_program_shared.array, &build_setting->build_objects_program_shared.used, &build_setting->build_objects_program_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_objects_program_static.array, &build_setting->build_objects_program_static.used, &build_setting->build_objects_program_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_documentation.array, &build_setting->build_sources_documentation.used, &build_setting->build_sources_documentation.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_headers.array, &build_setting->build_sources_headers.used, &build_setting->build_sources_headers.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_headers_shared.array, &build_setting->build_sources_headers_shared.used, &build_setting->build_sources_headers_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_headers_static.array, &build_setting->build_sources_headers_static.used, &build_setting->build_sources_headers_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_library.array, &build_setting->build_sources_library.used, &build_setting->build_sources_library.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_library_shared.array, &build_setting->build_sources_library_shared.used, &build_setting->build_sources_library_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_library_static.array, &build_setting->build_sources_library_static.used, &build_setting->build_sources_library_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_program.array, &build_setting->build_sources_program.used, &build_setting->build_sources_program.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_program_shared.array, &build_setting->build_sources_program_shared.used, &build_setting->build_sources_program_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_program_static.array, &build_setting->build_sources_program_static.used, &build_setting->build_sources_program_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_script.array, &build_setting->build_sources_script.used, &build_setting->build_sources_script.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->build_sources_setting.array, &build_setting->build_sources_setting.used, &build_setting->build_sources_setting.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines.array, &build_setting->defines.used, &build_setting->defines.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_library.array, &build_setting->defines_library.used, &build_setting->defines_library.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_library_shared.array, &build_setting->defines_library_shared.used, &build_setting->defines_library_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_library_static.array, &build_setting->defines_library_static.used, &build_setting->defines_library_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_object.array, &build_setting->defines_object.used, &build_setting->defines_object.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_object_shared.array, &build_setting->defines_object_shared.used, &build_setting->defines_object_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_object_static.array, &build_setting->defines_object_static.used, &build_setting->defines_object_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_program.array, &build_setting->defines_program.used, &build_setting->defines_program.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_program_shared.array, &build_setting->defines_program_shared.used, &build_setting->defines_program_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_program_static.array, &build_setting->defines_program_static.used, &build_setting->defines_program_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_shared.array, &build_setting->defines_shared.used, &build_setting->defines_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->defines_static.array, &build_setting->defines_static.used, &build_setting->defines_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->environment.array, &build_setting->environment.used, &build_setting->environment.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags.array, &build_setting->flags.used, &build_setting->flags.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_library.array, &build_setting->flags_library.used, &build_setting->flags_library.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_library_shared.array, &build_setting->flags_library_shared.used, &build_setting->flags_library_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_library_static.array, &build_setting->flags_library_static.used, &build_setting->flags_library_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_object.array, &build_setting->flags_object.used, &build_setting->flags_object.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_object_shared.array, &build_setting->flags_object_shared.used, &build_setting->flags_object_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_object_static.array, &build_setting->flags_object_static.used, &build_setting->flags_object_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_program.array, &build_setting->flags_program.used, &build_setting->flags_program.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_program_shared.array, &build_setting->flags_program_shared.used, &build_setting->flags_program_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_program_static.array, &build_setting->flags_program_static.used, &build_setting->flags_program_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_shared.array, &build_setting->flags_shared.used, &build_setting->flags_shared.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->flags_static.array, &build_setting->flags_static.used, &build_setting->flags_static.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->modes.array, &build_setting->modes.used, &build_setting->modes.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &build_setting->modes_default.array, &build_setting->modes_default.used, &build_setting->modes_default.size, &f_string_dynamics_delete_callback); } #endif // _di_fake_build_setting_delete_ @@ -106,23 +105,22 @@ extern "C" { if (!build_stage) return; - f_string_dynamic_resize(0, &build_stage->file_library_script); - f_string_dynamic_resize(0, &build_stage->file_library_shared); - f_string_dynamic_resize(0, &build_stage->file_library_static); - f_string_dynamic_resize(0, &build_stage->file_object_script); - f_string_dynamic_resize(0, &build_stage->file_object_shared); - f_string_dynamic_resize(0, &build_stage->file_object_static); - f_string_dynamic_resize(0, &build_stage->file_objects_static); - f_string_dynamic_resize(0, &build_stage->file_process_post); - f_string_dynamic_resize(0, &build_stage->file_process_pre); - f_string_dynamic_resize(0, &build_stage->file_program_script); - f_string_dynamic_resize(0, &build_stage->file_program_shared); - f_string_dynamic_resize(0, &build_stage->file_program_static); - f_string_dynamic_resize(0, &build_stage->file_skeleton); - f_string_dynamic_resize(0, &build_stage->file_sources_documentation); - f_string_dynamic_resize(0, &build_stage->file_sources_headers); - f_string_dynamic_resize(0, &build_stage->file_sources_script); - f_string_dynamic_resize(0, &build_stage->file_sources_settings); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_script.string, &build_stage->file_library_script.used, &build_stage->file_library_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_shared.string, &build_stage->file_library_shared.used, &build_stage->file_library_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_static.string, &build_stage->file_library_static.used, &build_stage->file_library_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_object_script.string, &build_stage->file_object_script.used, &build_stage->file_object_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_object_static.string, &build_stage->file_object_static.used, &build_stage->file_object_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_objects_static.string, &build_stage->file_objects_static.used, &build_stage->file_objects_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_process_post.string, &build_stage->file_process_post.used, &build_stage->file_process_post.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_process_pre.string, &build_stage->file_process_pre.used, &build_stage->file_process_pre.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_program_script.string, &build_stage->file_program_script.used, &build_stage->file_program_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_program_shared.string, &build_stage->file_program_shared.used, &build_stage->file_program_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_program_static.string, &build_stage->file_program_static.used, &build_stage->file_program_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_skeleton.string, &build_stage->file_skeleton.used, &build_stage->file_skeleton.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_sources_documentation.string, &build_stage->file_sources_documentation.used, &build_stage->file_sources_documentation.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_sources_headers.string, &build_stage->file_sources_headers.used, &build_stage->file_sources_headers.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_sources_script.string, &build_stage->file_sources_script.used, &build_stage->file_sources_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_sources_settings.string, &build_stage->file_sources_settings.used, &build_stage->file_sources_settings.size); } #endif // _di_fake_build_stage_delete_ @@ -131,51 +129,50 @@ extern "C" { if (!data) return; - f_string_dynamic_resize(0, &data->path_build); - f_string_dynamic_resize(0, &data->path_build_documentation); - f_string_dynamic_resize(0, &data->path_build_documents); - f_string_dynamic_resize(0, &data->path_build_includes); - f_string_dynamic_resize(0, &data->path_build_libraries); - f_string_dynamic_resize(0, &data->path_build_libraries_script); - f_string_dynamic_resize(0, &data->path_build_libraries_shared); - f_string_dynamic_resize(0, &data->path_build_libraries_static); - f_string_dynamic_resize(0, &data->path_build_objects); - f_string_dynamic_resize(0, &data->path_build_objects_script); - f_string_dynamic_resize(0, &data->path_build_objects_shared); - f_string_dynamic_resize(0, &data->path_build_objects_static); - f_string_dynamic_resize(0, &data->path_build_programs); - f_string_dynamic_resize(0, &data->path_build_programs_script); - f_string_dynamic_resize(0, &data->path_build_programs_shared); - f_string_dynamic_resize(0, &data->path_build_programs_static); - f_string_dynamic_resize(0, &data->path_build_settings); - f_string_dynamic_resize(0, &data->path_build_stage); - - f_string_dynamic_resize(0, &data->path_data_build); - f_string_dynamic_resize(0, &data->path_data_documentation); - f_string_dynamic_resize(0, &data->path_data_settings); - - f_string_dynamic_resize(0, &data->path_documents); - - f_string_dynamic_resize(0, &data->path_licenses); - - f_string_dynamic_resize(0, &data->path_work_includes); - f_string_dynamic_resize(0, &data->path_work_libraries); - f_string_dynamic_resize(0, &data->path_work_libraries_script); - f_string_dynamic_resize(0, &data->path_work_libraries_shared); - f_string_dynamic_resize(0, &data->path_work_libraries_static); - f_string_dynamic_resize(0, &data->path_work_programs); - f_string_dynamic_resize(0, &data->path_work_programs_script); - f_string_dynamic_resize(0, &data->path_work_programs_shared); - f_string_dynamic_resize(0, &data->path_work_programs_static); - - f_string_dynamic_resize(0, &data->file_data_build_defines); - f_string_dynamic_resize(0, &data->file_data_build_dependencies); - f_string_dynamic_resize(0, &data->file_data_build_process_post); - f_string_dynamic_resize(0, &data->file_data_build_process_pre); - f_string_dynamic_resize(0, &data->file_data_build_fakefile); - f_string_dynamic_resize(0, &data->file_data_build_settings); - - f_string_dynamic_resize(0, &data->file_documents_readme); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build.string, &data->path_build.used, &data->path_build.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_documentation.string, &data->path_build_documentation.used, &data->path_build_documentation.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_documents.string, &data->path_build_documents.used, &data->path_build_documents.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_includes.string, &data->path_build_includes.used, &data->path_build_includes.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_libraries.string, &data->path_build_libraries.used, &data->path_build_libraries.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_libraries_script.string, &data->path_build_libraries_script.used, &data->path_build_libraries_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_libraries_shared.string, &data->path_build_libraries_shared.used, &data->path_build_libraries_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_libraries_static.string, &data->path_build_libraries_static.used, &data->path_build_libraries_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_objects_script.string, &data->path_build_objects_script.used, &data->path_build_objects_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_objects_shared.string, &data->path_build_objects_shared.used, &data->path_build_objects_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_objects_static.string, &data->path_build_objects_static.used, &data->path_build_objects_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_programs.string, &data->path_build_programs.used, &data->path_build_programs.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_programs_script.string, &data->path_build_programs_script.used, &data->path_build_programs_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_programs_shared.string, &data->path_build_programs_shared.used, &data->path_build_programs_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_programs_static.string, &data->path_build_programs_static.used, &data->path_build_programs_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_settings.string, &data->path_build_settings.used, &data->path_build_settings.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_stage.string, &data->path_build_stage.used, &data->path_build_stage.size); + + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_data_build.string, &data->path_data_build.used, &data->path_data_build.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_data_documentation.string, &data->path_data_documentation.used, &data->path_data_documentation.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_data_settings.string, &data->path_data_settings.used, &data->path_data_settings.size); + + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_documents.string, &data->path_documents.used, &data->path_documents.size); + + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_licenses.string, &data->path_licenses.used, &data->path_licenses.size); + + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_includes.string, &data->path_work_includes.used, &data->path_work_includes.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_libraries.string, &data->path_work_libraries.used, &data->path_work_libraries.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_libraries_script.string, &data->path_work_libraries_script.used, &data->path_work_libraries_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_libraries_shared.string, &data->path_work_libraries_shared.used, &data->path_work_libraries_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_libraries_static.string, &data->path_work_libraries_static.used, &data->path_work_libraries_static.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_programs.string, &data->path_work_programs.used, &data->path_work_programs.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_programs_script.string, &data->path_work_programs_script.used, &data->path_work_programs_script.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_programs_shared.string, &data->path_work_programs_shared.used, &data->path_work_programs_shared.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_work_programs_static.string, &data->path_work_programs_static.used, &data->path_work_programs_static.size); + + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->file_data_build_defines.string, &data->file_data_build_defines.used, &data->file_data_build_defines.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->file_data_build_dependencies.string, &data->file_data_build_dependencies.used, &data->file_data_build_dependencies.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->file_data_build_process_post.string, &data->file_data_build_process_post.used, &data->file_data_build_process_post.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->file_data_build_process_pre.string, &data->file_data_build_process_pre.used, &data->file_data_build_process_pre.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->file_data_build_fakefile.string, &data->file_data_build_fakefile.used, &data->file_data_build_fakefile.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->file_data_build_settings.string, &data->file_data_build_settings.used, &data->file_data_build_settings.size); + + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->file_documents_readme.string, &data->file_documents_readme.used, &data->file_documents_readme.size); } #endif // _di_fake_data_delete_ @@ -187,14 +184,15 @@ extern "C" { fll_program_data_delete(&main->program); fake_setting_delete(&main->setting); - f_string_dynamic_resize(0, &main->buffer); - f_string_dynamic_resize(0, &main->cache_1); - f_string_dynamic_resize(0, &main->cache_2); - f_string_dynamic_resize(0, &main->cache_argument); - f_string_dynamics_resize(0, &main->cache_arguments); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->buffer.string, &main->buffer.used, &main->buffer.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache_1.string, &main->cache_1.used, &main->cache_1.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache_2.string, &main->cache_2.used, &main->cache_2.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache_argument.string, &main->cache_argument.used, &main->cache_argument.size); - f_string_dynamic_resize(0, &main->cache_map.name); - f_string_dynamic_resize(0, &main->cache_map.value); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size, &f_string_dynamics_delete_callback); + + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache_map.name.string, &main->cache_map.name.used, &main->cache_map.name.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache_map.value.string, &main->cache_map.value.used, &main->cache_map.value.size); f_iki_data_delete(&main->cache_iki); @@ -212,49 +210,49 @@ extern "C" { f_string_maps_resize(0, &data_make->environment); - f_string_dynamics_resize(0, &data_make->parameter.build); - f_string_dynamics_resize(0, &data_make->parameter.color); - f_string_dynamics_resize(0, &data_make->parameter.data); - f_string_dynamics_resize(0, &data_make->parameter.define); - f_string_dynamics_resize(0, &data_make->parameter.documents); - f_string_dynamics_resize(0, &data_make->parameter.fakefile); - f_string_dynamics_resize(0, &data_make->parameter.licenses); - f_string_dynamics_resize(0, &data_make->parameter.mode); - f_string_dynamics_resize(0, &data_make->parameter.process); - f_string_dynamics_resize(0, &data_make->parameter.settings); - f_string_dynamics_resize(0, &data_make->parameter.sources); - f_string_dynamics_resize(0, &data_make->parameter.verbosity); - f_string_dynamics_resize(0, &data_make->parameter.work); - - f_string_dynamics_resize(0, &data_make->parameter_option.build); - f_string_dynamics_resize(0, &data_make->parameter_option.color); - f_string_dynamics_resize(0, &data_make->parameter_option.data); - f_string_dynamics_resize(0, &data_make->parameter_option.define); - f_string_dynamics_resize(0, &data_make->parameter_option.documents); - f_string_dynamics_resize(0, &data_make->parameter_option.fakefile); - f_string_dynamics_resize(0, &data_make->parameter_option.licenses); - f_string_dynamics_resize(0, &data_make->parameter_option.mode); - f_string_dynamics_resize(0, &data_make->parameter_option.process); - f_string_dynamics_resize(0, &data_make->parameter_option.settings); - f_string_dynamics_resize(0, &data_make->parameter_option.sources); - f_string_dynamics_resize(0, &data_make->parameter_option.verbosity); - f_string_dynamics_resize(0, &data_make->parameter_option.work); - - f_string_dynamics_resize(0, &data_make->parameter_value.build); - f_string_dynamics_resize(0, &data_make->parameter_value.color); - f_string_dynamics_resize(0, &data_make->parameter_value.data); - f_string_dynamics_resize(0, &data_make->parameter_value.define); - f_string_dynamics_resize(0, &data_make->parameter_value.documents); - f_string_dynamics_resize(0, &data_make->parameter_value.fakefile); - f_string_dynamics_resize(0, &data_make->parameter_value.licenses); - f_string_dynamics_resize(0, &data_make->parameter_value.mode); - f_string_dynamics_resize(0, &data_make->parameter_value.process); - f_string_dynamics_resize(0, &data_make->parameter_value.settings); - f_string_dynamics_resize(0, &data_make->parameter_value.sources); - f_string_dynamics_resize(0, &data_make->parameter_value.verbosity); - f_string_dynamics_resize(0, &data_make->parameter_value.work); - - f_string_dynamics_resize(0, &data_make->path.stack); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.build.array, &data_make->parameter.build.used, &data_make->parameter.build.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.color.array, &data_make->parameter.color.used, &data_make->parameter.color.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.data.array, &data_make->parameter.data.used, &data_make->parameter.data.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.define.array, &data_make->parameter.define.used, &data_make->parameter.define.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.documents.array, &data_make->parameter.documents.used, &data_make->parameter.documents.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.fakefile.array, &data_make->parameter.fakefile.used, &data_make->parameter.fakefile.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.licenses.array, &data_make->parameter.licenses.used, &data_make->parameter.licenses.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.mode.array, &data_make->parameter.mode.used, &data_make->parameter.mode.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.process.array, &data_make->parameter.process.used, &data_make->parameter.process.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.settings.array, &data_make->parameter.settings.used, &data_make->parameter.settings.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.sources.array, &data_make->parameter.sources.used, &data_make->parameter.sources.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.verbosity.array, &data_make->parameter.verbosity.used, &data_make->parameter.verbosity.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.work.array, &data_make->parameter.work.used, &data_make->parameter.work.size, &f_string_dynamics_delete_callback); + + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.build.array, &data_make->parameter_option.build.used, &data_make->parameter_option.build.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.color.array, &data_make->parameter_option.color.used, &data_make->parameter_option.color.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.data.array, &data_make->parameter_option.data.used, &data_make->parameter_option.data.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.define.array, &data_make->parameter_option.define.used, &data_make->parameter_option.define.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.documents.array, &data_make->parameter_option.documents.used, &data_make->parameter_option.documents.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.fakefile.array, &data_make->parameter_option.fakefile.used, &data_make->parameter_option.fakefile.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.licenses.array, &data_make->parameter_option.licenses.used, &data_make->parameter_option.licenses.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.mode.array, &data_make->parameter_option.mode.used, &data_make->parameter_option.mode.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.process.array, &data_make->parameter_option.process.used, &data_make->parameter_option.process.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.settings.array, &data_make->parameter_option.settings.used, &data_make->parameter_option.settings.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.sources.array, &data_make->parameter_option.sources.used, &data_make->parameter_option.sources.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.verbosity.array, &data_make->parameter_option.verbosity.used, &data_make->parameter_option.verbosity.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.work.array, &data_make->parameter_option.work.used, &data_make->parameter_option.work.size, &f_string_dynamics_delete_callback); + + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.build.array, &data_make->parameter_value.build.used, &data_make->parameter_value.build.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.color.array, &data_make->parameter_value.color.used, &data_make->parameter_value.color.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.data.array, &data_make->parameter_value.data.used, &data_make->parameter_value.data.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.define.array, &data_make->parameter_value.define.used, &data_make->parameter_value.define.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.documents.array, &data_make->parameter_value.documents.used, &data_make->parameter_value.documents.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.fakefile.array, &data_make->parameter_value.fakefile.used, &data_make->parameter_value.fakefile.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.licenses.array, &data_make->parameter_value.licenses.used, &data_make->parameter_value.licenses.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.mode.array, &data_make->parameter_value.mode.used, &data_make->parameter_value.mode.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.process.array, &data_make->parameter_value.process.used, &data_make->parameter_value.process.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.settings.array, &data_make->parameter_value.settings.used, &data_make->parameter_value.settings.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.sources.array, &data_make->parameter_value.sources.used, &data_make->parameter_value.sources.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.verbosity.array, &data_make->parameter_value.verbosity.used, &data_make->parameter_value.verbosity.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_value.work.array, &data_make->parameter_value.work.used, &data_make->parameter_value.work.size, &f_string_dynamics_delete_callback); + + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->path.stack.array, &data_make->path.stack.used, &data_make->path.stack.size, &f_string_dynamics_delete_callback); f_memory_arrays_resize(0, sizeof(f_fss_named_t), (void **) &data_make->fakefile.array, &data_make->fakefile.used, &data_make->fakefile.size, &f_fss_nameds_delete_callback); } @@ -272,18 +270,18 @@ extern "C" { if (!setting) return; - f_string_dynamic_resize(0, &setting->build); - f_string_dynamic_resize(0, &setting->data); - f_string_dynamic_resize(0, &setting->documents); - f_string_dynamic_resize(0, &setting->fakefile); - f_string_dynamic_resize(0, &setting->licenses); - f_string_dynamic_resize(0, &setting->process); - f_string_dynamic_resize(0, &setting->settings); - f_string_dynamic_resize(0, &setting->sources); - f_string_dynamic_resize(0, &setting->work); - - f_string_dynamics_resize(0, &setting->defines); - f_string_dynamics_resize(0, &setting->modes); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->build.string, &setting->build.used, &setting->build.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->data.string, &setting->data.used, &setting->data.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->documents.string, &setting->documents.used, &setting->documents.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->fakefile.string, &setting->fakefile.used, &setting->fakefile.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->licenses.string, &setting->licenses.used, &setting->licenses.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->process.string, &setting->process.used, &setting->process.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->settings.string, &setting->settings.used, &setting->settings.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->sources.string, &setting->sources.used, &setting->sources.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->work.string, &setting->work.used, &setting->work.size); + + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->defines.array, &setting->defines.used, &setting->defines.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->modes.array, &setting->modes.used, &setting->modes.size, &f_string_dynamics_delete_callback); f_memory_array_resize(0, sizeof(uint8_t), (void **) &setting->operations.array, &setting->operations.used, &setting->operations.size); } diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index bde1b00..0db1729 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -309,12 +309,12 @@ extern "C" { size_file = fake_max_initial_buffer_d; } - main->setting.state.status = f_string_dynamic_increase_by(size_file, buffer); + main->setting.state.status = f_memory_array_increase_by(size_file, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(main->setting.state.status)) { const f_string_static_t message = macro_f_string_static_t_initialize_1("allocate buffer size for", 0, 24); - fake_print_error_file(&main->program.error, macro_fake_f(f_string_dynamic_increase_by), path_file, message, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_memory_array_increase_by), path_file, message, fll_error_file_type_file_e); return; } @@ -367,11 +367,11 @@ extern "C" { file.stream = F_type_input_d; file.size_read = fake_allocation_pipe_d; - main->setting.state.status = f_string_dynamic_increase_by(fake_max_initial_buffer_d, buffer); + main->setting.state.status = f_memory_array_increase_by(fake_max_initial_buffer_d, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(main->setting.state.status)) { const f_string_static_t message = macro_f_string_static_t_initialize_1("allocate buffer size for", 0, 24); - fake_print_error_file(&main->program.error, macro_fake_f(f_string_dynamic_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_memory_array_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e); return; } diff --git a/level_3/fake/c/main/fake.h b/level_3/fake/c/main/fake.h index 468e719..a031151 100644 --- a/level_3/fake/c/main/fake.h +++ b/level_3/fake/c/main/fake.h @@ -237,7 +237,7 @@ extern "C" { * Errors (with error bit) from: f_file_size() * Errors (with error bit) from: f_file_stream_open() * Errors (with error bit) from: f_file_stream_read() - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * @param path_file * The path to the file to load. * @param required @@ -250,7 +250,7 @@ extern "C" { * @see f_file_size() * @see f_file_stream_open() * @see f_file_stream_read() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see fll_program_standard_signal_received() */ #ifndef _di_fake_file_buffer_ @@ -269,12 +269,12 @@ extern "C" { * F_interrupt (with error bit) on interrupt signal received. * * Errors (with error bit) from: f_file_stream_read_block() - * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: f_memory_array_increase_by() * @param buffer * A buffer containing the contents of the file. * * @see f_file_stream_read_block() - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see fll_program_standard_signal_received() */ #ifndef _di_fake_pipe_buffer_ diff --git a/level_3/fake/c/main/fake/do.c b/level_3/fake/c/main/fake/do.c index 5f761c4..47b784e 100644 --- a/level_3/fake/c/main/fake/do.c +++ b/level_3/fake/c/main/fake/do.c @@ -68,7 +68,7 @@ extern "C" { if (flag & f_directory_recurse_do_flag_directory_e) { // Push the directory name on the path stack (the destination path is expected to be pre-populated). - recurse->state.status = f_string_dynamic_increase_by(f_path_separator_s.used + name.used + 1, &recurse->path_cache); + recurse->state.status = f_memory_array_increase_by(f_path_separator_s.used + name.used + 1, sizeof(f_char_t), (void **) &recurse->path_cache.string, &recurse->path_cache.used, &recurse->path_cache.size); if (F_status_is_error_not(recurse->state.status)) { recurse->state.status = f_string_dynamic_append_assure(f_path_separator_s, &recurse->path_cache); @@ -124,7 +124,7 @@ extern "C" { fake_string_dynamic_reset(&map->value); - recurse->state.status = f_string_dynamic_increase_by(recurse->path_cache.used + f_path_separator_s.used + name.used + 1, &map->value); + recurse->state.status = f_memory_array_increase_by(recurse->path_cache.used + f_path_separator_s.used + name.used + 1, sizeof(f_char_t), (void **) &map->value.string, &map->value.used, &map->value.size); if (F_status_is_error_not(recurse->state.status)) { recurse->state.status = f_string_dynamic_append_nulless(recurse->path_cache, &map->value); diff --git a/level_3/fake/c/main/fake/do.h b/level_3/fake/c/main/fake/do.h index 71b3a39..d042939 100644 --- a/level_3/fake/c/main/fake/do.h +++ b/level_3/fake/c/main/fake/do.h @@ -36,9 +36,9 @@ extern "C" { * * Errors (with error bit) from: f_file_clone(). * Errors (with error bit) from: f_file_copy(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_append_assure(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). * @param name * The directory name currently being process based on the flag. * @param flag @@ -46,9 +46,9 @@ extern "C" { * * @see f_file_clone() * @see f_file_copy() + * @see f_memory_array_increase_by() * @see f_string_dynamic_append_assure() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamic_increase_by() * * @see fake_build_copy() */ diff --git a/level_3/fake/c/main/make/load_fakefile.c b/level_3/fake/c/main/make/load_fakefile.c index 70b430b..0b4c22d 100644 --- a/level_3/fake/c/main/make/load_fakefile.c +++ b/level_3/fake/c/main/make/load_fakefile.c @@ -199,8 +199,9 @@ extern "C" { } if (F_status_is_error_not(data_make->main->setting.state.status)) { - function_name = macro_fake_f(f_string_dynamics_resize); - data_make->main->setting.state.status = f_string_dynamics_resize(1, &data_make->setting_make.parameter.array[0].value); + function_name = macro_fake_f(f_memory_arrays_resize); + + data_make->main->setting.state.status = f_memory_arrays_resize(1, sizeof(f_string_dynamic_t), (void **) &data_make->setting_make.parameter.array[0].value.array, &data_make->setting_make.parameter.array[0].value.used, &data_make->setting_make.parameter.array[0].value.size, &f_string_dynamics_delete_callback); } if (F_status_is_error(data_make->main->setting.state.status)) { @@ -414,7 +415,7 @@ extern "C" { } } // for - f_string_dynamic_resize(0, &combined); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &combined.string, &combined.used, &combined.size); } f_string_map_multis_resize(0, &define); @@ -454,20 +455,20 @@ extern "C" { } // for if (j == data_make->setting_build.environment.used) { - data_make->main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, &data_make->setting_build.environment); + data_make->main->setting.state.status = f_memory_array_increase(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &data_make->setting_build.environment.array, &data_make->setting_build.environment.used, &data_make->setting_build.environment.size); if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&data_make->main->program.error, macro_fake_f(f_memory_array_increase)); break; } data_make->setting_build.environment.array[j].used = 0; - data_make->main->setting.state.status = f_string_dynamic_increase_by(name_define.used + 1, &data_make->setting_build.environment.array[j]); + data_make->main->setting.state.status = f_memory_array_increase_by(name_define.used + 1, sizeof(f_char_t), (void **) &data_make->setting_build.environment.array[j].string, &data_make->setting_build.environment.array[j].used, &data_make->setting_build.environment.array[j].size); if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + fake_print_error(&data_make->main->program.error, macro_fake_f(f_memory_array_increase_by)); break; } @@ -503,7 +504,7 @@ extern "C" { name_define.used = 0; } // for - f_string_dynamic_resize(0, &name_define); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name_define.string, &name_define.used, &name_define.size); if (F_status_is_error(data_make->main->setting.state.status)) return; diff --git a/level_3/fake/c/main/make/load_fakefile.h b/level_3/fake/c/main/make/load_fakefile.h index aca3a85..cb2e71c 100644 --- a/level_3/fake/c/main/make/load_fakefile.h +++ b/level_3/fake/c/main/make/load_fakefile.h @@ -150,19 +150,19 @@ extern "C" { * This alters data_make.main->setting.state.status: * F_okay on success. * + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: f_string_dynamics_increase(). * @param content * The setting content. * + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_string_dynamic_append() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamic_increase_by() * @see f_string_dynamic_partial_append_nulless() - * @see f_string_dynamics_increase() */ #ifndef _di_fake_make_load_fakefile_setting_environment_ extern void fake_make_load_fakefile_setting_environment(fake_make_data_t * const data_make, f_string_ranges_t * const content); diff --git a/level_3/fake/c/main/make/load_parameters.c b/level_3/fake/c/main/make/load_parameters.c index 2a3dee4..bcf8e83 100644 --- a/level_3/fake/c/main/make/load_parameters.c +++ b/level_3/fake/c/main/make/load_parameters.c @@ -13,14 +13,14 @@ extern "C" { fake_main_t * const main = data_make->main; if (main->program.context.mode != f_color_mode_none_e) { - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.color); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.color.array, &data_make->parameter.color.used, &data_make->parameter.color.size); if (F_status_is_error_not(main->setting.state.status)) { - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.color); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.color.array, &data_make->parameter_option.color.used, &data_make->parameter_option.color.size); } if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); return; } @@ -77,14 +77,14 @@ extern "C" { } if (main->program.error.verbosity != f_console_verbosity_normal_e) { - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.verbosity); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.verbosity.array, &data_make->parameter.verbosity.used, &data_make->parameter.verbosity.size); if (F_status_is_error_not(main->setting.state.status)) { - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.verbosity); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &data_make->parameter_option.verbosity.array, &data_make->parameter_option.verbosity.used, &data_make->parameter_option.verbosity.size); } if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); return; } @@ -192,23 +192,23 @@ extern "C" { for (j = 0; j < source[i].used; ++j) { if (destination[i]->used + 2 > destination[i]->size) { - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination[i]->array, &destination[i]->used, &destination[i]->size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); return; } } - main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); + main->setting.state.status = f_memory_array_increase(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination_option[i]->array, &destination_option[i]->used, &destination_option[i]->size); if (F_status_is_error_not(main->setting.state.status)) { - main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); + main->setting.state.status = f_memory_array_increase(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination_value[i]->array, &destination_value[i]->used, &destination_value[i]->size); } if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase)); return; } @@ -237,10 +237,10 @@ extern "C" { ++destination[i]->used; ++destination_option[i]->used; - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination[i]->array, &destination[i]->used, &destination[i]->size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); return; } @@ -341,23 +341,23 @@ extern "C" { if (!(console[i]->result & f_console_result_found_e)) continue; if (destination[i]->used + 2 > destination[i]->size) { - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination[i]->array, &destination[i]->used, &destination[i]->size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); return; } } - main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); + main->setting.state.status = f_memory_array_increase(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination_option[i]->array, &destination_option[i]->used, &destination_option[i]->size); if (F_status_is_error_not(main->setting.state.status)) { - main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); + main->setting.state.status = f_memory_array_increase(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination_value[i]->array, &destination_value[i]->used, &destination_value[i]->size); } if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase)); return; } @@ -386,10 +386,10 @@ extern "C" { ++destination[i]->used; ++destination_option[i]->used; - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination[i]->array, &destination[i]->used, &destination[i]->size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); return; } diff --git a/level_3/fake/c/main/make/load_parameters.h b/level_3/fake/c/main/make/load_parameters.h index 913cd35..aa8fe96 100644 --- a/level_3/fake/c/main/make/load_parameters.h +++ b/level_3/fake/c/main/make/load_parameters.h @@ -25,15 +25,15 @@ extern "C" { * This alters data_make.main->setting.state.status: * F_okay on success. * + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). - * Errors (with error bit) from: f_string_dynamics_increase(). - * Errors (with error bit) from: f_string_dynamics_increase_by(). * + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_string_dynamic_append() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamics_increase() - * @see f_string_dynamics_increase_by() */ #ifndef _di_fake_make_load_parameters_ extern void fake_make_load_parameters(fake_make_data_t * const data_make); diff --git a/level_3/fake/c/main/make/operate.c b/level_3/fake/c/main/make/operate.c index 4ea35b3..dd9b7dd 100644 --- a/level_3/fake/c/main/make/operate.c +++ b/level_3/fake/c/main/make/operate.c @@ -20,10 +20,10 @@ extern "C" { data_make.data = data; data_make.main = main; - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &data_make.path.stack); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &data_make.path.stack.array, &data_make.path.stack.used, &data_make.path.stack.size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&data_make.main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&data_make.main->program.error, macro_fake_f(f_memory_array_increase)); return; } @@ -226,10 +226,10 @@ extern "C" { fake_main_t * const main = data_make->main; // Pre-allocate the known arguments size. - main->setting.state.status = f_string_dynamics_increase_by(content.used, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase_by(content.used, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_string_too_large) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); return; } @@ -347,10 +347,10 @@ extern "C" { main->setting.state.handle = 0; main->setting.state.data = 0; - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase)); return; } @@ -366,10 +366,10 @@ extern "C" { if (quotes.array[i]) { ++main->cache_arguments.used; - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase)); break; } @@ -478,10 +478,10 @@ extern "C" { else if (f_compare_dynamic_partial_string(fake_make_parameter_variable_top_s.string, main->buffer, fake_make_parameter_variable_top_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->path.stack.used) { - main->setting.state.status = f_string_dynamic_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); + main->setting.state.status = f_memory_array_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, sizeof(f_char_t), (void **) &main->cache_arguments.array[main->cache_arguments.used].string, &main->cache_arguments.array[main->cache_arguments.used].used, &main->cache_arguments.array[main->cache_arguments.used].size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); break; } @@ -509,10 +509,10 @@ extern "C" { else if (f_compare_dynamic_partial_string(fake_make_parameter_variable_current_s.string, main->buffer, fake_make_parameter_variable_current_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->path.stack.used) { - main->setting.state.status = f_string_dynamic_increase_by(data_make->path.stack.array[data_make->path.stack.used - 1].used + f_path_separator_s.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); + main->setting.state.status = f_memory_array_increase_by(data_make->path.stack.array[data_make->path.stack.used - 1].used + f_path_separator_s.used + 1, sizeof(f_char_t), (void **) &main->cache_arguments.array[main->cache_arguments.used].string, &main->cache_arguments.array[main->cache_arguments.used].used, &main->cache_arguments.array[main->cache_arguments.used].size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); break; } @@ -560,10 +560,10 @@ extern "C" { } // for } // for - main->setting.state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); + main->setting.state.status = f_memory_array_increase_by(l + f_string_space_s.used + 1, sizeof(f_char_t), (void **) &main->cache_arguments.array[main->cache_arguments.used].string, &main->cache_arguments.array[main->cache_arguments.used].used, &main->cache_arguments.array[main->cache_arguments.used].size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); break; } @@ -605,10 +605,10 @@ extern "C" { if (separate) { ++main->cache_arguments.used; - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase)); break; } @@ -658,10 +658,10 @@ extern "C" { } // for } // for - main->setting.state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); + main->setting.state.status = f_memory_array_increase_by(l + f_string_space_s.used + 1, sizeof(f_char_t), (void **) &main->cache_arguments.array[main->cache_arguments.used].string, &main->cache_arguments.array[main->cache_arguments.used].used, &main->cache_arguments.array[main->cache_arguments.used].size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); break; } @@ -686,10 +686,10 @@ extern "C" { else { ++main->cache_arguments.used; - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase)); break; } @@ -793,10 +793,10 @@ extern "C" { if (!(content.array[i].start == iki_data->variable.array[0].start && content.array[i].stop == iki_data->variable.array[0].stop && !quotes.array[i]) || (iki_type & 0xb) && !quotes.array[i] || i && content.used > 1 && i + 1 == content.used) { ++main->cache_arguments.used; - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase)); break; } @@ -815,10 +815,10 @@ extern "C" { ++main->cache_arguments.used; - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase)); break; } @@ -1119,7 +1119,7 @@ extern "C" { if (F_status_is_error_not(main->setting.state.status) && !quote) { ++main->cache_arguments.used; - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); } if (F_status_is_error(main->setting.state.status)) return; @@ -1197,7 +1197,7 @@ extern "C" { fake_string_dynamic_reset(&main->cache_1); fake_string_dynamic_reset(&main->cache_2); - main->setting.state.status = f_string_dynamic_increase_by((range_name.stop - range_name.start) + 2, &main->cache_1); + main->setting.state.status = f_memory_array_increase_by((range_name.stop - range_name.start) + 2, sizeof(f_char_t), (void **) &main->cache_1.string, &main->cache_1.used, &main->cache_1.size); if (F_status_is_error_not(main->setting.state.status)) { main->setting.state.status = f_string_dynamic_partial_append_nulless(main->buffer, range_name, &main->cache_1); @@ -1215,10 +1215,10 @@ extern "C" { return; } - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size); if (F_status_is_error_not(main->setting.state.status)) { - main->setting.state.status = f_string_dynamic_increase_by(main->cache_2.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); + main->setting.state.status = f_memory_array_increase_by(main->cache_2.used + 1, sizeof(f_char_t), (void **) &main->cache_arguments.array[main->cache_arguments.used].string, &main->cache_arguments.array[main->cache_arguments.used].used, &main->cache_arguments.array[main->cache_arguments.used].size); } if (F_status_is_error_not(main->setting.state.status)) { diff --git a/level_3/fake/c/main/make/operate.h b/level_3/fake/c/main/make/operate.h index 33958f2..3aee904 100644 --- a/level_3/fake/c/main/make/operate.h +++ b/level_3/fake/c/main/make/operate.h @@ -32,18 +32,18 @@ extern "C" { * F_interrupt (with error bit) on interrupt signal received. * * Errors (with error bit) from: f_directory_open() + * Errors (with error bit) from: f_memory_array_increase() * Errors (with error bit) from: f_path_change_at() * Errors (with error bit) from: f_path_current() - * Errors (with error bit) from: f_string_dynamics_increase() * * Errors (with error bit) from: fake_make_load_fakefile() * Errors (with error bit) from: fake_make_load_parameters() * Errors (with error bit) from: fake_make_operate_section() * * @see f_directory_open() + * @see f_memory_array_increase() * @see f_path_change_at() * @see f_path_current() - * @see f_string_dynamics_increase() * @see fll_program_print_signal_received() * * @see fake_make_load_fakefile() @@ -68,15 +68,14 @@ extern "C" { * * F_interrupt (with error bit) on interrupt signal received. * + * Errors (with error bit) from: f_compare_dynamic_partial_string() + * Errors (with error bit) from: f_memory_array_increase() + * Errors (with error bit) from: f_memory_array_increase_by() * Errors (with error bit) from: f_string_dynamic_append() * Errors (with error bit) from: f_string_dynamic_append_assure() * Errors (with error bit) from: f_string_dynamic_append_nulless() - * Errors (with error bit) from: f_string_dynamic_increase_by() * Errors (with error bit) from: f_string_dynamic_partial_append_nulless() - * Errors (with error bit) from: f_string_dynamics_increase() - * Errors (with error bit) from: f_string_dynamics_increase_by() * Errors (with error bit) from: fl_iki_read() - * Errors (with error bit) from: f_compare_dynamic_partial_string() * * Errors (with error bit) from: fake_make_operate_expand_build() * Errors (with error bit) from: fake_make_operate_expand_context() @@ -88,15 +87,14 @@ extern "C" { * @param quotes * The array of quotes associated with the content. * + * @see f_compare_dynamic_partial_string() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_string_dynamic_append() * @see f_string_dynamic_append_assure() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamic_increase_by() * @see f_string_dynamic_partial_append_nulless() - * @see f_string_dynamics_increase() - * @see f_string_dynamics_increase_by() * @see fl_iki_read() - * @see f_compare_dynamic_partial_string() * * @see fake_make_operate_expand_build() * @see fake_make_operate_expand_context() @@ -117,17 +115,17 @@ extern "C" { * F_true on success and match expanded. * F_false on no matches to expand. * + * Errors (with error bit) from: f_memory_array_increase() * Errors (with error bit) from: f_string_dynamic_append_nulless() * Errors (with error bit) from: f_string_dynamic_mash() - * Errors (with error bit) from: f_string_dynamics_increase() * @param quote * The quote associated with the content. * @param range_name * The range representing the variable content name string within the data_make.main.buffer. * + * @see f_memory_array_increase() * @see f_string_dynamic_append_nulless() * @see f_string_dynamic_mash() - * @see f_string_dynamics_increase() */ #ifndef _di_fake_make_operate_expand_build_ extern void fake_make_operate_expand_build(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name); @@ -169,20 +167,20 @@ extern "C" { * F_false on no matches to expand. * * Errors (with error bit) from: f_environment_get(). + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). - * Errors (with error bit) from: f_string_dynamics_increase(). * @param quote * The quote associated with the content. * @param range_name * The range representing the variable content name string within the data_make.main.buffer. * * @see f_environment_get() + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_string_dynamic_append_nulless() * @see f_string_dynamic_partial_append_nulless() - * @see f_string_dynamic_increase_by() - * @see f_string_dynamics_increase() */ #ifndef _di_fake_make_operate_expand_environment_ extern void fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name); diff --git a/level_3/fake/c/main/make/operate_process.c b/level_3/fake/c/main/make/operate_process.c index 0401d62..1d3eaba 100644 --- a/level_3/fake/c/main/make/operate_process.c +++ b/level_3/fake/c/main/make/operate_process.c @@ -127,7 +127,7 @@ extern "C" { fake_main_t * const main = data_make->main; - main->setting.state.status = f_string_dynamic_increase_by(source.used, destination); + main->setting.state.status = f_memory_array_increase_by(source.used, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(main->setting.state.status)) return; for (f_number_unsigned_t i = 0; i < source.used; ++i) { @@ -140,7 +140,7 @@ extern "C" { // A slash by itself at the end of the string is invalid. if (++i >= source.used) break; - main->setting.state.status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); + main->setting.state.status = f_memory_array_increase_by(F_memory_default_allocation_small_d, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(main->setting.state.status)) return; if (source.string[i] == f_string_ascii_slash_backward_s.string[0]) { @@ -221,7 +221,7 @@ extern "C" { else { // Reserve 4-bytes (the max size of a Unicode UTF-8 sequence). - main->setting.state.status = f_string_dynamic_increase_by(4, destination); + main->setting.state.status = f_memory_array_increase_by(4, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(main->setting.state.status)) return; if (!codepoint) { @@ -264,7 +264,7 @@ extern "C" { } } else { - main->setting.state.status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); + main->setting.state.status = f_memory_array_increase_by(F_memory_default_allocation_small_d, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(main->setting.state.status)) return; destination->string[destination->used++] = source.string[i]; @@ -383,14 +383,14 @@ extern "C" { if (F_status_is_error(main->setting.state.status)) { fake_print_error(&main->program.error, macro_fake_f(f_conversion_number_signed_to_string)); - f_string_dynamic_resize(0, &number); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &number.string, &number.used, &number.size); return; } main->setting.state.status = f_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); - f_string_dynamic_resize(0, &number); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &number.string, &number.used, &number.size); if (F_status_is_error(main->setting.state.status)) { fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); diff --git a/level_3/fake/c/main/make/operate_process.h b/level_3/fake/c/main/make/operate_process.h index 21d53e0..9345cf5 100644 --- a/level_3/fake/c/main/make/operate_process.h +++ b/level_3/fake/c/main/make/operate_process.h @@ -136,7 +136,7 @@ extern "C" { * F_okay on success. * F_data_not if source.used is 0. * - * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_utf_unicode_from(). * Errors (with error bit) from: f_utf_unicode_string_to(). * @param source @@ -145,7 +145,7 @@ extern "C" { * The processed and escaped string. * This is appended to. * - * @see f_string_dynamic_increase_by() + * @see f_memory_array_increase_by() * @see f_utf_unicode_from() * @see f_utf_unicode_string_to() */ diff --git a/level_3/fake/c/main/make/operate_process_type.c b/level_3/fake/c/main/make/operate_process_type.c index 2d3fdbe..c3c9674 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -1681,10 +1681,10 @@ extern "C" { if (found) { for (f_number_unsigned_t j = 0; j < data_make->setting_make.parameter.array[i].value.size; ++j) { - main->setting.state.status = f_string_dynamic_resize(0, &data_make->setting_make.parameter.array[i].value.array[j]); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &data_make->setting_make.parameter.array[i].value.array[j].string, &data_make->setting_make.parameter.array[i].value.array[j].used, &data_make->setting_make.parameter.array[i].value.array[j].size); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_resize)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_resize)); main->setting.state.status = F_status_set_error(F_failure); @@ -1693,10 +1693,10 @@ extern "C" { } // for if (data_make->setting_make.parameter.array[i].value.size) { - main->setting.state.status = f_string_dynamics_resize(0, &data_make->setting_make.parameter.array[i].value); + main->setting.state.status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->setting_make.parameter.array[i].value.array, &data_make->setting_make.parameter.array[i].value.used, &data_make->setting_make.parameter.array[i].value.size, &f_string_dynamics_delete_callback); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_resize)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_resize)); main->setting.state.status = F_status_set_error(F_failure); } @@ -1729,10 +1729,10 @@ extern "C" { data_make->setting_make.parameter.array[i].value.used = 0; if (main->cache_arguments.used > 1) { - main->setting.state.status = f_string_dynamics_resize(main->cache_arguments.used - 1, &data_make->setting_make.parameter.array[i].value); + main->setting.state.status = f_memory_arrays_resize(main->cache_arguments.used - 1, sizeof(f_string_dynamic_t), (void **) &data_make->setting_make.parameter.array[i].value.array, &data_make->setting_make.parameter.array[i].value.used, &data_make->setting_make.parameter.array[i].value.size, &f_string_dynamics_delete_callback); if (F_status_is_error(main->setting.state.status)) { - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_resize)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_arrays_resize)); main->setting.state.status = F_status_set_error(F_failure); @@ -1766,7 +1766,7 @@ extern "C" { f_string_dynamic_t *argument = &data_make->path.stack.array[data_make->path.stack.used - 1]; - f_string_dynamic_resize(0, argument); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &argument->string, &argument->used, &argument->size); --data_make->path.stack.used; @@ -1821,7 +1821,7 @@ extern "C" { total += main->cache_arguments.array[i].used; } // for - main->setting.state.status = f_string_dynamic_increase_by(total, &main->cache_1); + main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_char_t), (void **) &main->cache_1.string, &main->cache_1.used, &main->cache_1.size); if (F_status_is_error(main->setting.state.status)) { fake_print_error(&main->program.error, macro_fake_f(f_file_stream_open)); @@ -1910,18 +1910,18 @@ extern "C" { fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_path_change), main->cache_arguments.array[0]); } else { - main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->path.stack); + main->setting.state.status = f_memory_array_increase_by(fake_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &data_make->path.stack.array, &data_make->path.stack.used, &data_make->path.stack.size); if (F_status_is_error(main->setting.state.status)) { if (F_status_set_fine(main->setting.state.status) == F_array_too_large) { - fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_string_dynamics_increase_by), fake_common_file_path_stack_s); + fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_memory_array_increase_by), fake_common_file_path_stack_s); main->setting.state.status = F_status_set_error(F_failure); return; } - fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_memory_array_increase_by)); main->setting.state.status = F_status_set_error(F_failure); @@ -1985,7 +1985,7 @@ extern "C" { // Clear stack, except for the project root. for (f_number_unsigned_t i = 1; i < data_make->path.stack.used; ++i) { - f_string_dynamic_resize(0, &data_make->path.stack.array[i]); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &data_make->path.stack.array[i].string, &data_make->path.stack.array[i].used, &data_make->path.stack.array[i].size); } // for data_make->path.stack.used = 1; diff --git a/level_3/fake/c/main/make/operate_process_type.h b/level_3/fake/c/main/make/operate_process_type.h index 91973c9..f819fb8 100644 --- a/level_3/fake/c/main/make/operate_process_type.h +++ b/level_3/fake/c/main/make/operate_process_type.h @@ -626,11 +626,11 @@ extern "C" { * * F_failure (with error bit) on any error. * - * Errors (with error bit) from: f_string_dynamic_resize() + * Errors (with error bit) from: f_memory_array_resize() * Errors (with error bit) from: f_string_dynamics_resize() * Errors (with error bit) from: f_string_map_multis_resize() * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() * @see f_string_dynamics_resize() * @see f_string_map_multis_resize() */ @@ -655,11 +655,11 @@ extern "C" { * F_interrupt (with error bit) on interrupt signal received. * * Errors (with error bit) from: f_path_change() - * Errors (with error bit) from: f_string_dynamic_resize() + * Errors (with error bit) from: f_memory_array_resize() * Errors (with error bit) from: fake_make_path_relative() * * @see f_path_change() - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() * * @see fake_make_path_relative() */ @@ -679,14 +679,14 @@ extern "C" { * * F_failure (with error bit) on any error. * + * Errors (with error bit) from: f_memory_array_increase_by() * Errors (with error bit) from: f_string_dynamic_append() - * Errors (with error bit) from: f_string_dynamic_increase_by() * Errors (with error bit) from: fake_make_operate_process_buffer_escape() * @param arguments * The arguments for print operation. * + * @see f_memory_array_increase_by() * @see f_string_dynamic_append() - * @see f_string_dynamic_increase_by() * * @see fake_make_operate_process_buffer_escape() */ @@ -728,15 +728,15 @@ extern "C" { * * F_failure (with error bit) on any error. * + * Errors (with error bit) from: f_memory_array_increase_by() * Errors (with error bit) from: f_path_change() * Errors (with error bit) from: f_string_dynamic_append() - * Errors (with error bit) from: f_string_dynamics_increase_by() * Errors (with error bit) from: fake_make_assure_inside_project() * Errors (with error bit) from: fake_make_path_relative() * + * @see f_memory_array_increase_by() * @see f_path_change() * @see f_string_dynamic_append() - * @see f_string_dynamics_increase_by() * * @see fake_make_assure_inside_project() * @see fake_make_path_relative() @@ -759,10 +759,10 @@ extern "C" { * F_interrupt (with error bit) on interrupt signal received. * * Errors (with error bit) from: f_path_change_at() - * Errors (with error bit) from: f_string_dynamic_resize() + * Errors (with error bit) from: f_memory_array_resize() * * @see f_path_change_at() - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_fake_make_operate_process_type_top_ extern void fake_make_operate_process_type_top(fake_make_data_t * const data_make); diff --git a/level_3/fake/c/main/print/common.c b/level_3/fake/c/main/print/common.c index ae6ef1a..40fadec 100644 --- a/level_3/fake/c/main/print/common.c +++ b/level_3/fake/c/main/print/common.c @@ -39,9 +39,9 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%S'", print->to, before); - fl_print_format("%[%Q%]", print->to, print->notable, first, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, first, print->notable); fl_print_format("'%S'", print->to, between); - fl_print_format("%[%Q%]", print->to, print->notable, second, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, second, print->notable); fl_print_format("'%S.%r", print->to, after, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/fake/c/main/print/context.c b/level_3/fake/c/main/print/context.c index 6df1b98..bef9f56 100644 --- a/level_3/fake/c/main/print/context.c +++ b/level_3/fake/c/main/print/context.c @@ -49,7 +49,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%Q%S'%]", print->to, print->context, print->prefix, before, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, variable, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, variable, print->notable); fl_print_format("%['%S.%]%r", print->to, print->context, after, print->context, f_string_eol_s); f_file_stream_unlock(print->to); @@ -96,7 +96,7 @@ extern "C" { fl_print_format("%[%Q%S'%]", print->to, print->context, print->prefix, before, print->context); fl_print_format("%[%Q%Q%]", print->to, print->notable, symbol, name, print->notable); fl_print_format("%['%S'%]%r", print->to, print->context, between, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, value, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, value, print->notable); fl_print_format("%['%S.%]%r", print->to, print->context, after, print->context, f_string_eol_s); f_file_stream_unlock(print->to); @@ -130,7 +130,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%Q%S'%]", print->to, print->context, print->prefix, before, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, variable, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, variable, print->notable); fl_print_format("%['%S.%]%r", print->to, print->context, after, print->context, f_string_eol_s); f_file_stream_unlock(print->to); @@ -145,9 +145,9 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%Q%S'%]", print->to, print->context, print->prefix, before, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, first, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, first, print->notable); fl_print_format("%['%S'%]", print->to, print->context, between, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, second, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, second, print->notable); fl_print_format("%['%S.%]%r", print->to, print->context, after, print->context, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/fake/c/main/print/error.c b/level_3/fake/c/main/print/error.c index f40bd3b..64c69f0 100644 --- a/level_3/fake/c/main/print/error.c +++ b/level_3/fake/c/main/print/error.c @@ -43,7 +43,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QFailed to find '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, source, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, source, print->notable); fl_print_format("%[' ", print->to, print->context); fake_print_error_build_operation_file_partial(print, operation, source, destination, how); @@ -61,7 +61,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QInvalid parameter when calling '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, function, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, function, print->notable); fl_print_format("%[() ", print->to, print->context); fake_print_error_build_operation_file_partial(print, operation, source, destination, how); @@ -81,15 +81,15 @@ extern "C" { fl_print_format("%[%QInvalid name for '%]", print->to, print->context, print->prefix, print->context); if (source.used) { - fl_print_format("%[%Q%]", print->to, print->notable, source, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, source, print->notable); } if (destination.used) { fl_print_format("%[' or '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, destination, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, destination, print->notable); } - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); f_file_stream_unlock(print->to); } @@ -209,11 +209,11 @@ extern "C" { if (print->verbosity < f_console_verbosity_error_e || !source.used) return; fl_print_format("%[while trying to %Q '%]", print->to, print->context, operation, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, source, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, source, print->notable); if (destination.used) { fl_print_format("%[' %Q '%]", print->to, print->context, how, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, destination, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, destination, print->notable); } fl_print_format("%['", print->to, print->context); @@ -362,7 +362,7 @@ extern "C" { fl_print_format("%[%QOccurred on invalid UTF-8 character at %s (at '%]", print->to, print->context, print->prefix, main->setting.state.status == F_complete_not_utf_eos ? "end of string" : "stop point of string", print->context); fl_print_format("%[%un%]", print->to, print->notable, range.start, print->notable); fl_print_format("%[ of the setting file '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, path_file, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, path_file, print->notable); fl_print_format("%[').%]%r", print->to, print->context, print->context, f_string_eol_s); f_file_stream_unlock(print->to); @@ -404,7 +404,7 @@ extern "C" { fl_print_format("%[%S%Q%S(%]", print->to, print->context, prefix, print->prefix, before, print->context); fl_print_format("%[%un%]", print->to, print->notable, number, print->notable); fl_print_format("%[)%S'%]", print->to, print->context, middle, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, variable, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, variable, print->notable); fl_print_format("%[%S.%]%r", print->to, print->context, after, print->context, f_string_eol_s); f_file_stream_unlock(print->to); @@ -489,12 +489,12 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, argument, print->notable); fl_print_format("%[' is not not valid and may only be one of either '%]", print->to, print->context, print->context); fl_print_format("%[%r%]", print->to, print->notable, fake_make_operation_argument_force_s, print->notable); fl_print_format("%[' or '%]", print->to, print->context, print->context); fl_print_format("%[%r%]", print->to, print->notable, fake_make_operation_argument_strict_s, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); f_file_stream_unlock(print->to); @@ -557,7 +557,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QMaximum stack size reached while processing path '%]", print->to, print->context, print->prefix, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, path, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, path, print->notable); fl_print_format("%['", print->to, print->context); if (function) { @@ -676,7 +676,7 @@ extern "C" { fl_print_format("%[%QThe '%]", print->to, print->context, print->prefix, print->context); fl_print_format("%[%Q%Q%]", print->to, print->notable, symbol, name, print->notable); fl_print_format("%[' parameter value '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, value, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, value, print->notable); fl_print_format("%[' contains non-word, non-dash, and non-plus characters.%]%r", print->to, print->context, print->context, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/fake/c/main/print/message.c b/level_3/fake/c/main/print/message.c index c1461c1..b57e2cb 100644 --- a/level_3/fake/c/main/print/message.c +++ b/level_3/fake/c/main/print/message.c @@ -15,9 +15,9 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[Building%] ", print->to, print->set->important, print->set->important); - fl_print_format("%[%Q%]", print->to, print->set->notable, setting_build->build_name, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, setting_build->build_name, print->set->notable); fl_print_format("%[ using '%]", print->to, print->set->important, print->set->important); - fl_print_format("%[%Q%]", print->to, print->set->notable, build_arguments && build_arguments->used ? build_arguments->array[0] : main->setting.settings, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, build_arguments && build_arguments->used ? build_arguments->array[0] : main->setting.settings, print->set->notable); fl_print_format("%[' with modes '%]", print->to, print->set->important, print->set->important); @@ -30,14 +30,14 @@ extern "C" { for (f_number_unsigned_t i = build_arguments && build_arguments->used > 1 ? 1 : 0; i < modes->used; ) { - fl_print_format("%[%Q%]", print->to, print->set->notable, modes->array[i], print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, modes->array[i], print->set->notable); if (++i < modes->used) { fl_print_format("%[', '%]", print->to, print->set->important, print->set->important); } } // for - fl_print_format("%['.%]%r", print->to, print->set->important, print->set->important, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->important, print->set->important, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index cc42f2e..e693cd2 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -170,7 +170,7 @@ extern "C" { f_file_stream_lock(main->warning.to); fl_print_format("%r%[%Q'%]", main->warning.to, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context); - fl_print_format("%[%Q%]", main->warning.to, main->warning.notable, data.argv[index], main->warning.notable); + fl_print_format(f_string_format_Q_single_s.string, main->warning.to, main->warning.notable, data.argv[index], main->warning.notable); fl_print_format("%[' is not a valid show option.%]%r", main->warning.to, main->warning.context, main->warning.context, f_string_eol_s); f_file_stream_unlock(main->warning.to); @@ -522,7 +522,7 @@ extern "C" { path_file.used = 0; local.device = i; - status = f_string_dynamic_increase_by(firewall_network_path_s.used + data.devices.array[i].used + firewall_file_suffix_s.used + 1, &path_file); + status = f_memory_array_increase_by(firewall_network_path_s.used + data.devices.array[i].used + firewall_file_suffix_s.used + 1, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); if (F_status_is_error_not(status)) { status = f_string_dynamic_append(firewall_network_path_s, &path_file); @@ -551,7 +551,7 @@ extern "C" { firewall_delete_local_data(&local); firewall_data_delete(&data); - f_string_dynamic_resize(0, &path_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); return status; } @@ -567,7 +567,7 @@ extern "C" { continue; } - f_string_dynamic_resize(0, &path_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); firewall_data_delete(&data); return F_status_set_error(status); @@ -597,7 +597,7 @@ extern "C" { status = firewall_process_rules(&data, &input, &local); if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) { - f_string_dynamic_resize(0, &path_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); firewall_delete_local_data(&local); firewall_data_delete(&data); @@ -622,7 +622,7 @@ extern "C" { } if (F_status_is_error(status) || status == F_child) { - f_string_dynamic_resize(0, &path_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); firewall_delete_local_data(&local); firewall_data_delete(&data); @@ -633,7 +633,7 @@ extern "C" { status = firewall_create_custom_chains(&data, &reserved, &local); if (F_status_is_error(status) || status == F_child) { - f_string_dynamic_resize(0, &path_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); firewall_delete_local_data(&local); firewall_data_delete(&data); @@ -658,7 +658,7 @@ extern "C" { status = firewall_process_rules(&data, &input, &local); if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) { - f_string_dynamic_resize(0, &path_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); firewall_delete_local_data(&local); firewall_data_delete(&data); @@ -669,7 +669,7 @@ extern "C" { ++i; } // while - f_string_dynamic_resize(0, &path_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); } } diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 62d336e..738d4fb 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -63,10 +63,11 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca if (!((++data->main->signal_check) % firewall_signal_check_d)) { if (firewall_signal_received(data)) { - f_string_dynamic_resize(0, &ip_list); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &ip_list.string, &ip_list.used, &ip_list.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &device.string, &device.used, &device.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &protocol.string, &protocol.used, &protocol.size); + f_string_dynamics_resize(0, &arguments); - f_string_dynamic_resize(0, &device); - f_string_dynamic_resize(0, &protocol); return F_status_set_error(F_interrupt); } @@ -155,23 +156,21 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca invalid = F_true; } else if (f_compare_dynamic_string(local->buffer.string + local->rule_contents.array[i].array[0].start, firewall_device_all_s, length) == F_equal_to) { - f_string_dynamic_resize(0, &device); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &device.string, &device.used, &device.size); continue; } else if (f_compare_dynamic_string(local->buffer.string + local->rule_contents.array[i].array[0].start, firewall_device_this_s, length) == F_equal_to) { if (data->devices.array[local->device].used) { - if (data->devices.array[local->device].used > device.size) { - status = f_string_dynamic_resize(data->devices.array[local->device].used, &device); - if (F_status_is_error(status)) break; - } + status = f_memory_array_increase_by(data->devices.array[local->device].used, sizeof(f_char_t), (void **) &device.string, &device.used, &device.size); + if (F_status_is_error(status)) break; memcpy(device.string, data->devices.array[local->device].string, sizeof(f_char_t) * data->devices.array[local->device].used); device.used = data->devices.array[local->device].used; } else { - f_string_dynamic_resize(0, &device); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &device.string, &device.used, &device.size); } continue; @@ -317,7 +316,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca fl_print_format("%[%/Q%]", data->main->warning.to, data->main->warning.notable, local->buffer, local->rule_objects.array[i], data->main->warning.notable); fl_print_format("%[' has invalid content '%]", data->main->warning.to, data->main->warning.context, data->main->warning.context); fl_print_format("%[%/Q%]", data->main->warning.to, data->main->warning.notable, local->buffer, local->rule_contents.array[i].array[0], data->main->warning.notable); - fl_print_format("%['.%]%r", data->main->warning.to, data->main->warning.context, data->main->warning.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, data->main->warning.to, data->main->warning.context, data->main->warning.context, f_string_eol_s); f_file_stream_unlock(data->main->warning.to); } @@ -333,7 +332,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca arguments.used = 0; // First add the program name. - status = f_string_dynamics_increase(F_memory_default_allocation_small_d, &arguments); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error(status)) break; if (tool == firewall_program_ip46tables_e) { @@ -347,7 +346,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca // Process the action when a non-none chain is specified. if (chain != firewall_chain_none_id_e && action != firewall_action_none_id_e) { - status = f_string_dynamics_increase(firewall_default_allocation_step_d, &arguments); + status = f_memory_array_increase(firewall_default_allocation_step_d, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error(status)) break; arguments.array[arguments.used].used = 0; @@ -367,7 +366,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca if (action == firewall_action_append_id_e || action == firewall_action_insert_id_e || action == firewall_action_policy_id_e) { ++arguments.used; - status = f_string_dynamics_increase(firewall_default_allocation_step_d, &arguments); + status = f_memory_array_increase(firewall_default_allocation_step_d, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error(status)) break; arguments.array[arguments.used].used = 0; @@ -408,7 +407,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca if (device.used && (direction == firewall_direction_input_id_e || direction == firewall_direction_output_id_e)) { if (f_compare_dynamic_string(local->buffer.string + local->rule_contents.array[i].array[0].start, firewall_device_all_s, length) == F_equal_to_not) { - status = f_string_dynamics_increase(firewall_default_allocation_step_d, &arguments); + status = f_memory_array_increase(firewall_default_allocation_step_d, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error(status)) break; arguments.array[arguments.used].used = 0; @@ -431,7 +430,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca // Add the device. if (device.used) { - status = f_string_dynamics_increase(firewall_default_allocation_step_d, &arguments); + status = f_memory_array_increase(firewall_default_allocation_step_d, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error(status)) break; arguments.array[arguments.used].used = 0; @@ -445,7 +444,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca } if (use_protocol) { - status = f_string_dynamics_increase(firewall_default_allocation_step_d, &arguments); + status = f_memory_array_increase(firewall_default_allocation_step_d, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error(status)) break; arguments.array[arguments.used].used = 0; @@ -457,7 +456,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca ++arguments.used; if (protocol.used) { - status = f_string_dynamics_increase(firewall_default_allocation_step_d, &arguments); + status = f_memory_array_increase(firewall_default_allocation_step_d, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error(status)) break; arguments.array[arguments.used].used = 0; @@ -497,7 +496,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca } } - status = f_string_dynamics_increase_by(local->rule_contents.array[i].used, &arguments); + status = f_memory_array_increase_by(local->rule_contents.array[i].used, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error(status)) break; for (; subcounter < local->rule_contents.array[i].used; ++subcounter) { @@ -648,7 +647,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca } if (F_status_is_error_not(status)) { - status = f_string_dynamics_increase_by(2, &arguments); + status = f_memory_array_increase_by(2, sizeof(f_string_dynamic_t), (void **) &arguments.array, &arguments.used, &arguments.size); if (F_status_is_error_not(status)) { arguments.array[arguments.used].used = 0; @@ -685,11 +684,11 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca if (status == F_child) { f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &delimits.array, &delimits.used, &delimits.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &ip_list.string, &ip_list.used, &ip_list.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &device.string, &device.used, &device.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &protocol.string, &protocol.used, &protocol.size); - f_string_dynamic_resize(0, &ip_list); f_string_dynamics_resize(0, &arguments); - f_string_dynamic_resize(0, &device); - f_string_dynamic_resize(0, &protocol); data->main->child = return_code; @@ -722,8 +721,8 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca } } - f_string_dynamic_resize(0, &local_buffer); - f_string_dynamic_resize(0, &path_file); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &local_buffer.string, &local_buffer.used, &local_buffer.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size); f_string_ranges_resize(0, &basic_objects); f_string_rangess_resize(0, &basic_contents); @@ -736,10 +735,11 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca status = fll_execute_program(current_tool, arguments, 0, 0, (void *) &return_code); if (status == F_child) { - f_string_dynamic_resize(0, &ip_list); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &ip_list.string, &ip_list.used, &ip_list.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &device.string, &device.used, &device.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &protocol.string, &protocol.used, &protocol.size); + f_string_dynamics_resize(0, &arguments); - f_string_dynamic_resize(0, &device); - f_string_dynamic_resize(0, &protocol); data->main->child = return_code; @@ -770,10 +770,11 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca } } - f_string_dynamic_resize(0, &ip_list); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &ip_list.string, &ip_list.used, &ip_list.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &device.string, &device.used, &device.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &protocol.string, &protocol.used, &protocol.size); + f_string_dynamics_resize(0, &arguments); - f_string_dynamic_resize(0, &device); - f_string_dynamic_resize(0, &protocol); return status; } @@ -808,7 +809,7 @@ f_status_t firewall_create_custom_chains(firewall_data_t * const data, firewall_ status = f_string_dynamic_append(firewall_chain_create_command_s, &arguments.array[0]); if (F_status_is_error_not(status)) { - status = f_string_dynamic_increase(F_memory_default_allocation_small_d, &arguments.array[1]); + status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_char_t), (void **) &arguments.array[1].string, &arguments.array[1].used, &arguments.array[1].size); } else { f_string_dynamics_resize(0, &arguments); @@ -870,7 +871,7 @@ f_status_t firewall_create_custom_chains(firewall_data_t * const data, firewall_ } if (new_chain) { - status = f_string_dynamics_increase(firewall_default_allocation_step_d, &data->chains); + status = f_memory_array_increase(firewall_default_allocation_step_d, sizeof(f_string_dynamic_t), (void **) &data->chains.array, &data->chains.used, &data->chains.size); if (F_status_is_error(status)) break; create_chain = F_true; @@ -878,10 +879,10 @@ f_status_t firewall_create_custom_chains(firewall_data_t * const data, firewall_ arguments.array[1].used = 0; - status = f_string_dynamic_increase_by(length + 1, &arguments.array[1]); + status = f_memory_array_increase_by(length + 1, sizeof(f_char_t), (void **) &arguments.array[1].string, &arguments.array[1].used, &arguments.array[1].size); if (F_status_is_error(status)) break; - status = f_string_dynamic_increase_by(length + 1, &data->chains.array[data->chains.used]); + status = f_memory_array_increase_by(length + 1, sizeof(f_char_t), (void **) &data->chains.array[data->chains.used].string, &data->chains.array[data->chains.used].used, &data->chains.array[data->chains.used].size); if (F_status_is_error(status)) break; data->chains.array[data->chains.used].used = 0; @@ -1297,7 +1298,7 @@ f_status_t firewall_delete_local_data(firewall_local_data_t * const local) { local->device = 0; local->chain = 0; - f_string_dynamic_resize(0, &local->buffer); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &local->buffer.string, &local->buffer.used, &local->buffer.size); f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &local->chain_ids.array, &local->chain_ids.used, &local->chain_ids.size); f_string_ranges_resize(0, &local->chain_objects); diff --git a/level_3/firewall/c/private-firewall.h b/level_3/firewall/c/private-firewall.h index 14ed355..a787f51 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -27,15 +27,15 @@ extern "C" { * F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal. * F_parameter (with error bit) on invalid parameter passed. * + * Errors (with error bit) from: f_memory_array_increase(). + * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_partial_append(). - * Errors (with error bit) from: f_string_dynamics_increase(). - * Errors (with error bit) from: f_string_dynamics_increase_by(). * + * @see f_memory_array_increase() + * @see f_memory_array_increase_by() * @see f_string_dynamic_append() * @see f_string_dynamic_partial_append() - * @see f_string_dynamics_increase() - * @see f_string_dynamics_increase_by() */ extern f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_local_data_t * const local) F_attribute_visibility_internal_d; diff --git a/level_3/fss_identify/c/main/common.c b/level_3/fss_identify/c/main/common.c index 0408a85..714e443 100644 --- a/level_3/fss_identify/c/main/common.c +++ b/level_3/fss_identify/c/main/common.c @@ -145,14 +145,14 @@ extern "C" { if (main->program.parameters.array[fss_identify_parameter_name_e].result & f_console_result_value_e) { main->setting.names.used = 0; - main->setting.state.status = f_string_dynamics_increase_by(main->program.parameters.array[fss_identify_parameter_name_e].values.used, &main->setting.names); + main->setting.state.status = f_memory_array_increase_by(main->program.parameters.array[fss_identify_parameter_name_e].values.used, sizeof(f_string_dynamic_t), (void **) &main->setting.names.array, &main->setting.names.used, &main->setting.names.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & fss_identify_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - fss_identify_print_error(&main->program.error, macro_fss_identify_f(f_string_dynamics_increase_by)); + fss_identify_print_error(&main->program.error, macro_fss_identify_f(f_memory_array_increase_by)); return; } @@ -259,14 +259,14 @@ extern "C" { if (main->program.parameters.remaining.used) { main->setting.files.used = 0; - main->setting.state.status = f_string_dynamics_increase_by(main->program.parameters.remaining.used, &main->setting.files); + main->setting.state.status = f_memory_array_increase_by(main->program.parameters.remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.files.array, &main->setting.files.used, &main->setting.files.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & fss_identify_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - fss_identify_print_error(&main->program.error, macro_fss_identify_f(f_string_dynamics_increase_by)); + fss_identify_print_error(&main->program.error, macro_fss_identify_f(f_memory_array_increase_by)); return; } diff --git a/level_3/fss_identify/c/main/common/print.c b/level_3/fss_identify/c/main/common/print.c index 8ac08cd..e48446d 100644 --- a/level_3/fss_identify/c/main/common/print.c +++ b/level_3/fss_identify/c/main/common/print.c @@ -10,9 +10,8 @@ extern "C" { "f_console_parameter_process", "f_file_stream_open", "f_file_stream_read_block", + "f_memory_array_increase_by", "f_string_dynamic_append_nulless", - "f_string_dynamic_increase_by", - "f_string_dynamics_increase_by", "f_thread_create", "f_utf_is_word_dash", "fll_fss_identify", diff --git a/level_3/fss_identify/c/main/common/print.h b/level_3/fss_identify/c/main/common/print.h index 2bd3f34..864dd6c 100644 --- a/level_3/fss_identify/c/main/common/print.h +++ b/level_3/fss_identify/c/main/common/print.h @@ -43,9 +43,8 @@ extern "C" { fss_identify_f_f_console_parameter_process_e, fss_identify_f_f_file_stream_open_e, fss_identify_f_f_file_stream_read_block_e, + fss_identify_f_f_memory_array_increase_by_e, fss_identify_f_f_string_dynamic_append_nulless_e, - fss_identify_f_f_string_dynamic_increase_by_e, - fss_identify_f_f_string_dynamics_increase_by_e, fss_identify_f_f_thread_create_e, fss_identify_f_f_utf_is_word_dash_e, fss_identify_f_fll_fss_identify_e, diff --git a/level_3/fss_identify/c/main/common/type.c b/level_3/fss_identify/c/main/common/type.c index bb5e4fe..9ccb267 100644 --- a/level_3/fss_identify/c/main/common/type.c +++ b/level_3/fss_identify/c/main/common/type.c @@ -19,12 +19,11 @@ extern "C" { if (!setting) return F_status_set_error(F_parameter); - f_string_dynamic_resize(0, &setting->buffer); - + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->buffer.string, &setting->buffer.used, &setting->buffer.size); f_memory_array_resize(0, sizeof(f_fll_id_t), (void **) &setting->ids.array, &setting->ids.used, &setting->ids.size); - f_string_dynamics_resize(0, &setting->names); - f_string_dynamics_resize(0, &setting->files); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->names.array, &setting->names.used, &setting->names.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->files.array, &setting->files.used, &setting->files.size, &f_string_dynamics_delete_callback); return F_okay; } diff --git a/level_3/fss_identify/c/main/load.c b/level_3/fss_identify/c/main/load.c index 34bace4..9e191b3 100644 --- a/level_3/fss_identify/c/main/load.c +++ b/level_3/fss_identify/c/main/load.c @@ -21,10 +21,10 @@ extern "C" { do { if (fss_identify_signal_check(main)) return; - main->setting.state.status = f_string_dynamic_increase_by(main->setting.file.size_read, &main->setting.buffer); + main->setting.state.status = f_memory_array_increase_by(main->setting.file.size_read, sizeof(f_char_t), (void **) &main->setting.buffer.string, &main->setting.buffer.used, &main->setting.buffer.size); if (F_status_is_error(main->setting.state.status)) { - fss_identify_print_error_file(&main->program.error, macro_fss_identify_f(f_string_dynamic_increase_by), name.used ? name : f_string_ascii_minus_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e); + fss_identify_print_error_file(&main->program.error, macro_fss_identify_f(f_memory_array_increase_by), name.used ? name : f_string_ascii_minus_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e); return; } diff --git a/level_3/fss_identify/c/main/load.h b/level_3/fss_identify/c/main/load.h index 638e436..965bcfd 100644 --- a/level_3/fss_identify/c/main/load.h +++ b/level_3/fss_identify/c/main/load.h @@ -22,7 +22,7 @@ * F_okay on success. * * Errors (with error bit) from: f_file_stream_read_block(). - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * * @param main * The main program data. @@ -31,7 +31,7 @@ * file_name.used to 0 to designate that this is a pipe. * * @see f_file_stream_read_block() - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() */ #ifndef _di_fss_identify_load_line_ extern void fss_identify_load_line(fss_identify_main_t * const main, const f_string_static_t name); diff --git a/level_3/fss_identify/c/main/print/error.c b/level_3/fss_identify/c/main/print/error.c index 7ee2bda..36b5ed0 100644 --- a/level_3/fss_identify/c/main/print/error.c +++ b/level_3/fss_identify/c/main/print/error.c @@ -54,7 +54,7 @@ extern "C" { fl_print_format("%[%ul%] ", print->to, print->set->notable, index, print->set->notable); fl_print_format("%[for the parameter '%]", print->to, print->set->error, print->set->error); fl_print_format("%[%r%r%]", print->to, print->set->notable, f_console_symbol_long_normal_s, fss_identify_long_name_s, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -71,7 +71,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, name, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, name, print->set->notable); fl_print_format("%[' at index%] ", print->to, print->set->error, print->set->error); fl_print_format("%[%ul%] ", print->to, print->set->notable, index, print->set->notable); fl_print_format("%[for the parameter '%]", print->to, print->set->error, print->set->error); diff --git a/level_3/fss_read/c/main/common.c b/level_3/fss_read/c/main/common.c index 68ebe99..403e51d 100644 --- a/level_3/fss_read/c/main/common.c +++ b/level_3/fss_read/c/main/common.c @@ -586,14 +586,14 @@ extern "C" { } // Pre-allocate entire file buffer plus space for the terminating NULL. - f_string_dynamic_increase_by(size_file + 1, &main->setting.buffer); + main->setting.state.status = f_memory_array_increase_by(size_file + 1, sizeof(f_char_t), (void **) &main->setting.buffer.string, &main->setting.buffer.used, &main->setting.buffer.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_string_dynamic_increase_by), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_process_s, fll_error_file_type_file_e); + fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_memory_array_increase_by), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_process_s, fll_error_file_type_file_e); break; } diff --git a/level_3/fss_read/c/main/common/print.c b/level_3/fss_read/c/main/common/print.c index 7df4a2e..9a93719 100644 --- a/level_3/fss_read/c/main/common/print.c +++ b/level_3/fss_read/c/main/common/print.c @@ -14,16 +14,11 @@ extern "C" { "f_file_stream_read_block", "f_file_stream_read_until", "f_fss_is_space", + "f_memory_array_increase_by", "f_rip_dynamic", "f_string_dynamic_append", "f_string_dynamic_append_assure", "f_string_dynamic_append_nulless", - "f_string_dynamic_increase_by", - "f_string_dynamics_increase", - "f_string_dynamics_increase_by", - "f_string_dynamics_resize", - "f_string_dynamicss_increase", - "f_string_dynamicss_increase_by", "f_string_ranges_increase", "f_string_ranges_increase_by", "f_string_rangess_increase", diff --git a/level_3/fss_read/c/main/common/print.h b/level_3/fss_read/c/main/common/print.h index 12b358e..8ab62ca 100644 --- a/level_3/fss_read/c/main/common/print.h +++ b/level_3/fss_read/c/main/common/print.h @@ -47,16 +47,11 @@ extern "C" { fss_read_f_f_file_stream_read_block_e, fss_read_f_f_file_stream_read_until_e, fss_read_f_f_fss_is_space_e, + fss_read_f_f_memory_array_increase_by_e, fss_read_f_f_rip_dynamic_e, fss_read_f_f_string_dynamic_append_e, fss_read_f_f_string_dynamic_append_assure_e, fss_read_f_f_string_dynamic_append_nulless_e, - fss_read_f_f_string_dynamic_increase_by_e, - fss_read_f_f_string_dynamics_increase_e, - fss_read_f_f_string_dynamics_increase_by_e, - fss_read_f_f_string_dynamics_resize_e, - fss_read_f_f_string_dynamicss_increase_e, - fss_read_f_f_string_dynamicss_increase_by_e, fss_read_f_f_string_ranges_increase_e, fss_read_f_f_string_ranges_increase_by_e, fss_read_f_f_string_rangess_increase_e, diff --git a/level_3/fss_read/c/main/common/type.c b/level_3/fss_read/c/main/common/type.c index afc436f..ce3508b 100644 --- a/level_3/fss_read/c/main/common/type.c +++ b/level_3/fss_read/c/main/common/type.c @@ -9,7 +9,7 @@ extern "C" { if (!depth) return; - f_string_dynamic_resize(0, &depth->value_name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &depth->value_name.string, &depth->value_name.used, &depth->value_name.size); } #endif // _di_fss_read_depth_delete_ @@ -75,7 +75,7 @@ extern "C" { fss_read_files_resize(0, &setting->files); fss_read_depths_resize(0, &setting->depths); - f_string_dynamic_resize(0, &setting->buffer); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->buffer.string, &setting->buffer.used, &setting->buffer.size); f_string_ranges_resize(0, &setting->objects); f_string_ranges_resize(0, &setting->comments); diff --git a/level_3/fss_read/c/main/main/print.c b/level_3/fss_read/c/main/main/print.c index 46cd714..2ac1648 100644 --- a/level_3/fss_read/c/main/main/print.c +++ b/level_3/fss_read/c/main/main/print.c @@ -20,10 +20,10 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe format '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value, print->set->notable); fl_print_format("%[' is not known for the parameter%] ", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, f_console_symbol_long_normal_s, fss_read_long_as_s, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/fss_read/c/main/print/error.c b/level_3/fss_read/c/main/print/error.c index bfbbc50..e623d16 100644 --- a/level_3/fss_read/c/main/print/error.c +++ b/level_3/fss_read/c/main/print/error.c @@ -60,7 +60,7 @@ extern "C" { fl_print_format("%[%ul%]", print->to, print->notable, value, print->notable); fl_print_format("%[' before the value '%]", print->to, print->context, print->context); fl_print_format("%[%ul%]", print->to, print->notable, before, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); f_file_stream_unlock(print->to); @@ -80,7 +80,7 @@ extern "C" { fl_print_format("%[%ul%]", print->to, print->notable, value, print->notable); fl_print_format("%[' may only be specified once for the parameter '%]", print->to, print->context, print->context); fl_print_format("%[%r%r%]", print->to, print->notable, symbol, name, print->notable); - fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/fss_write/c/main/common.c b/level_3/fss_write/c/main/common.c index 2add847..6904cea 100644 --- a/level_3/fss_write/c/main/common.c +++ b/level_3/fss_write/c/main/common.c @@ -150,14 +150,14 @@ extern "C" { main->setting.objects.used = 0; - main->setting.state.status = f_string_dynamics_resize(values->used, &main->setting.objects); + main->setting.state.status = f_memory_arrays_resize(values->used, sizeof(f_string_dynamic_t), (void **) &main->setting.objects.array, &main->setting.objects.used, &main->setting.objects.size, &f_string_dynamics_delete_callback); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & fss_write_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamics_resize)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_arrays_resize)); return; } @@ -214,14 +214,14 @@ extern "C" { main->setting.contentss.used = 0; - main->setting.state.status = f_string_dynamicss_increase_by(values_object->used, &main->setting.contentss); + main->setting.state.status = f_memory_arrays_resize(values_object->used, sizeof(f_string_dynamic_t), (void **) &main->setting.contentss.array, &main->setting.contentss.used, &main->setting.contentss.size, &f_string_dynamics_delete_callback); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & fss_write_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamicss_increase_by)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_arrays_resize)); return; } @@ -249,14 +249,14 @@ extern "C" { break; } - main->setting.state.status = f_string_dynamics_increase_by(total, &main->setting.contentss.array[j]); + main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_string_dynamic_t), (void **) &main->setting.contentss.array[j].array, &main->setting.contentss.array[j].used, &main->setting.contentss.array[j].size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & fss_write_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamics_increase_by)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by)); return; } diff --git a/level_3/fss_write/c/main/common/print.c b/level_3/fss_write/c/main/common/print.c index 8d95d98..7da0143 100644 --- a/level_3/fss_write/c/main/common/print.c +++ b/level_3/fss_write/c/main/common/print.c @@ -10,14 +10,11 @@ extern "C" { "f_file_read_block", "f_file_stream_open", "f_fss_is_space", + "f_memory_array_increase", + "f_memory_array_increase_by", + "f_memory_arrays_resize", "f_string_dynamic_append", "f_string_dynamic_append_nulless", - "f_string_dynamic_increase_by", - "f_string_dynamics_increase", - "f_string_dynamics_increase_by", - "f_string_dynamics_resize", - "f_string_dynamicss_increase", - "f_string_dynamicss_increase_by", "f_string_ranges_increase", "f_string_ranges_increase_by", "f_string_rangess_increase", diff --git a/level_3/fss_write/c/main/common/print.h b/level_3/fss_write/c/main/common/print.h index 2a709f2..840511c 100644 --- a/level_3/fss_write/c/main/common/print.h +++ b/level_3/fss_write/c/main/common/print.h @@ -43,14 +43,11 @@ extern "C" { fss_write_f_f_file_read_block_e, fss_write_f_f_file_stream_open_e, fss_write_f_f_fss_is_space_e, + fss_write_f_f_memory_array_increase_e, + fss_write_f_f_memory_array_increase_by_e, + fss_write_f_f_memory_arrays_resize_e, fss_write_f_f_string_dynamic_append_e, fss_write_f_f_string_dynamic_append_nulless_e, - fss_write_f_f_string_dynamic_increase_by_e, - fss_write_f_f_string_dynamics_increase_e, - fss_write_f_f_string_dynamics_increase_by_e, - fss_write_f_f_string_dynamics_resize_e, - fss_write_f_f_string_dynamicss_increase_e, - fss_write_f_f_string_dynamicss_increase_by_e, fss_write_f_f_string_ranges_increase_e, fss_write_f_f_string_ranges_increase_by_e, fss_write_f_f_string_rangess_increase_e, diff --git a/level_3/fss_write/c/main/common/type.c b/level_3/fss_write/c/main/common/type.c index a788a01..f1d5f03 100644 --- a/level_3/fss_write/c/main/common/type.c +++ b/level_3/fss_write/c/main/common/type.c @@ -19,13 +19,13 @@ extern "C" { if (!setting) return F_status_set_error(F_parameter); - f_string_dynamic_resize(0, &setting->block); - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamic_resize(0, &setting->prepend); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->block.string, &setting->block.used, &setting->block.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->buffer.string, &setting->buffer.used, &setting->buffer.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->prepend.string, &setting->prepend.used, &setting->prepend.size); - f_string_rangess_resize(0, &setting->ignoress); - f_string_dynamics_resize(0, &setting->objects); - f_string_dynamicss_resize(0, &setting->contentss); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->ignoress.array, &setting->ignoress.used, &setting->ignoress.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->objects.array, &setting->objects.used, &setting->objects.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->contentss.array, &setting->contentss.used, &setting->contentss.size, &f_string_dynamics_delete_callback); return F_okay; } diff --git a/level_3/fss_write/c/main/common/type.h b/level_3/fss_write/c/main/common/type.h index da614cd..214a93b 100644 --- a/level_3/fss_write/c/main/common/type.h +++ b/level_3/fss_write/c/main/common/type.h @@ -74,6 +74,7 @@ extern "C" { * objects: An array of objects passed as values to the "--object" parameter or via the input pipe. * contentss: An array of content sets passed as values to the "--content" parameter or via the input pipe. * + * ignores: A pointer to a specific Ignores used during processing. * object: A pointer to a specific Object used during processing. * content: A pointer to a specific Content used during processing. * contents: A pointer to a specific set of Content used during processing. diff --git a/level_3/fss_write/c/main/fss_write.c b/level_3/fss_write/c/main/fss_write.c index fd6e648..6916677 100644 --- a/level_3/fss_write/c/main/fss_write.c +++ b/level_3/fss_write/c/main/fss_write.c @@ -164,27 +164,27 @@ extern "C" { uint8_t state = 0; // This is processed in a single set, so there is only ever one Object added. - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->setting.objects); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->setting.objects.array, &main->setting.objects.used, &main->setting.objects.size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamics_increase)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase)); return; } // This is processed in a single set, so there is only ever one Content added. - main->setting.state.status = f_string_dynamicss_increase(main->setting.state.step_small, &main->setting.contentss); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamics_t), (void **) &main->setting.contentss.array, &main->setting.contentss.used, &main->setting.contentss.size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamicss_increase)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase)); return; } - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, main->setting.contents); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->setting.contents->array, &main->setting.contents->used, &main->setting.contents->size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamics_increase)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase)); return; } @@ -260,10 +260,10 @@ extern "C" { flag -= flag | 0x4; main->setting.contents->used = 0; - main->setting.state.status = f_string_dynamic_increase_by(main->setting.block.used, main->setting.object); + main->setting.state.status = f_memory_array_increase_by(main->setting.block.used, sizeof(f_char_t), (void **) &main->setting.object->string, &main->setting.object->used, &main->setting.object->size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_increase_by)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by)); break; } @@ -326,10 +326,10 @@ extern "C" { break; } - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, main->setting.contents); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->setting.contents->array, &main->setting.contents->used, &main->setting.contents->size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamics_increase)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase)); break; } @@ -343,10 +343,10 @@ extern "C" { } if (total) { - main->setting.state.status = f_string_dynamic_increase_by(total, &main->setting.contents->array[main->setting.contents->used]); + main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_char_t), (void **) &main->setting.contents->array[main->setting.contents->used].string, &main->setting.contents->array[main->setting.contents->used].used, &main->setting.contents->array[main->setting.contents->used].size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_increase_by)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by)); break; } diff --git a/level_3/fss_write/c/main/main/print.c b/level_3/fss_write/c/main/main/print.c index 917a76a..9b7dfee 100644 --- a/level_3/fss_write/c/main/main/print.c +++ b/level_3/fss_write/c/main/main/print.c @@ -20,10 +20,10 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe format '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, value, print->set->notable); fl_print_format("%[' is not known for the parameter%] ", print->to, print->set->error, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, f_console_symbol_long_normal_s, fss_write_long_as_s, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/fss_write/c/payload/fss_write.c b/level_3/fss_write/c/payload/fss_write.c index 3e4e009..d3999de 100644 --- a/level_3/fss_write/c/payload/fss_write.c +++ b/level_3/fss_write/c/payload/fss_write.c @@ -45,27 +45,27 @@ extern "C" { uint8_t state = 0; // This is processed in a single set, so there is only ever one Object added. - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->setting.objects); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->setting.objects.array, &main->setting.objects.used, &main->setting.objects.size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamics_increase)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase)); return; } // This is processed in a single set, so there is only ever one Content added. - main->setting.state.status = f_string_dynamicss_increase(main->setting.state.step_small, &main->setting.contentss); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamics_t), (void **) &main->setting.contentss.array, &main->setting.contentss.used, &main->setting.contentss.size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamicss_increase)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase)); return; } - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, main->setting.contents); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->setting.objects.array, &main->setting.objects.used, &main->setting.objects.size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamics_increase)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase)); return; } @@ -132,10 +132,10 @@ extern "C" { flag -= flag | 0x4; main->setting.contents->used = 0; - main->setting.state.status = f_string_dynamic_increase_by(main->setting.block.used, main->setting.object); + main->setting.state.status = f_memory_array_increase_by(main->setting.block.used, sizeof(f_char_t), (void **) &main->setting.object->string, &main->setting.object->used, &main->setting.object->size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_increase_by)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by)); break; } @@ -198,10 +198,10 @@ extern "C" { break; } - main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, main->setting.contents); + main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->setting.objects.array, &main->setting.objects.used, &main->setting.objects.size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamics_increase)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase)); break; } @@ -217,10 +217,10 @@ extern "C" { // When payload is provided, all data at this point is part of the payload until the end of the pipe. if (f_compare_dynamic(f_fss_payload_s, *main->setting.object) == F_equal_to) { if (total > 1) { - main->setting.state.status = f_string_dynamic_increase_by(total, &main->setting.contents->array[main->setting.contents->used]); + main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_char_t), (void **) &main->setting.contents->array[main->setting.contents->used].string, &main->setting.contents->array[main->setting.contents->used].used, &main->setting.contents->array[main->setting.contents->used].size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_increase_by)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by)); break; } @@ -241,10 +241,10 @@ extern "C" { } if (total) { - main->setting.state.status = f_string_dynamic_increase_by(total, &main->setting.contents->array[main->setting.contents->used]); + main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_char_t), (void **) &main->setting.contents->array[main->setting.contents->used].string, &main->setting.contents->array[main->setting.contents->used].used, &main->setting.contents->array[main->setting.contents->used].size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_increase_by)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by)); break; } @@ -317,10 +317,10 @@ extern "C" { if (main->setting.block.used && range.start <= range.stop) { length = (range.stop - range.start) + 1; - main->setting.state.status = f_string_dynamic_increase_by(length + 1, &main->setting.contents->array[main->setting.contents->used]); + main->setting.state.status = f_memory_array_increase_by(length + 1, sizeof(f_char_t), (void **) &main->setting.contents->array[main->setting.contents->used].string, &main->setting.contents->array[main->setting.contents->used].used, &main->setting.contents->array[main->setting.contents->used].size); if (F_status_is_error(main->setting.state.status)) { - fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_increase_by)); + fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by)); break; } diff --git a/level_3/iki_read/c/main/common.c b/level_3/iki_read/c/main/common.c index 866e6ba..6db57f3 100644 --- a/level_3/iki_read/c/main/common.c +++ b/level_3/iki_read/c/main/common.c @@ -192,14 +192,14 @@ extern "C" { if (main->program.parameters.array[iki_read_parameter_name_e].result & f_console_result_value_e) { main->setting.names.used = 0; - main->setting.state.status = f_string_dynamics_increase_by(main->program.parameters.array[iki_read_parameter_name_e].values.used, &main->setting.names); + main->setting.state.status = f_memory_array_increase_by(main->program.parameters.array[iki_read_parameter_name_e].values.used, sizeof(f_string_dynamic_t), (void **) &main->setting.names.array, &main->setting.names.used, &main->setting.names.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_dynamics_increase_by)); + iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_array_increase_by)); return; } @@ -301,11 +301,11 @@ extern "C" { // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it. if (main->setting.replace.array[at].name.size) { - main->setting.state.status = f_string_dynamic_resize(0, &main->setting.replace.array[at].name); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->setting.replace.array[at].name.string, &main->setting.replace.array[at].name.used, &main->setting.replace.array[at].name.size); } if (F_status_is_error_not(main->setting.state.status) && main->setting.replace.array[at].value.size) { - main->setting.state.status = f_string_dynamic_resize(0, &main->setting.replace.array[at].value); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->setting.replace.array[at].value.string, &main->setting.replace.array[at].value.used, &main->setting.replace.array[at].value.size); } if (F_status_is_error(main->setting.state.status)) { @@ -313,7 +313,7 @@ extern "C" { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_dynamic_resize)); + iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_array_resize)); return; } @@ -396,15 +396,15 @@ extern "C" { // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it. if (main->setting.wrap.array[at].a.size) { - main->setting.state.status = f_string_dynamic_resize(0, &main->setting.wrap.array[at].a); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->setting.wrap.array[at].a.string, &main->setting.wrap.array[at].a.used, &main->setting.wrap.array[at].a.size); } if (F_status_is_error_not(main->setting.state.status) && main->setting.wrap.array[at].b.size) { - main->setting.state.status = f_string_dynamic_resize(0, &main->setting.wrap.array[at].b); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->setting.wrap.array[at].b.string, &main->setting.wrap.array[at].b.used, &main->setting.wrap.array[at].b.size); } if (F_status_is_error_not(main->setting.state.status) && main->setting.wrap.array[at].c.size) { - main->setting.state.status = f_string_dynamic_resize(0, &main->setting.wrap.array[at].c); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->setting.wrap.array[at].c.string, &main->setting.wrap.array[at].c.used, &main->setting.wrap.array[at].c.size); } if (F_status_is_error(main->setting.state.status)) { @@ -412,7 +412,7 @@ extern "C" { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_dynamic_resize)); + iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_array_resize)); return; } @@ -542,14 +542,14 @@ extern "C" { if (main->program.parameters.remaining.used) { main->setting.files.used = 0; - main->setting.state.status = f_string_dynamics_resize(main->program.parameters.remaining.used, &main->setting.files); + main->setting.state.status = f_memory_arrays_resize(main->program.parameters.remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.files.array, &main->setting.files.used, &main->setting.files.size, &f_string_dynamics_delete_callback); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_dynamics_resize)); + iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_arrays_resize)); return; } @@ -560,14 +560,14 @@ extern "C" { // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it. if (main->setting.files.array[main->setting.files.used].size) { - main->setting.state.status = f_string_dynamic_resize(0, &main->setting.files.array[main->setting.files.used]); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->setting.files.array[main->setting.files.used].string, &main->setting.files.array[main->setting.files.used].used, &main->setting.files.array[main->setting.files.used].size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_dynamic_resize)); + iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_array_resize)); return; } @@ -649,15 +649,15 @@ extern "C" { // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it. if (triple->array[at].a.size) { - main->setting.state.status = f_string_dynamic_resize(0, &triple->array[at].a); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &triple->array[at].a.string, &triple->array[at].a.used, &triple->array[at].a.size); } if (F_status_is_error_not(main->setting.state.status) && triple->array[at].b.size) { - main->setting.state.status = f_string_dynamic_resize(0, &triple->array[at].b); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &triple->array[at].b.string, &triple->array[at].b.used, &triple->array[at].b.size); } if (F_status_is_error_not(main->setting.state.status) && triple->array[at].c.size) { - main->setting.state.status = f_string_dynamic_resize(0, &triple->array[at].c); + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &triple->array[at].c.string, &triple->array[at].c.used, &triple->array[at].c.size); } if (F_status_is_error(main->setting.state.status)) { @@ -665,7 +665,7 @@ extern "C" { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_dynamic_resize)); + iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_array_resize)); return F_false; } diff --git a/level_3/iki_read/c/main/common.h b/level_3/iki_read/c/main/common.h index 1e2b8a8..73a76b1 100644 --- a/level_3/iki_read/c/main/common.h +++ b/level_3/iki_read/c/main/common.h @@ -33,8 +33,8 @@ extern "C" { * * Errors (with error bit) from: f_console_parameter_process(). * Errors (with error bit) from: f_file_exists(). + * Errors (with error bit) from: f_memory_array_resize(). * 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_maps_resize(). * Errors (with error bit) from: f_string_triples_resize(). * Errors (with error bit) from: fll_program_parameter_process_context(). @@ -42,8 +42,8 @@ extern "C" { * * @see f_console_parameter_process() * @see f_file_exists() + * @see f_memory_array_resize() * @see f_string_dynamic_append() - * @see f_string_dynamic_resize() * @see f_string_maps_resize() * @see f_string_triples_resize() * @see fll_program_parameter_process_context() @@ -64,7 +64,7 @@ extern "C" { * This alters main.setting.state.status: * F_okay on success. * - * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_memory_array_resize(). * Errors (with error bit) from: f_string_triples_resize(). * @param name * The name of the parameter. @@ -76,7 +76,7 @@ extern "C" { * F_true if found and processed. * F_false if not found or not processed. * - * @see f_string_dynamic_resize() + * @see f_memory_array_resize() * @see f_string_triples_resize() */ #ifndef _di_iki_read_setting_load_parameter_substitution_ diff --git a/level_3/iki_read/c/main/common/print.c b/level_3/iki_read/c/main/common/print.c index 5395a20..cc5ecc2 100644 --- a/level_3/iki_read/c/main/common/print.c +++ b/level_3/iki_read/c/main/common/print.c @@ -13,12 +13,11 @@ extern "C" { "f_file_size_by_id", "f_file_stream_open", "f_file_stream_read_until", + "f_memory_array_increase_by", + "f_memory_array_resize", + "f_memory_arrays_resize", "f_string_dynamic_append_nulless", - "f_string_dynamic_increase_by", - "f_string_dynamic_resize", "f_string_dynamics_append", - "f_string_dynamics_increase_by", - "f_string_dynamics_resize", "f_string_maps_increase_by", "f_string_triples_increase_by", "f_thread_create", diff --git a/level_3/iki_read/c/main/common/print.h b/level_3/iki_read/c/main/common/print.h index 7e40b70..4901068 100644 --- a/level_3/iki_read/c/main/common/print.h +++ b/level_3/iki_read/c/main/common/print.h @@ -46,9 +46,10 @@ extern "C" { iki_read_f_f_file_size_by_id_e, iki_read_f_f_file_stream_open_e, iki_read_f_f_file_stream_read_until_e, + iki_read_f_f_memory_array_increase_by_e, + iki_read_f_f_memory_array_resize_e, + iki_read_f_f_memory_arrays_resize_e, iki_read_f_f_string_dynamic_append_nulless_e, - iki_read_f_f_string_dynamic_increase_by_e, - iki_read_f_f_string_dynamic_resize_e, iki_read_f_f_string_dynamics_append_e, iki_read_f_f_string_dynamics_increase_by_e, iki_read_f_f_string_dynamics_resize_e, diff --git a/level_3/iki_read/c/main/common/type.c b/level_3/iki_read/c/main/common/type.c index 931de23..81ed025 100644 --- a/level_3/iki_read/c/main/common/type.c +++ b/level_3/iki_read/c/main/common/type.c @@ -19,9 +19,10 @@ extern "C" { if (!setting) return F_status_set_error(F_parameter); - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamics_resize(0, &setting->names); - f_string_dynamics_resize(0, &setting->files); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->buffer.string, &setting->buffer.used, &setting->buffer.size); + + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->names.array, &setting->names.used, &setting->names.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->files.array, &setting->files.used, &setting->files.size, &f_string_dynamics_delete_callback); f_string_maps_resize(0, &setting->replace); f_string_triples_resize(0, &setting->reassign); diff --git a/level_3/iki_read/c/main/iki_read.c b/level_3/iki_read/c/main/iki_read.c index 69e964f..aae7cc7 100644 --- a/level_3/iki_read/c/main/iki_read.c +++ b/level_3/iki_read/c/main/iki_read.c @@ -116,10 +116,10 @@ extern "C" { } // Pre-allocate entire file buffer plus space for the terminating NULL. - main->setting.state.status = f_string_dynamic_increase_by(size_file + 1, &main->setting.buffer); + main->setting.state.status = f_memory_array_increase_by(size_file + 1, sizeof(f_char_t), (void **) &main->setting.buffer.string, &main->setting.buffer.used, &main->setting.buffer.size); if (F_status_is_error(main->setting.state.status)) { - iki_read_print_error_file(&main->program.error, macro_iki_read_f(f_string_dynamic_increase_by), main->setting.files.array[i], f_file_operation_process_s, fll_error_file_type_file_e); + iki_read_print_error_file(&main->program.error, macro_iki_read_f(f_memory_array_increase_by), main->setting.files.array[i], f_file_operation_process_s, fll_error_file_type_file_e); break; } diff --git a/level_3/iki_read/c/main/process.c b/level_3/iki_read/c/main/process.c index 5f29b01..a226bf7 100644 --- a/level_3/iki_read/c/main/process.c +++ b/level_3/iki_read/c/main/process.c @@ -337,7 +337,7 @@ extern "C" { if (F_status_is_error(main->setting.state.status)) { iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_dynamic_append_nulless)); - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); return; } @@ -352,7 +352,7 @@ extern "C" { } // for } // for - f_string_dynamic_resize(0, &name); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); } else { total = main->setting.data.variable.used; diff --git a/level_3/iki_write/c/main/common.c b/level_3/iki_write/c/main/common.c index e0baed8..5595c72 100644 --- a/level_3/iki_write/c/main/common.c +++ b/level_3/iki_write/c/main/common.c @@ -142,14 +142,14 @@ extern "C" { main->setting.objects.used = 0; - main->setting.state.status = f_string_dynamics_resize(values->used, &main->setting.objects); + main->setting.state.status = f_memory_arrays_resize(values->used, sizeof(f_string_dynamic_t), (void **) &main->setting.objects.array, &main->setting.objects.used, &main->setting.objects.size, &f_string_dynamics_delete_callback); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & iki_write_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - iki_write_print_error(&main->program.error, macro_iki_write_f(f_string_dynamics_resize)); + iki_write_print_error(&main->program.error, macro_iki_write_f(f_memory_arrays_resize)); return; } @@ -183,14 +183,14 @@ extern "C" { main->setting.contents.used = 0; - main->setting.state.status = f_string_dynamics_resize(values->used, &main->setting.contents); + main->setting.state.status = f_memory_arrays_resize(values->used, sizeof(f_string_dynamic_t), (void **) &main->setting.contents.array, &main->setting.contents.used, &main->setting.contents.size, &f_string_dynamics_delete_callback); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & iki_write_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - iki_write_print_error(&main->program.error, macro_iki_write_f(f_string_dynamics_resize)); + iki_write_print_error(&main->program.error, macro_iki_write_f(f_memory_arrays_resize)); return; } diff --git a/level_3/iki_write/c/main/common/print.c b/level_3/iki_write/c/main/common/print.c index 2d1fd7e..44d8002 100644 --- a/level_3/iki_write/c/main/common/print.c +++ b/level_3/iki_write/c/main/common/print.c @@ -10,9 +10,9 @@ extern "C" { "f_file_read", "f_file_stream_open", "f_iki_object_is", + "f_memory_arrays_resize", "f_string_dynamic_partial_append_nulless", "f_string_dynamic_seek_to", - "f_string_dynamics_resize", "f_thread_create", "fll_iki_content_escape", "fll_program_parameter_process_context_standard", diff --git a/level_3/iki_write/c/main/common/print.h b/level_3/iki_write/c/main/common/print.h index 9a0e346..1121f2d 100644 --- a/level_3/iki_write/c/main/common/print.h +++ b/level_3/iki_write/c/main/common/print.h @@ -43,9 +43,9 @@ extern "C" { iki_write_f_f_file_read_e, iki_write_f_f_file_stream_open_e, iki_write_f_f_iki_object_is_e, + iki_write_f_f_memory_arrays_resize_e, iki_write_f_f_string_dynamic_partial_append_nulless_e, iki_write_f_f_string_dynamic_seek_to_e, - iki_write_f_f_string_dynamics_resize_e, iki_write_f_f_thread_create_e, iki_write_f_fll_iki_content_escape_e, iki_write_f_fll_program_parameter_process_context_standard_e, diff --git a/level_3/iki_write/c/main/common/type.c b/level_3/iki_write/c/main/common/type.c index dad4be0..6b34a26 100644 --- a/level_3/iki_write/c/main/common/type.c +++ b/level_3/iki_write/c/main/common/type.c @@ -19,13 +19,13 @@ extern "C" { if (!setting) return F_status_set_error(F_parameter); - f_string_dynamic_resize(0, &setting->escaped); - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamic_resize(0, &setting->object); - f_string_dynamic_resize(0, &setting->content); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->escaped.string, &setting->escaped.used, &setting->escaped.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->buffer.string, &setting->buffer.used, &setting->buffer.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->object.string, &setting->object.used, &setting->object.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->content.string, &setting->content.used, &setting->content.size); - f_string_dynamics_resize(0, &setting->objects); - f_string_dynamics_resize(0, &setting->contents); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->objects.array, &setting->objects.used, &setting->objects.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->contents.array, &setting->contents.used, &setting->contents.size, &f_string_dynamics_delete_callback); return F_okay; } diff --git a/level_3/iki_write/c/main/print/error.c b/level_3/iki_write/c/main/print/error.c index f1d07ce..cd0e57b 100644 --- a/level_3/iki_write/c/main/print/error.c +++ b/level_3/iki_write/c/main/print/error.c @@ -59,7 +59,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe object '%]", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, object, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, object, print->set->notable); fl_print_format("%[' is not a valid IKI Object.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/level_3/utf8/c/main/codepoint.c b/level_3/utf8/c/main/codepoint.c index 43eda08..460c4b5 100644 --- a/level_3/utf8/c/main/codepoint.c +++ b/level_3/utf8/c/main/codepoint.c @@ -14,10 +14,8 @@ extern "C" { bool valid_not = F_false; if (*mode != utf8_codepoint_mode_end_e) { - if (main->setting.text.used + unicode.used >= main->setting.text.size) { - main->setting.state.status = f_string_dynamic_increase_by(utf8_allocation_small_d, &main->setting.text); - if (F_status_is_error(main->setting.state.status)) return; - } + main->setting.state.status = f_memory_array_increase_by(unicode.used, sizeof(f_char_t), (void **) &main->setting.text.string, &main->setting.text.used, &main->setting.text.size); + if (F_status_is_error(main->setting.state.status)) return; for (f_number_unsigned_t i = 0; i < unicode.used; ++i) { main->setting.text.string[main->setting.text.used++] = unicode.string[i]; @@ -107,10 +105,8 @@ extern "C" { bool valid_not = F_false; if (*mode != utf8_codepoint_mode_raw_end_e) { - if (main->setting.text.used + hex.used >= main->setting.text.size) { - main->setting.state.status = f_string_dynamic_increase_by(utf8_allocation_small_d, &main->setting.text); - if (F_status_is_error(main->setting.state.status)) return; - } + main->setting.state.status = f_memory_array_increase_by(hex.used, sizeof(f_char_t), (void **) &main->setting.text.string, &main->setting.text.used, &main->setting.text.size); + if (F_status_is_error(main->setting.state.status)) return; for (f_number_unsigned_t i = 0; i < hex.used; ++i) { main->setting.text.string[main->setting.text.used++] = hex.string[i]; diff --git a/level_3/utf8/c/main/common.c b/level_3/utf8/c/main/common.c index a56c2f8..10f1a64 100644 --- a/level_3/utf8/c/main/common.c +++ b/level_3/utf8/c/main/common.c @@ -196,14 +196,14 @@ extern "C" { if (main->program.parameters.arguments.array[main->program.parameters.array[utf8_parameter_to_file_e].values.array[0]].used) { main->setting.path_files_to.used = 0; - main->setting.state.status = f_string_dynamics_increase_by(1, &main->setting.path_files_to); + main->setting.state.status = f_memory_array_increase_by(1, sizeof(f_string_dynamic_t), (void **) &main->setting.path_files_to.array, &main->setting.path_files_to.used, &main->setting.path_files_to.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & utf8_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - utf8_print_error(&main->program.error, macro_utf8_f(f_string_dynamics_increase_by)); + utf8_print_error(&main->program.error, macro_utf8_f(f_memory_array_increase_by)); return; } @@ -269,14 +269,14 @@ extern "C" { if (main->program.parameters.array[utf8_parameter_from_file_e].result & f_console_result_value_e) { main->setting.path_files_from.used = 0; - main->setting.state.status = f_string_dynamics_increase_by(main->program.parameters.array[utf8_parameter_from_file_e].values.used, &main->setting.path_files_from); + main->setting.state.status = f_memory_array_increase_by(main->program.parameters.array[utf8_parameter_from_file_e].values.used, sizeof(f_string_dynamic_t), (void **) &main->setting.path_files_from.array, &main->setting.path_files_from.used, &main->setting.path_files_from.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & utf8_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - utf8_print_error(&main->program.error, macro_utf8_f(f_string_dynamics_increase_by)); + utf8_print_error(&main->program.error, macro_utf8_f(f_memory_array_increase_by)); return; } @@ -291,7 +291,7 @@ extern "C" { index = main->program.parameters.array[utf8_parameter_from_file_e].values.array[i]; main->setting.path_files_from.array[i].used = 0; - main->setting.state.status = f_string_dynamic_append_nulless(main->program.parameters.arguments.array[index], &main->setting.path_files_from.array[i]); + main->setting.state.status = f_string_dynamic_append(main->program.parameters.arguments.array[index], &main->setting.path_files_from.array[i]); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & utf8_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { @@ -349,14 +349,14 @@ extern "C" { if (main->program.parameters.remaining.used) { main->setting.remaining.used = 0; - main->setting.state.status = f_string_dynamics_increase_by(main->program.parameters.remaining.used, &main->setting.remaining); + main->setting.state.status = f_memory_array_increase_by(main->program.parameters.remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.remaining.array, &main->setting.remaining.used, &main->setting.remaining.size); if (F_status_is_error(main->setting.state.status)) { if ((main->setting.flag & utf8_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - utf8_print_error(&main->program.error, macro_utf8_f(f_string_dynamics_increase_by)); + utf8_print_error(&main->program.error, macro_utf8_f(f_memory_array_increase_by)); return; } diff --git a/level_3/utf8/c/main/common/print.c b/level_3/utf8/c/main/common/print.c index 86b26aa..a4b9d71 100644 --- a/level_3/utf8/c/main/common/print.c +++ b/level_3/utf8/c/main/common/print.c @@ -9,6 +9,7 @@ extern "C" { "f_console_parameter_prioritize_right", "f_console_parameter_process", "f_file_stream_open", + "f_memory_array_increase_by", "f_string_dynamic_append_nulless", "f_string_dynamics_increase_by", "f_thread_create", diff --git a/level_3/utf8/c/main/common/print.h b/level_3/utf8/c/main/common/print.h index 4059a6a..ad96967 100644 --- a/level_3/utf8/c/main/common/print.h +++ b/level_3/utf8/c/main/common/print.h @@ -42,6 +42,7 @@ extern "C" { utf8_f_f_console_parameter_prioritize_right_e, utf8_f_f_console_parameter_process_e, utf8_f_f_file_stream_open_e, + utf8_f_f_memory_array_increase_by_e, utf8_f_f_string_dynamic_append_nulless_e, utf8_f_f_string_dynamics_increase_by_e, utf8_f_f_thread_create_e, diff --git a/level_3/utf8/c/main/common/type.c b/level_3/utf8/c/main/common/type.c index 1bdbef0..f77336d 100644 --- a/level_3/utf8/c/main/common/type.c +++ b/level_3/utf8/c/main/common/type.c @@ -19,12 +19,12 @@ extern "C" { if (!setting) return F_status_set_error(F_parameter); - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamic_resize(0, &setting->text); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->buffer.string, &setting->buffer.used, &setting->buffer.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->text.string, &setting->text.used, &setting->text.size); - f_string_dynamics_resize(0, &setting->path_files_from); - f_string_dynamics_resize(0, &setting->path_files_to); - f_string_dynamics_resize(0, &setting->remaining); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->path_files_from.array, &setting->path_files_from.used, &setting->path_files_from.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->path_files_to.array, &setting->path_files_to.used, &setting->path_files_to.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->remaining.array, &setting->remaining.used, &setting->remaining.size, &f_string_dynamics_delete_callback); return F_okay; } diff --git a/level_3/utf8/c/main/print/error.c b/level_3/utf8/c/main/print/error.c index c3425b5..6c8e8c2 100644 --- a/level_3/utf8/c/main/print/error.c +++ b/level_3/utf8/c/main/print/error.c @@ -50,7 +50,7 @@ extern "C" { else { fl_print_format("%[', error status code%] ", print->to, print->set->error, print->set->error, f_string_eol_s); fl_print_format("%[%ui%]", print->to, print->set->notable, F_status_set_fine(main->setting.state.status), print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); } return F_okay; @@ -76,7 +76,7 @@ extern "C" { else { fl_print_format("%[', error status code%] ", print->to, print->set->error, print->set->error, f_string_eol_s); fl_print_format("%[%ui%]", print->to, print->set->notable, F_status_set_fine(main->setting.state.status), print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); } return F_okay; @@ -119,7 +119,7 @@ extern "C" { fl_print_format("%[%QNo file specified at parameter index%] ", print->to, print->set->error, print->prefix, print->set->error); fl_print_format("%[%ul%]", print->to, print->set->notable, index, print->set->notable); - fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -136,8 +136,8 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QFailed to find the %r file '%]", print->to, print->set->error, print->prefix, from ? utf8_string_from_s : utf8_string_to_s, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, name, print->set->notable); - fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, name, print->set->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); -- 1.8.3.1