From 9fabec0577b83e6f54aeee03f808c54f25d392c9 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 13 Jan 2021 22:14:45 -0600 Subject: [PATCH] Update: more FLL cleanup and consistency. Finish the previous cleanup and consistency changes. There is likely more to do, but I believe this is enough for now, at least in regards to this set of changes. Much of the code is refreshed in terms the memory structure. I don't like doing this but after some consideration, I have decided to break out the array types from f_type into a new project, f_type_array. This is an exception cases of the exception cases (unfortunately). This acts as an extension to f_type, except that it depends on f_memory. This will provide common functions for array types. Parts of this remain defined in f_type because f_memory also depends on these arrays. By handling code this way I can avoid circular dependencies in both f_type and f_memory. One major change is now that I am implementing more functions in place of the memory-related macros (to save space, overall), I find it easier and simpler to only use resize and adjust in place of delete and destroy. This significantly reduces the amount of code needed in regards to trying to achieve completeness. I was also considering removing f_memory_delete() and f_memory_destroy(), but decided to roll that back. The f_memory_delete() and f_memory_destroy() are low level and should still exist for completeness even if I am re-using adjust and resize for many of the other parts. For example, there are cases where I may need to call free() on types not defined by this project, these functions will be helpful. Furthermore, to help hackers implement their own variations of things, providing these may be a boon. This is such a massive change that I am concerned of regressions. I have done some quick compile and run tests using the programs so I believe that this is reasonably done without regressions. I plan on doing a refresh the UTF-8 string processing code (which will be a complete refresh to be just like the recent f_string changes). There may be other changes needed to prep the state of the code before I do this. --- build/documents/readme.txt | 3 +- build/level_0/settings | 4 +- build/level_1/settings | 4 +- build/monolithic/settings | 4 +- build/scripts/bootstrap-example.sh | 2 +- level_0/f_account/c/account-common.h | 115 +- level_0/f_capability/c/capability.h | 2 +- level_0/f_capability/data/build/dependencies | 1 + level_0/f_capability/data/build/settings | 2 +- level_0/f_color/c/color-common.h | 118 +- level_0/f_console/c/console.c | 4 +- level_0/f_console/c/console.h | 2 +- level_0/f_console/data/build/dependencies | 1 + level_0/f_console/data/build/settings | 2 +- level_0/f_control_group/c/control_group-common.h | 8 - level_0/f_directory/c/directory.c | 14 +- level_0/f_directory/c/directory_type.h | 70 +- level_0/f_fss/c/fss-common.h | 92 +- level_0/f_fss/c/fss.h | 2 +- level_0/f_fss/c/fss_comment.h | 44 +- level_0/f_fss/c/fss_delimit.h | 44 +- level_0/f_fss/c/fss_named.c | 117 +- level_0/f_fss/c/fss_named.h | 195 ++- level_0/f_fss/c/fss_nest.c | 201 +-- level_0/f_fss/c/fss_nest.h | 338 +---- level_0/f_fss/c/fss_quote.h | 46 +- level_0/f_fss/c/fss_set.c | 76 +- level_0/f_fss/c/fss_set.h | 176 +-- level_0/f_fss/c/private-fss.c | 498 ++----- level_0/f_fss/c/private-fss.h | 298 ++-- level_0/f_fss/data/build/dependencies | 1 + level_0/f_fss/data/build/settings | 2 +- level_0/f_iki/c/iki-common.h | 25 - level_0/f_iki/c/iki.c | 40 +- level_0/f_limit/c/limit-common.h | 46 +- level_0/f_memory/c/memory-common.h | 195 +-- level_0/f_memory/c/memory.c | 80 +- level_0/f_memory/c/memory.h | 63 +- level_0/f_memory/c/memory_structure.c | 56 +- level_0/f_memory/c/memory_structure.h | 99 +- level_0/f_memory/c/private-memory.c | 28 +- level_0/f_memory/c/private-memory.h | 25 +- level_0/f_path/c/path.c | 3 +- level_0/f_serialize/c/serialize.c | 3 +- level_0/f_status/c/status_array.h | 54 +- level_0/f_string/c/private-string.c | 405 ++++-- level_0/f_string/c/private-string.h | 393 +++-- level_0/f_string/c/string-common.h | 55 +- level_0/f_string/c/string_dynamic.c | 154 +- level_0/f_string/c/string_dynamic.h | 284 +--- level_0/f_string/c/string_map.c | 121 +- level_0/f_string/c/string_map.h | 392 +++-- level_0/f_string/c/string_quantity.c | 121 +- level_0/f_string/c/string_quantity.h | 225 ++- level_0/f_string/c/string_range.c | 121 +- level_0/f_string/c/string_range.h | 215 ++- level_0/f_string/c/string_triple.c | 28 +- level_0/f_string/c/string_triple.h | 152 +- level_0/f_thread/c/thread-common.h | 214 ++- level_0/f_type/c/type.h | 507 +++++++ level_0/f_type/c/type_array.h | 970 ------------- level_0/f_type/data/build/settings | 2 +- level_0/f_type_array/c/private-type_array.c | 250 ++++ level_0/f_type_array/c/private-type_array.h | 646 +++++++++ level_0/f_type_array/c/type_array-common.h | 455 ++++++ level_0/f_type_array/c/type_array.c | 1116 ++++++++++++++ level_0/f_type_array/c/type_array.h | 1533 ++++++++++++++++++++ .../f_type_array}/data/build/defines | 0 .../f_type_array}/data/build/dependencies | 0 .../f_type_array}/data/build/settings | 8 +- level_0/f_utf/c/utf-common.h | 9 +- level_0/f_utf/c/utf.c | 52 +- level_1/fl_console/c/console.c | 27 +- level_1/fl_console/data/build/settings | 2 +- level_1/fl_control_group/c/control_group.c | 10 - level_1/fl_control_group/c/control_group.h | 14 - level_1/fl_directory/c/private-directory.c | 11 +- level_1/fl_environment/c/environment.c | 45 +- level_1/fl_execute/c/execute.h | 3 +- level_1/fl_execute/data/build/dependencies | 2 + level_1/fl_execute/data/build/settings | 2 +- level_1/fl_fss/c/fss_basic.c | 2 +- level_1/fl_fss/c/fss_basic_list.c | 4 +- level_1/fl_fss/c/fss_embedded_list.c | 8 +- level_1/fl_fss/c/fss_extended_list.c | 4 +- level_1/fl_fss/data/build/settings | 2 +- level_1/fl_type/c/private-type.c | 202 --- level_1/fl_type/c/private-type.h | 418 ------ level_1/fl_type/c/type.c | 1164 --------------- level_1/fl_type/c/type.h | 1229 ---------------- level_1/fl_utf/c/private-utf.c | 12 +- level_1/fl_utf/c/utf.c | 4 +- level_1/fl_utf_file/c/utf_file.c | 6 +- level_2/fll_error/data/build/settings | 2 +- level_2/fll_execute/c/execute.c | 16 +- level_2/fll_execute/c/private-execute.c | 22 +- level_2/fll_execute/data/build/settings | 4 +- level_2/fll_fss/c/fss.c | 196 +-- level_2/fll_fss/c/fss_basic.c | 21 +- level_2/fll_fss/c/fss_basic_list.c | 4 +- level_2/fll_fss/c/fss_extended.c | 4 +- level_2/fll_fss/c/fss_extended_list.c | 4 +- level_2/fll_fss/data/build/settings | 2 +- level_2/fll_program/c/program.c | 6 +- level_2/fll_program/data/build/settings | 2 +- level_3/byte_dump/data/build/settings | 2 +- level_3/control/data/build/settings | 2 +- level_3/controller/c/private-common.h | 56 +- level_3/controller/c/private-controller.c | 20 +- level_3/controller/c/private-controller.h | 10 +- level_3/controller/c/private-entry.c | 4 +- level_3/controller/c/private-rule.c | 20 +- level_3/controller/data/build/dependencies | 2 +- level_3/controller/data/build/settings | 2 +- level_3/fake/c/fake.c | 108 +- level_3/fake/c/fake.h | 2 +- level_3/fake/c/private-build.c | 130 +- level_3/fake/c/private-build.h | 96 +- level_3/fake/c/private-fake.c | 10 +- level_3/fake/c/private-make.c | 58 +- level_3/fake/c/private-make.h | 30 +- level_3/fake/c/private-skeleton.c | 4 +- level_3/fake/data/build/dependencies | 1 + level_3/fake/data/build/settings | 2 +- level_3/firewall/c/firewall.c | 8 +- level_3/firewall/c/firewall.h | 2 +- level_3/firewall/c/private-firewall.c | 119 +- level_3/firewall/c/private-firewall.h | 6 +- level_3/firewall/data/build/dependencies | 1 + level_3/firewall/data/build/settings | 2 +- .../fss_basic_list_read/c/fss_basic_list_read.c | 8 +- .../c/private-fss_basic_list_read.c | 6 +- .../c/private-fss_basic_list_read.h | 21 +- level_3/fss_basic_list_read/data/build/settings | 2 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 8 +- .../c/private-fss_basic_list_write.c | 6 +- level_3/fss_basic_list_write/data/build/settings | 2 +- level_3/fss_basic_read/c/fss_basic_read.c | 8 +- level_3/fss_basic_read/c/private-fss_basic_read.c | 6 +- level_3/fss_basic_read/c/private-fss_basic_read.h | 12 +- level_3/fss_basic_read/data/build/settings | 2 +- level_3/fss_basic_write/c/fss_basic_write.c | 8 +- .../fss_basic_write/c/private-fss_basic_write.c | 6 +- level_3/fss_basic_write/data/build/settings | 2 +- .../c/fss_embedded_list_read.c | 8 +- .../c/private-fss_embedded_list_read.c | 6 +- .../c/private-fss_embedded_list_read.h | 21 +- level_3/fss_embedded_list_read/data/build/settings | 2 +- .../c/fss_embedded_list_write.c | 8 +- .../c/private-fss_embedded_list_write.c | 6 +- .../fss_embedded_list_write/data/build/settings | 2 +- .../c/fss_extended_list_read.c | 8 +- .../c/private-fss_extended_list_read.c | 6 +- .../c/private-fss_extended_list_read.h | 23 +- level_3/fss_extended_list_read/data/build/settings | 2 +- .../c/fss_extended_list_write.c | 8 +- .../c/private-fss_extended_list_write.c | 6 +- .../fss_extended_list_write/data/build/settings | 2 +- level_3/fss_extended_read/c/fss_extended_read.c | 8 +- .../c/private-fss_extended_read.c | 6 +- .../c/private-fss_extended_read.h | 21 +- level_3/fss_extended_read/data/build/settings | 2 +- level_3/fss_extended_write/c/fss_extended_write.c | 8 +- .../c/private-fss_extended_write.c | 6 +- level_3/fss_extended_write/data/build/settings | 2 +- level_3/fss_status_code/data/build/settings | 2 +- level_3/iki_read/c/iki_read.c | 6 +- level_3/iki_read/c/iki_read.h | 15 +- level_3/iki_read/c/private-iki_read.c | 12 +- level_3/iki_read/data/build/settings | 2 +- level_3/iki_write/c/iki_write.c | 10 +- level_3/iki_write/c/private-iki_write.c | 2 +- level_3/iki_write/data/build/settings | 2 +- level_3/init/c/init.c | 12 +- level_3/init/c/private-init.c | 4 +- level_3/init/data/build/settings | 2 +- level_3/status_code/data/build/settings | 2 +- 177 files changed, 7676 insertions(+), 8435 deletions(-) delete mode 100644 level_0/f_type/c/type_array.h create mode 100644 level_0/f_type_array/c/private-type_array.c create mode 100644 level_0/f_type_array/c/private-type_array.h create mode 100644 level_0/f_type_array/c/type_array-common.h create mode 100644 level_0/f_type_array/c/type_array.c create mode 100644 level_0/f_type_array/c/type_array.h rename {level_1/fl_type => level_0/f_type_array}/data/build/defines (100%) rename {level_1/fl_type => level_0/f_type_array}/data/build/dependencies (100%) rename {level_1/fl_type => level_0/f_type_array}/data/build/settings (82%) delete mode 100644 level_1/fl_type/c/private-type.c delete mode 100644 level_1/fl_type/c/private-type.h delete mode 100644 level_1/fl_type/c/type.c delete mode 100644 level_1/fl_type/c/type.h diff --git a/build/documents/readme.txt b/build/documents/readme.txt index 3513207..62c42bc 100644 --- a/build/documents/readme.txt +++ b/build/documents/readme.txt @@ -34,10 +34,11 @@ Readme Documentation: - f_type: provides core typedef, #define, and similar structures for the entire set of FLL projects. - f_status: provides status codes and other status codes to be used by the entire set of FLL projects. - f_memory: provides common memory allocation/deallocation to be used by the entire set of FLL projects. + - f_type_array: provides an extension on f_type that requires linking to f_memory to be used by the entire set of FLL projects. - f_string: provides common string management to be used by the entire set of the FLL projects. - f_utf: provides common UTF-8 related string management to be used by the entire set of the FLL projects. - The above projects should be installed first, and in the provided order (f_type, then f_status, then f_memory, f_string, and finally f_utf). + The above projects should be installed first, and in the provided order (f_type, then f_status, then f_memory, then f_type_array, then f_string, and finally f_utf). No other level_0 project should depend on another and can be installed in any order. To facilitate building of this project, two different build systems are provided\: diff --git a/build/level_0/settings b/build/level_0/settings index a08adf2..4d3229e 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -21,10 +21,10 @@ build_language c build_libraries -lc -lcap build_libraries-level build_libraries-level_threadless -build_sources_library account.c private-account.c capability.c color.c color-common.c console.c console-common.c control_group.c control_group-common.c conversion.c directory.c private-directory.c environment.c private-environment.c file.c file-common.c private-file.c fss.c private-fss.c fss_named.c fss_nest.c fss_set.c iki.c iki-common.c private-iki.c limit.c memory.c memory_structure.c private-memory.c path.c path-common.c private-path.c pipe.c print.c private-print.c serialize.c serialize-common.c private-serialize.c signal.c socket.c string.c string-common.c private-string.c string_dynamic.c string_map.c string_quantity.c string_range.c string_triple.c utf.c private-utf.c +build_sources_library account.c private-account.c capability.c color.c color-common.c console.c console-common.c control_group.c control_group-common.c conversion.c directory.c private-directory.c environment.c private-environment.c file.c file-common.c private-file.c fss.c private-fss.c fss_named.c fss_nest.c fss_set.c iki.c iki-common.c private-iki.c limit.c memory.c memory_structure.c private-memory.c path.c path-common.c private-path.c pipe.c print.c private-print.c serialize.c serialize-common.c private-serialize.c signal.c socket.c string.c string-common.c private-string.c string_dynamic.c string_map.c string_quantity.c string_range.c string_triple.c type_array.c private-type_array.c utf.c private-utf.c build_sources_library-level thread.c build_sources_program -build_sources_headers account.h account-common.h capability.h capability-common.h color.h color-common.h console.h console-common.h control_group.h control_group-common.h conversion.h conversion-common.h directory.h directory_type.h directory-common.h environment.h environment-common.h execute.h execute-common.h file.h file-common.h fss.h private-fss.h fss-common.h fss_comment.h fss_delimit.h fss_named.h fss_nest.h fss_quote.h fss_set.h iki.h iki-common.h limit.h limit-common.h memory.h memory_structure.h memory-common.h path.h path-common.h pipe.h print.h serialize.h serialize-common.h signal.h signal-common.h socket.h socket-common.h status.h status_array.h string.h string-common.h private-string.h string_dynamic.h string_map.h string_quantity.h string_range.h string_triple.h type.h type_array.h utf.h utf-common.h +build_sources_headers account.h account-common.h capability.h capability-common.h color.h color-common.h console.h console-common.h control_group.h control_group-common.h conversion.h conversion-common.h directory.h directory_type.h directory-common.h environment.h environment-common.h execute.h execute-common.h file.h file-common.h fss.h private-fss.h fss-common.h fss_comment.h fss_delimit.h fss_named.h fss_nest.h fss_quote.h fss_set.h iki.h iki-common.h limit.h limit-common.h memory.h memory_structure.h memory-common.h path.h path-common.h pipe.h print.h serialize.h serialize-common.h signal.h signal-common.h socket.h socket-common.h status.h status_array.h string.h string-common.h private-string.h string_dynamic.h string_map.h string_quantity.h string_range.h string_triple.h type.h type_array.h private-type_array.h type_array-common.h utf.h utf-common.h build_sources_headers-level thread.h thread-common.h build_sources_script build_sources_setting diff --git a/build/level_1/settings b/build/level_1/settings index a1da354..f5cbdb5 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -21,10 +21,10 @@ build_language c build_libraries -lc -lcap build_libraries-level -lfll_0 build_libraries-level_threadless -lfll_0 -build_sources_library color.c console.c control_group.c conversion.c directory.c private-directory.c environment.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c iki.c print.c private-print.c status.c string.c private-string.c type.c private-type.c utf.c private-utf.c utf_file.c private-utf_file.c +build_sources_library color.c console.c control_group.c conversion.c directory.c private-directory.c environment.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c iki.c print.c private-print.c status.c string.c private-string.c utf.c private-utf.c utf_file.c private-utf_file.c build_sources_library-level build_sources_program -build_sources_headers color.h console.h control_group.h conversion.h directory.h environment.h execute.h execute-common.h fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h fss_status.h iki.h print.h status.h string.h type.h utf.h utf_file.h +build_sources_headers color.h console.h control_group.h conversion.h directory.h environment.h execute.h execute-common.h fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h fss_status.h iki.h print.h status.h string.h utf.h utf_file.h build_sources_headers-level build_sources_script build_sources_setting diff --git a/build/monolithic/settings b/build/monolithic/settings index 8d48001..8a7408a 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -21,10 +21,10 @@ build_language c build_libraries -lc -lcap build_libraries-monolithic build_libraries-monolithic_threadless -build_sources_library level_0/account.c level_0/private-account.c level_0/capability.c level_0/color.c level_0/color-common.c level_0/console.c level_0/console-common.c level_0/control_group.c level_0/control_group-common.c level_0/conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/file.c level_0/file-common.c level_0/private-file.c level_0/fss.c level_0/private-fss.c level_0/fss_named.c level_0/fss_nest.c level_0/fss_set.c level_0/iki.c level_0/iki-common.c level_0/private-iki.c level_0/limit.c level_0/memory.c level_0/memory_structure.c level_0/private-memory.c level_0/path.c level_0/path-common.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/private-print.c level_0/serialize.c level_0/serialize-common.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/string.c level_0/string-common.c level_0/private-string.c level_0/string_dynamic.c level_0/string_map.c level_0/string_quantity.c level_0/string_range.c level_0/string_triple.c level_0/utf.c level_0/private-utf.c level_1/color.c level_1/console.c level_1/control_group.c level_1/conversion.c level_1/directory.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/private-print.c level_1/status.c level_1/string.c level_1/private-string.c level_1/type.c level_1/private-type.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/control_group.c level_2/error.c level_2/error-common.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_status.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/program.c level_2/status.c +build_sources_library level_0/account.c level_0/private-account.c level_0/capability.c level_0/color.c level_0/color-common.c level_0/console.c level_0/console-common.c level_0/control_group.c level_0/control_group-common.c level_0/conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/file.c level_0/file-common.c level_0/private-file.c level_0/fss.c level_0/private-fss.c level_0/fss_named.c level_0/fss_nest.c level_0/fss_set.c level_0/iki.c level_0/iki-common.c level_0/private-iki.c level_0/limit.c level_0/memory.c level_0/memory_structure.c level_0/private-memory.c level_0/path.c level_0/path-common.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/private-print.c level_0/serialize.c level_0/serialize-common.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/string.c level_0/string-common.c level_0/private-string.c level_0/string_dynamic.c level_0/string_map.c level_0/string_quantity.c level_0/string_range.c level_0/string_triple.c level_0/type_array.c level_0/private-type_array.c level_0/utf.c level_0/private-utf.c level_1/color.c level_1/console.c level_1/control_group.c level_1/conversion.c level_1/directory.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/private-print.c level_1/status.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/control_group.c level_2/error.c level_2/error-common.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_status.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/program.c level_2/status.c build_sources_library-monolithic level_0/thread.c build_sources_program -build_sources_headers level_0/account.h level_0/account-common.h level_0/capability.h level_0/capability-common.h level_0/color.h level_0/color-common.h level_0/console.h level_0/console-common.h level_0/control_group.h level_0/control_group-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/private-fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/limit.h level_0/limit-common.h level_0/memory.h level_0/memory_structure.h level_0/memory-common.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/status_array.h level_0/string.h level_0/string-common.h level_0/private-string.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/utf.h level_0/utf-common.h level_1/color.h level_1/console.h level_1/control_group.h level_1/conversion.h level_1/directory.h level_1/environment.h level_1/execute.h level_1/execute-common.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/fss_status.h level_1/iki.h level_1/print.h level_1/status.h level_1/string.h level_1/type.h level_1/utf.h level_1/utf_file.h level_2/control_group.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_status.h level_2/iki.h level_2/path.h level_2/program.h level_2/status.h +build_sources_headers level_0/account.h level_0/account-common.h level_0/capability.h level_0/capability-common.h level_0/color.h level_0/color-common.h level_0/console.h level_0/console-common.h level_0/control_group.h level_0/control_group-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/private-fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/limit.h level_0/limit-common.h level_0/memory.h level_0/memory_structure.h level_0/memory-common.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/status_array.h level_0/string.h level_0/string-common.h level_0/private-string.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/private-type_array.h level_0/type_array-common.h level_0/utf.h level_0/utf-common.h level_1/color.h level_1/console.h level_1/control_group.h level_1/conversion.h level_1/directory.h level_1/environment.h level_1/execute.h level_1/execute-common.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/fss_status.h level_1/iki.h level_1/print.h level_1/status.h level_1/string.h level_1/utf.h level_1/utf_file.h level_2/control_group.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_status.h level_2/iki.h level_2/path.h level_2/program.h level_2/status.h build_sources_headers-monolithic level_0/thread.h level_0/thread-common.h build_sources_script build_sources_setting diff --git a/build/scripts/bootstrap-example.sh b/build/scripts/bootstrap-example.sh index 2fe265e..01ec4d2 100644 --- a/build/scripts/bootstrap-example.sh +++ b/build/scripts/bootstrap-example.sh @@ -56,7 +56,7 @@ if [[ $1 == "individual" ]] ; then bash build/scripts/package.sh $verbose $color build -i if [[ $? -eq 0 ]] ; then - for i in f_type f_status f_memory f_string f_utf f_account f_capability f_color f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_path f_pipe f_print f_serialize f_signal f_socket f_thread fl_color fl_console fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_print fl_status fl_string fl_type fl_utf fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_iki fll_path fll_program fll_status ; do + for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_path f_pipe f_print f_serialize f_signal f_socket f_thread fl_color fl_console fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_print fl_status fl_string fl_type fl_utf fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_iki fll_path fll_program fll_status ; do echo && echo "Processing $i." && cd package/individual/$i-$2/ && diff --git a/level_0/f_account/c/account-common.h b/level_0/f_account/c/account-common.h index 1c7aa0c..5a00b62 100644 --- a/level_0/f_account/c/account-common.h +++ b/level_0/f_account/c/account-common.h @@ -61,20 +61,6 @@ extern "C" { f_macro_account_t_clear(account.password); \ f_macro_account_t_clear(account.shell); - #define f_macro_account_t_delete(status, account) \ - f_macro_string_dynamic_t_delete(status, account.home); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, account.label); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, account.name); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, account.password); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, account.shell); - - #define f_macro_account_t_destroy(status, account) \ - f_macro_string_dynamic_t_destroy(status, account.home); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, account.label); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, account.name); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, account.password); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, account.shell); - #define f_macro_account_t_delete_simple(account) \ f_macro_string_dynamic_t_delete_simple(account.home); \ f_macro_string_dynamic_t_delete_simple(account.label); \ @@ -107,95 +93,18 @@ extern "C" { #define f_accounts_t_initialize { 0, 0, 0 } - #define f_macro_accounts_t_clear(accounts) \ - accounts.array = 0; \ - accounts.size = 0; \ - accounts.used = 0; - - #define f_macro_string_accounts_t_new(status, values, length) f_macro_memory_structure_new(status, values, f_account_t, length) - - #define f_macro_string_accounts_t_resize(status, accounts, new_length) \ - status = F_none; \ - if (new_length < accounts.size) { \ - for (register f_array_length_t _macro__i = accounts.size - new_length; _macro__i < accounts.size; ++_macro__i) { \ - f_macro_account_t_delete(status, accounts.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_resize((void **) & accounts.array, sizeof(f_account_t), accounts.size, new_length); \ - if (status == F_none) { \ - accounts.size = new_length; \ - if (accounts.used > accounts.size) accounts.used = new_length; \ - } - - #define f_macro_string_accounts_t_adjust(status, accounts, new_length) \ - status = F_none; \ - if (new_length < accounts.size) { \ - for (register f_array_length_t _macro__i = accounts.size - new_length; _macro__i < accounts.size; ++_macro__i) { \ - f_macro_account_t_destroy(status, accounts.array[_macro__i], f_account_t); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_macro_memory_structure_resize(status, values, sizeof(f_limit_value_t)); - - #define f_macro_string_accounts_t_delete(status, accounts) \ - status = F_none; \ - accounts.used = accounts.size; \ - while (accounts.used) { \ - accounts.used--; \ - f_macro_account_t_delete(status, accounts.array[accounts.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_delete((void **) & accounts.array, sizeof(f_account_t), accounts.size); \ - if (status == F_none) accounts.size = 0; - - #define f_macro_string_accounts_t_destroy(status, accounts) \ - status = F_none; \ - accounts.used = accounts.size; \ - while (accounts.used) { \ - accounts.used--; \ - f_macro_account_t_destroy(status, accounts.array[accounts.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_destroy((void **) & accounts.array, sizeof(f_account_t), accounts.size); \ - if (status == F_none) accounts.size = 0; - - #define f_macro_string_accounts_t_delete_simple(accounts) \ - accounts.used = accounts.size; \ - while (accounts.used) { \ - accounts.used--; \ - f_macro_account_t_delete_simple(accounts.array[accounts.used]); \ - } \ - f_memory_delete((void **) & accounts.array, sizeof(f_account_t), accounts.size); \ - accounts.size = 0; - - #define f_macro_string_accounts_t_destroy_simple(accounts) \ - accounts.used = accounts.size; \ - while (accounts.used) { \ - accounts.used--; \ - f_macro_account_t_destroy_simple(accounts.array[accounts.used]); \ - } \ - f_memory_destroy((void **) & accounts.array, sizeof(f_account_t), accounts.size); \ - accounts.size = 0; - - #define f_macro_string_accounts_t_increase(status, values) f_macro_memory_structure_increase(status, values, f_account_t); - #define f_macro_string_accounts_t_increase_by(status, values, amount) f_macro_memory_structure_increase_by(status, values, f_account_t), amount); - - #define f_macro_accounts_t_decrease_by(status, accounts, amount) \ - status = F_none; \ - for (register f_array_length_t _macro__i = amount <= accounts.size ? accounts.size - amount : 0; _macro__i < accounts.size; ++_macro__i) { \ - f_macro_account_t_delete(status, accounts.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_macro_memory_structure_decrease_by(status, accounts, f_account_t, amount); - - #define f_macro_accounts_t_decimate_by(status, accounts, amount) \ - status = F_none; \ - for (register f_array_length_t _macro__i = amount <= accounts.size ? accounts.size - amount : 0; _macro__i < accounts.size; ++_macro__i) { \ - f_macro_account_t_destroy(status, accounts.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_macro_memory_structure_decimate_by(status, accounts, f_account_t, amount); + #define f_macro_accounts_t_clear(accounts) f_macro_memory_structure_clear(accounts) + + #define f_macro_string_accounts_t_resize(status, accounts, length) f_macro_memory_structure_resize(status, values, sizeof(f_account_t), length) + #define f_macro_string_accounts_t_adjust(status, accounts, length) f_macro_memory_structure_adjust(status, values, sizeof(f_account_t), length) + + #define f_macro_string_accounts_t_delete_simple(accounts) f_macro_memory_structure_delete_simple(values, sizeof(f_account_t), 0) + #define f_macro_string_accounts_t_destroy_simple(accounts) f_macro_memory_structure_destroy_simple(values, sizeof(f_account_t), 0) + + #define f_macro_string_accounts_t_increase(status, values) f_macro_memory_structure_increase(status, values, f_account_t) + #define f_macro_string_accounts_t_increase_by(status, values, amount) f_macro_memory_structure_increase_by(status, values, f_account_t, amount) + #define f_macro_string_accounts_t_decrease_by(status, values, amount) f_macro_memory_structure_decrease_by(status, values, f_account_t, amount) + #define f_macro_string_accounts_t_decimate_by(status, values, amount) f_macro_memory_structure_decimate_by(status, values, f_account_t, amount) #endif // _di_f_accounts_t_ #ifdef __cplusplus diff --git a/level_0/f_capability/c/capability.h b/level_0/f_capability/c/capability.h index 4b94458..3bf3bff 100644 --- a/level_0/f_capability/c/capability.h +++ b/level_0/f_capability/c/capability.h @@ -27,9 +27,9 @@ // fll-0 includes #include -#include #include #include +#include #include // fll-0 capability includes diff --git a/level_0/f_capability/data/build/dependencies b/level_0/f_capability/data/build/dependencies index d798245..03d7727 100644 --- a/level_0/f_capability/data/build/dependencies +++ b/level_0/f_capability/data/build/dependencies @@ -3,4 +3,5 @@ f_type f_status f_memory +f_type_array f_string diff --git a/level_0/f_capability/data/build/settings b/level_0/f_capability/data/build/settings index 6facb8e..0450682 100644 --- a/level_0/f_capability/data/build/settings +++ b/level_0/f_capability/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -lcap -build_libraries-individual -lf_memory -lf_string +build_libraries-individual -lf_memory -lf_string -lf_type_array build_sources_library capability.c build_sources_program build_sources_headers capability.h capability-common.h diff --git a/level_0/f_color/c/color-common.h b/level_0/f_color/c/color-common.h index ccd7f85..5dbf85d 100644 --- a/level_0/f_color/c/color-common.h +++ b/level_0/f_color/c/color-common.h @@ -356,14 +356,14 @@ extern "C" { #define f_macro_color_set_context_t_initialize(warning, error, title, notable, important, standout, normal, normal_reset) { warning, error, title, notable, important, standout, normal, normal_reset } #define f_macro_color_set_context_t_clear(set) \ - f_macro_color_set_t_clear(set.warning); \ - f_macro_color_set_t_clear(set.error); \ - f_macro_color_set_t_clear(set.title); \ - f_macro_color_set_t_clear(set.notable); \ - f_macro_color_set_t_clear(set.important); \ - f_macro_color_set_t_clear(set.standout); \ - f_macro_color_set_t_clear(set.normal); \ - f_macro_color_set_t_clear(set.normal_reset); + f_macro_color_set_t_clear(set.warning) \ + f_macro_color_set_t_clear(set.error) \ + f_macro_color_set_t_clear(set.title) \ + f_macro_color_set_t_clear(set.notable) \ + f_macro_color_set_t_clear(set.important) \ + f_macro_color_set_t_clear(set.standout) \ + f_macro_color_set_t_clear(set.normal) \ + f_macro_color_set_t_clear(set.normal_reset) #endif // _di_f_color_set_context_t_ @@ -405,76 +405,52 @@ extern "C" { #define f_color_context_t_initialize { f_color_t_initialize_linux, f_color_format_t_initialize_linux, f_color_mode_none, f_color_set_context_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } #define f_macro_color_context_t_clear(context) \ - f_macro_color_t_clear(context.list); \ - f_macro_color_format_t_clear(context.format); \ + f_macro_color_t_clear(context.list) \ + f_macro_color_format_t_clear(context.format) \ context.mode = f_color_mode_none; \ - f_macro_color_set_context_t_clear(context.set); \ - f_macro_string_dynamic_t_clear(context.error); \ - f_macro_string_dynamic_t_clear(context.title); \ - f_macro_string_dynamic_t_clear(context.notable); \ - f_macro_string_dynamic_t_clear(context.important); \ - f_macro_string_dynamic_t_clear(context.standout); \ - f_macro_string_dynamic_t_clear(context.normal); \ - f_macro_string_dynamic_t_clear(context.normal_reset); + f_macro_color_set_context_t_clear(context.set) \ + f_macro_string_dynamic_t_clear(context.error) \ + f_macro_string_dynamic_t_clear(context.title) \ + f_macro_string_dynamic_t_clear(context.notable) \ + f_macro_string_dynamic_t_clear(context.important) \ + f_macro_string_dynamic_t_clear(context.standout) \ + f_macro_string_dynamic_t_clear(context.normal) \ + f_macro_string_dynamic_t_clear(context.normal_reset) #define f_macro_color_context_t_new(status, context) \ - f_macro_string_dynamic_t_new(status, context.reset, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.warning, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.error, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.title, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.notable, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.important, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.standout, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.normal, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.normal_reset, f_color_max_size + 1); - - #define f_macro_color_context_t_delete(status, context) \ - f_macro_string_dynamic_t_delete(status, context.reset); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.warning); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.error); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.title); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.notable); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.important); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.standout); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.normal); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.normal_reset); \ - if (F_status_is_error_not(status)) f_macro_color_context_t_clear(context); - - #define f_macro_color_context_t_destroy(status, context, size) \ - f_macro_string_dynamic_t_destroy(status, context.reset); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.warning, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.error, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.title, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.notable, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.important, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.standout, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.normal); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.normal_reset); \ - if (F_status_is_error_not(status)) f_macro_color_context_t_clear(context); + f_macro_string_dynamic_t_resize(status, context.reset, f_color_max_size + 1) \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, context.warning, f_color_max_size + 1) \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, context.error, f_color_max_size + 1) \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, context.title, f_color_max_size + 1) \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, context.notable, f_color_max_size + 1) \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, context.important, f_color_max_size + 1) \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, context.standout, f_color_max_size + 1) \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, context.normal, f_color_max_size + 1) \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, context.normal_reset, f_color_max_size + 1) #define f_macro_color_context_t_delete_simple(context) \ - f_macro_string_dynamic_t_delete_simple(context.reset); \ - f_macro_string_dynamic_t_delete_simple(context.warning); \ - f_macro_string_dynamic_t_delete_simple(context.error); \ - f_macro_string_dynamic_t_delete_simple(context.title); \ - f_macro_string_dynamic_t_delete_simple(context.notable); \ - f_macro_string_dynamic_t_delete_simple(context.important); \ - f_macro_string_dynamic_t_delete_simple(context.standout); \ - f_macro_string_dynamic_t_delete_simple(context.normal); \ - f_macro_string_dynamic_t_delete_simple(context.normal_reset); \ - f_macro_color_context_t_clear(context); + f_macro_string_dynamic_t_delete_simple(context.reset) \ + f_macro_string_dynamic_t_delete_simple(context.warning) \ + f_macro_string_dynamic_t_delete_simple(context.error) \ + f_macro_string_dynamic_t_delete_simple(context.title) \ + f_macro_string_dynamic_t_delete_simple(context.notable) \ + f_macro_string_dynamic_t_delete_simple(context.important) \ + f_macro_string_dynamic_t_delete_simple(context.standout) \ + f_macro_string_dynamic_t_delete_simple(context.normal) \ + f_macro_string_dynamic_t_delete_simple(context.normal_reset) \ + f_macro_color_context_t_clear(context) #define f_macro_color_context_t_destroy_simple(context, size) \ - f_macro_string_dynamic_t_destroy_simple(context.reset); \ - f_macro_string_dynamic_t_destroy_simple(context.warning, size); \ - f_macro_string_dynamic_t_destroy_simple(context.error, size); \ - f_macro_string_dynamic_t_destroy_simple(context.title, size); \ - f_macro_string_dynamic_t_destroy_simple(context.notable, size); \ - f_macro_string_dynamic_t_destroy_simple(context.important, size); \ - f_macro_string_dynamic_t_destroy_simple(context.standout, size); \ - f_macro_string_dynamic_t_destroy_simple(context.normal); \ - f_macro_string_dynamic_t_destroy_simple(context.normal_reset); \ - f_macro_color_context_t_clear(context); + f_macro_string_dynamic_t_destroy_simple(context.reset) \ + f_macro_string_dynamic_t_destroy_simple(context.warning, size) \ + f_macro_string_dynamic_t_destroy_simple(context.error, size) \ + f_macro_string_dynamic_t_destroy_simple(context.title, size) \ + f_macro_string_dynamic_t_destroy_simple(context.notable, size) \ + f_macro_string_dynamic_t_destroy_simple(context.important, size) \ + f_macro_string_dynamic_t_destroy_simple(context.standout, size) \ + f_macro_string_dynamic_t_destroy_simple(context.normal) \ + f_macro_string_dynamic_t_destroy_simple(context.normal_reset) \ + f_macro_color_context_t_clear(context) #endif // _di_fl_color_context_t_ #ifdef __cplusplus diff --git a/level_0/f_console/c/console.c b/level_0/f_console/c/console.c index 3b006e7..d271fee 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -166,7 +166,7 @@ extern "C" { status = f_utf_char_to_character(arguments.argv[location] + sub_location, width_max, &character_argument_utf); - if (status != F_none) { + if (F_status_is_error(status)) { f_macro_string_lengths_t_delete_simple(needs_value); return status; } @@ -175,7 +175,7 @@ extern "C" { status = f_utf_char_to_character((f_string_t) parameters.parameter[i].symbol_short, width_max, &character_console_utf); - if (status != F_none) { + if (F_status_is_error(status)) { f_macro_string_lengths_t_delete_simple(needs_value); return status; } diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index d09d102..1d1e7f1 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -15,9 +15,9 @@ // fll-0 includes #include -#include #include #include +#include #include #include diff --git a/level_0/f_console/data/build/dependencies b/level_0/f_console/data/build/dependencies index deb9037..be7c275 100644 --- a/level_0/f_console/data/build/dependencies +++ b/level_0/f_console/data/build/dependencies @@ -3,5 +3,6 @@ f_type f_status f_memory +f_type_array f_string f_utf diff --git a/level_0/f_console/data/build/settings b/level_0/f_console/data/build/settings index 4dbf60e..b1827bf 100644 --- a/level_0/f_console/data/build/settings +++ b/level_0/f_console/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lf_memory -lf_string -lf_utf +build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf build_sources_library console.c console-common.c build_sources_program build_sources_headers console.h console-common.h diff --git a/level_0/f_control_group/c/control_group-common.h b/level_0/f_control_group/c/control_group-common.h index b21933c..3c0e390 100644 --- a/level_0/f_control_group/c/control_group-common.h +++ b/level_0/f_control_group/c/control_group-common.h @@ -57,14 +57,6 @@ extern "C" { f_macro_string_dynamic_t_clear(control.path); \ f_macro_string_dynamics_t_clear(control.groups); - #define f_macro_control_group_t_delete(status, control) \ - f_macro_string_dynamic_t_delete(status, control.path); \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, control.groups); - - #define f_macro_control_group_t_destroy(status, control) \ - f_macro_string_dynamic_t_destroy(status, control.path); \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_destroy(status, control.groups); - #define f_macro_control_group_t_delete_simple(control) \ f_macro_string_dynamic_t_delete_simple(control.path); \ f_macro_string_dynamics_t_delete_simple(control.groups); diff --git a/level_0/f_directory/c/directory.c b/level_0/f_directory/c/directory.c index a4d5d64..8234df6 100644 --- a/level_0/f_directory/c/directory.c +++ b/level_0/f_directory/c/directory.c @@ -145,8 +145,8 @@ extern "C" { size = strnlen(listing[i]->d_name, f_directory_name_max); // There is no reason to include "." and ".." in the directory listing. - if (!strncmp(listing[i]->d_name, "..", 3) == 0 || strncmp(listing[i]->d_name, ".", 2)) { - f_memory_delete((void **) & listing[i], sizeof(char *), 1); + if (!strncmp(listing[i]->d_name, "..", 3) || !strncmp(listing[i]->d_name, ".", 2)) { + f_memory_delete((void **) & listing[i], sizeof(char *), size); continue; } @@ -155,18 +155,18 @@ extern "C" { if (F_status_is_error(status)) break; } - f_macro_string_dynamic_t_new(status, names->array[names->used], size); + f_macro_string_dynamic_t_clear(names->array[names->used]) + f_macro_string_dynamic_t_resize(status, names->array[names->used], size); if (F_status_is_error(status)) break; memcpy(names->array[names->used].string, listing[i]->d_name, size); - names->array[names->used].used = size; - names->used++; + names->array[names->used++].used = size; - f_memory_delete((void **) & listing[i], sizeof(char *), 1); + f_memory_delete((void **) & listing[i], sizeof(char *), size); } // for for (; i < length; i++) { - f_memory_delete((void **) & listing[i], sizeof(char *), 1); + f_memory_delete((void **) & listing[i], sizeof(char *), size); } // for f_memory_delete((void **) & listing, sizeof(struct dirent *), 1); diff --git a/level_0/f_directory/c/directory_type.h b/level_0/f_directory/c/directory_type.h index 32c6ea4..12e6e88 100644 --- a/level_0/f_directory/c/directory_type.h +++ b/level_0/f_directory/c/directory_type.h @@ -48,26 +48,6 @@ extern "C" { f_string_dynamics_t_initialize, \ } - #define f_macro_directory_listing_t_delete(status, listing) \ - f_macro_string_dynamics_t_delete(status, listing.block) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, listing.character) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, listing.directory) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, listing.regular) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, listing.link) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, listing.fifo) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, listing.socket) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, listing.unknown) - - #define f_macro_directory_listing_t_destroy(status, listing) \ - f_macro_string_dynamics_t_destroy(status, listing.block) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_destroy(status, listing.character) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_destroy(status, listing.directory) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_destroy(status, listing.regular) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_destroy(status, listing.link) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_destroy(status, listing.fifo) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_destroy(status, listing.socket) \ - if (F_status_is_error_not(status)) f_macro_string_dynamics_t_delete(status, listing.unknown) - #define f_macro_directory_listing_t_delete_simple(listing) \ f_macro_string_dynamics_t_delete_simple(listing.block) \ f_macro_string_dynamics_t_delete_simple(listing.character) \ @@ -109,16 +89,16 @@ extern "C" { directory.status = 0; \ f_macro_string_dynamic_t_clear(directory.path); - #define f_macro_directory_status_t_new(status, statuses, length) f_macro_string_dynamic_t_new(status, statuses.path, length) - #define f_macro_directory_status_t_resize(status, statuses, new_length) f_macro_string_dynamic_t_resize(status, statuses.path, new_length) #define f_macro_directory_status_t_adjust(status, statuses, new_length) f_macro_string_dynamic_t_adjust(status, statuses.path, new_length) - #define f_macro_directory_status_t_delete(status, statuses) f_macro_string_dynamic_t_delete(status, statuses.path) - #define f_macro_directory_status_t_destroy(status, statuses) f_macro_string_dynamic_t_destroy(status, statuses.path) - #define f_macro_directory_status_t_delete_simple(statuses) f_macro_string_dynamic_t_delete_simple(statuses.path) #define f_macro_directory_status_t_destroy_simple(statuses) f_macro_string_dynamic_t_destroy_simple(statuses.path) + + #define f_macro_directory_status_t_increase(status, values) f_macro_string_dynamic_t_increase(status, values) + #define f_macro_directory_status_t_increase_by(status, values, amount) f_macro_string_dynamic_t_increase_by(status, values, amount) + #define f_macro_directory_status_t_decrease_by(status, values, amount) f_macro_string_dynamic_t_decrease_by(status, values, amount) + #define f_macro_directory_status_t_decimate_by(status, values, amount) f_macro_string_dynamic_t_decimate_by(status, values, amount) #endif // _di_f_directory_status_t_ /** @@ -139,14 +119,12 @@ extern "C" { #define f_macro_directory_statuss_t_clear(structures) f_macro_memory_structures_clear(structures) - #define f_macro_directory_statuss_t_new(status, structures, length) f_macro_memory_structures_new(status, structures, f_directory_status_t, length) - #define f_macro_directory_statuss_t_resize(status, structures, new_length) \ status = F_none; \ if (new_length < structures.size) { \ for (register f_array_length_t _macro__i = structures.size - new_length; _macro__i < structures.size; ++_macro__i) { \ - f_macro_directory_status_t_delete(status, structures.array[_macro__i]); \ - if (status != F_none) break; \ + f_macro_directory_status_t_resize(status, structures.array[_macro__i], 0); \ + if (F_status_is_error(status)) break; \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(f_directory_status_t), structures.size, new_length); \ @@ -159,8 +137,8 @@ extern "C" { status = F_none; \ if (new_length < structures.size) { \ for (register f_array_length_t _macro__i = structures.size - new_length; _macro__i < structures.size; ++_macro__i) { \ - f_macro_directory_status_t_destroy(status, structures.array[_macro__i]); \ - if (status != F_none) break; \ + f_macro_directory_status_t_adjust(status, structures.array[_macro__i], 0); \ + if (F_status_is_error(status)) break; \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(f_directory_status_t), structures.size, new_length); \ @@ -169,36 +147,14 @@ extern "C" { if (structures.used > structures.size) structures.used = new_length; \ } - #define f_macro_directory_statuss_t_delete(status, structures) \ - status = F_none; \ - structures.used = structures.size; \ - while (structures.used > 0) { \ - structures.used--; \ - f_macro_directory_status_t_delete(status, structures.array[structures.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_delete((void **) & structures.array, sizeof(f_directory_status_t), structures.size); \ - if (status == F_none) structures.size = 0; - - #define f_macro_directory_statuss_t_destroy(status, structures) \ - status = F_none; \ - structures.used = structures.size; \ - while (structures.used > 0) { \ - structures.used--; \ - f_macro_directory_status_t_destroy(status, structures.array[structures.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_destroy((void **) & structures.array, sizeof(f_directory_status_t), structures.size); \ - if (status == F_none) structures.size = 0; - #define f_macro_directory_statuss_t_delete_simple(structures) \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ f_macro_directory_status_t_delete_simple(structures.array[structures.used]); \ } \ - if (!structures.used) { \ - if (f_memory_delete((void **) & structures.array, sizeof(f_directory_status_t), structures.size)) { \ + if (!structures.size) { \ + if (f_memory_resize((void **) & structures.array, sizeof(f_directory_status_t), structures.size, 0)) { \ structures.size = 0; \ } \ } @@ -209,8 +165,8 @@ extern "C" { structures.used--; \ f_macro_directory_status_t_destroy_simple(structures.array[structures.used]); \ } \ - if (!structures.used) { \ - if (f_memory_destroy((void **) & structures.array, sizeof(f_directory_status_t), structures.size)) { \ + if (!structures.size) { \ + if (f_memory_adjust((void **) & structures.array, sizeof(f_directory_status_t), structures.size, 0)) { \ structures.size = 0; \ } \ } diff --git a/level_0/f_fss/c/fss-common.h b/level_0/f_fss/c/fss-common.h index 3444d2b..586c2fc 100644 --- a/level_0/f_fss/c/fss-common.h +++ b/level_0/f_fss/c/fss-common.h @@ -184,21 +184,16 @@ extern "C" { #define f_macro_fss_headers_t_clear(headers) f_macro_memory_structure_clear(headers) - #define f_macro_fss_headers_t_new(status, headers, length) f_macro_memory_structure_new(status, headers, f_fss_header_t, length); + #define f_macro_fss_headers_t_resize(status, headers, length) f_macro_memory_structure_resize(status, headers, f_fss_header_t, length) + #define f_macro_fss_headers_t_adjust(status, headers, length) f_macro_memory_structure_adjust(status, headers, f_fss_header_t, length) - #define f_macro_fss_headers_t_resize(status, headers, length) f_macro_memory_structure_resize(status, headers, f_fss_header_t, length); - #define f_macro_fss_headers_t_adjust(status, headers, length) f_macro_memory_structure_adjust(status, headers, f_fss_header_t, length); + #define f_macro_fss_headers_t_delete_simple(headers) f_macro_memory_structure_delete_simple(headers, f_fss_header_t) + #define f_macro_fss_headers_t_destroy_simple(headers) f_macro_memory_structure_destroy_simple(headers, f_fss_header_t) - #define f_macro_fss_headers_t_delete(status, headers) f_macro_memory_structure_delete(status, headers, f_fss_header_t); - #define f_macro_fss_headers_t_destroy(status, headers) f_macro_memory_structure_destroy(status, headers, f_fss_header_t); - - #define f_macro_fss_headers_t_delete_simple(headers) f_macro_memory_structure_delete_simple(headers, f_fss_header_t); - #define f_macro_fss_headers_t_destroy_simple(headers) f_macro_memory_structure_destroy_simple(headers, f_fss_header_t); - - #define f_macro_fss_headers_t_increase(status, headers) f_macro_memory_structure_increase(status, headers, f_fss_header_t); - #define f_macro_fss_headers_t_increase_by(status, headers, amount) f_macro_memory_structure_increase_by(status, headers, f_fss_header_t, amount); - #define f_macro_fss_headers_t_decrease_by(status, headers, amount) f_macro_memory_structure_decrease_by(status, headers, f_fss_header_t, amount); - #define f_macro_fss_headers_t_decimate_by(status, headers, amount) f_macro_memory_structure_decimate_by(status, headers, f_fss_header_t, amount); + #define f_macro_fss_headers_t_increase(status, headers) f_macro_memory_structure_increase(status, headers, f_fss_header_t) + #define f_macro_fss_headers_t_increase_by(status, headers, amount) f_macro_memory_structure_increase_by(status, headers, f_fss_header_t, amount) + #define f_macro_fss_headers_t_decrease_by(status, headers, amount) f_macro_memory_structure_decrease_by(status, headers, f_fss_header_t, amount) + #define f_macro_fss_headers_t_decimate_by(status, headers, amount) f_macro_memory_structure_decimate_by(status, headers, f_fss_header_t, amount) #endif // _di_f_fss_headers_t_ /** @@ -209,7 +204,7 @@ extern "C" { #define f_fss_object_t_initialize f_string_range_t_initialize - #define f_macro_fss_object_t_clear(object) f_macro_string_range_t_clear(object); + #define f_macro_fss_object_t_clear(object) f_macro_string_range_t_clear(object) #endif // _di_fss_object_t_ /** @@ -224,23 +219,18 @@ extern "C" { #define f_fss_objects_t_initialize f_string_ranges_t_initialize - #define f_macro_fss_objects_t_clear(objects) f_macro_string_ranges_t_clear(objects); - - #define f_macro_fss_objects_t_new(status, objects, length) f_macro_string_ranges_t_new(status, objects, length); - - #define f_macro_fss_objects_t_resize(status, objects, length) f_macro_string_ranges_t_resize(status, objects, length); - #define f_macro_fss_objects_t_adjust(status, objects, length) f_macro_string_ranges_t_adjust(status, objects, length); + #define f_macro_fss_objects_t_clear(objects) f_macro_string_ranges_t_clear(objects) - #define f_macro_fss_objects_t_delete(status, objects) f_macro_string_ranges_t_delete(status, objects); - #define f_macro_fss_objects_t_destroy(status, objects) f_macro_string_ranges_t_destroy(status, objects); + #define f_macro_fss_objects_t_resize(status, objects, length) f_macro_string_ranges_t_resize(status, objects, length) + #define f_macro_fss_objects_t_adjust(status, objects, length) f_macro_string_ranges_t_adjust(status, objects, length) - #define f_macro_fss_objects_t_delete_simple(objects) f_macro_string_ranges_t_delete_simple(objects); - #define f_macro_fss_objects_t_destroy_simple(objects) f_macro_string_ranges_t_destroy_simple(objects); + #define f_macro_fss_objects_t_delete_simple(objects) f_macro_string_ranges_t_delete_simple(objects) + #define f_macro_fss_objects_t_destroy_simple(objects) f_macro_string_ranges_t_destroy_simple(objects) - #define f_macro_fss_objects_t_increase(status, objects) f_macro_string_ranges_t_increase(status, objects); - #define f_macro_fss_objects_t_increase_by(status, objects, amount) f_macro_string_ranges_t_increase_by(status, objects, amount); - #define f_macro_fss_objects_t_decrease_by(status, objects, amount) f_macro_string_ranges_t_decrease_by(status, objects, amount); - #define f_macro_fss_objects_t_decimate_by(status, objects, amount) f_macro_string_ranges_t_decimate_by(status, objects, amount); + #define f_macro_fss_objects_t_increase(status, objects) f_macro_string_ranges_t_increase(status, objects) + #define f_macro_fss_objects_t_increase_by(status, objects, amount) f_macro_string_ranges_t_increase_by(status, objects, amount) + #define f_macro_fss_objects_t_decrease_by(status, objects, amount) f_macro_string_ranges_t_decrease_by(status, objects, amount) + #define f_macro_fss_objects_t_decimate_by(status, objects, amount) f_macro_string_ranges_t_decimate_by(status, objects, amount) #endif // _di_fss_objects_t_ /** @@ -257,23 +247,18 @@ extern "C" { #define f_fss_content_t_initialize f_string_ranges_t_initialize - #define f_macro_fss_content_t_clear(content) f_macro_string_ranges_t_clear(content); + #define f_macro_fss_content_t_clear(content) f_macro_string_ranges_t_clear(content) - #define f_macro_fss_content_t_new(status, content, length) f_macro_string_ranges_t_new(status, content, length); + #define f_macro_fss_content_t_resize(status, content, length) f_macro_string_ranges_t_resize(status, content, length) + #define f_macro_fss_content_t_adjust(status, content, length) f_macro_string_ranges_t_adjust(status, content, length) - #define f_macro_fss_content_t_resize(status, content, length) f_macro_string_ranges_t_resize(status, content, length); - #define f_macro_fss_content_t_adjust(status, content, length) f_macro_string_ranges_t_adjust(status, content, length); + #define f_macro_fss_content_t_delete_simple(content) f_macro_string_ranges_t_delete_simple(content) + #define f_macro_fss_content_t_destroy_simple(content) f_macro_string_ranges_t_destroy_simple(content) - #define f_macro_fss_content_t_delete(status, content) f_macro_string_ranges_t_delete(status, content); - #define f_macro_fss_content_t_destroy(status, content) f_macro_string_ranges_t_destroy(status, content); - - #define f_macro_fss_content_t_delete_simple(content) f_macro_string_ranges_t_delete_simple(content); - #define f_macro_fss_content_t_destroy_simple(content) f_macro_string_ranges_t_destroy_simple(content); - - #define f_macro_fss_content_t_increase(status, content) f_macro_string_ranges_t_increase(status, content); - #define f_macro_fss_content_t_increase_by(status, content, amount) f_macro_string_ranges_t_increase_by(status, content, amount); - #define f_macro_fss_content_t_decrease_by(status, content, amount) f_macro_string_ranges_t_decrease_by(status, content, amount); - #define f_macro_fss_content_t_decimate_by(status, content, amount) f_macro_string_ranges_t_decimate_by(status, content, amount); + #define f_macro_fss_content_t_increase(status, content) f_macro_string_ranges_t_increase(status, content) + #define f_macro_fss_content_t_increase_by(status, content, amount) f_macro_string_ranges_t_increase_by(status, content, amount) + #define f_macro_fss_content_t_decrease_by(status, content, amount) f_macro_string_ranges_t_decrease_by(status, content, amount) + #define f_macro_fss_content_t_decimate_by(status, content, amount) f_macro_string_ranges_t_decimate_by(status, content, amount) #endif // _di_fss_content_ /** @@ -288,23 +273,18 @@ extern "C" { #define f_fss_contents_t_initialize f_string_rangess_t_initialize - #define f_macro_fss_contents_t_clear(contents) f_macro_string_rangess_t_clear(contents); - - #define f_macro_fss_contents_t_new(status, contents, length) f_macro_string_rangess_t_new(status, contents, length); - - #define f_macro_fss_contents_t_resize(status, contents, length) f_macro_string_rangess_t_resize(status, contents, length); - #define f_macro_fss_contents_t_adjust(status, contents, length) f_macro_string_rangess_t_adjust(status, contents, length); + #define f_macro_fss_contents_t_clear(contents) f_macro_string_rangess_t_clear(contents) - #define f_macro_fss_contents_t_delete(status, contents) f_macro_string_rangess_t_delete(status, contents); - #define f_macro_fss_contents_t_destroy(status, contents) f_macro_string_rangess_t_destroy(status, contents); + #define f_macro_fss_contents_t_resize(status, contents, length) f_macro_string_rangess_t_resize(status, contents, length) + #define f_macro_fss_contents_t_adjust(status, contents, length) f_macro_string_rangess_t_adjust(status, contents, length) - #define f_macro_fss_contents_t_delete_simple(contents) f_macro_string_rangess_t_delete_simple(contents); - #define f_macro_fss_contents_t_destroy_simple(contents) f_macro_string_rangess_t_destroy_simple(contents); + #define f_macro_fss_contents_t_delete_simple(contents) f_macro_string_rangess_t_delete_simple(contents) + #define f_macro_fss_contents_t_destroy_simple(contents) f_macro_string_rangess_t_destroy_simple(contents) - #define f_macro_fss_contents_t_increase(status, contents) f_macro_string_rangess_t_increase(status, contents); - #define f_macro_fss_contents_t_increase_by(status, contents, amount) f_macro_string_rangess_t_increase_by(status, contents, amount); - #define f_macro_fss_contents_t_decrease_by(status, contents, amount) f_macro_string_rangess_t_decrease_by(status, contents, amount); - #define f_macro_fss_contents_t_decimate_by(status, contents, amount) f_macro_string_rangess_t_decimate_by(status, contents, amount); + #define f_macro_fss_contents_t_increase(status, contents) f_macro_string_rangess_t_increase(status, contents) + #define f_macro_fss_contents_t_increase_by(status, contents, amount) f_macro_string_rangess_t_increase_by(status, contents, amount) + #define f_macro_fss_contents_t_decrease_by(status, contents, amount) f_macro_string_rangess_t_decrease_by(status, contents, amount) + #define f_macro_fss_contents_t_decimate_by(status, contents, amount) f_macro_string_rangess_t_decimate_by(status, contents, amount) #endif // _di_f_fss_contents_t_ #ifdef __cplusplus diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 786520e..819202e 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -17,9 +17,9 @@ // fll-0 includes #include -#include #include #include +#include #include #include diff --git a/level_0/f_fss/c/fss_comment.h b/level_0/f_fss/c/fss_comment.h index e36af56..71124b7 100644 --- a/level_0/f_fss/c/fss_comment.h +++ b/level_0/f_fss/c/fss_comment.h @@ -35,21 +35,18 @@ extern "C" { #define f_fss_comments_t_initialize f_string_ranges_t_initialize - #define f_macro_fss_comments_t_new(status, ranges, length) f_macro_string_ranges_t_new(status, ranges, length); + #define f_fss_comments_t_clear(comments) f_macro_string_ranges_t_clear(comments) - #define f_macro_fss_comments_t_resize(status, ranges, length) f_macro_string_ranges_t_resize(status, ranges, length); - #define f_macro_fss_comments_t_adjust(status, ranges, length) f_macro_string_ranges_t_adjust(status, ranges, length); + #define f_macro_fss_comments_t_resize(status, comments, length) f_macro_string_ranges_t_resize(status, comments, length) + #define f_macro_fss_comments_t_adjust(status, comments, length) f_macro_string_ranges_t_adjust(status, comments, length) - #define f_macro_fss_comments_t_delete(status, ranges) f_macro_string_ranges_t_delete(status, ranges); - #define f_macro_fss_comments_t_destroy(status, ranges) f_macro_string_ranges_t_destroy(status, ranges); + #define f_macro_fss_comments_t_delete_simple(comments) f_macro_string_ranges_t_delete_simple(comments) + #define f_macro_fss_comments_t_destroy_simple(comments) f_macro_string_ranges_t_destroy_simple(comments) - #define f_macro_fss_comments_t_delete_simple(ranges) f_macro_string_ranges_t_delete_simple(ranges); - #define f_macro_fss_comments_t_destroy_simple(ranges) f_macro_string_ranges_t_destroy_simple(ranges); - - #define f_macro_fss_comments_t_increase(status, ranges) f_macro_string_ranges_t_increase(status, ranges); - #define f_macro_fss_comments_t_increase_by(status, ranges, amount) f_macro_string_ranges_t_increase_by(status, ranges, amount); - #define f_macro_fss_comments_t_decrease_by(status, ranges, amount) f_macro_string_ranges_t_decrease_by(status, ranges, amount); - #define f_macro_fss_comments_t_decimate_by(status, ranges, amount) f_macro_string_ranges_t_decimate_by(status, ranges, amount); + #define f_macro_fss_comments_t_increase(status, comments) f_macro_string_ranges_t_increase(status, comments) + #define f_macro_fss_comments_t_increase_by(status, comments, amount) f_macro_string_ranges_t_increase_by(status, comments, amount) + #define f_macro_fss_comments_t_decrease_by(status, comments, amount) f_macro_string_ranges_t_decrease_by(status, comments, amount) + #define f_macro_fss_comments_t_decimate_by(status, comments, amount) f_macro_string_ranges_t_decimate_by(status, comments, amount) #endif // _di_f_fss_comments_t_ /** @@ -64,23 +61,18 @@ extern "C" { #define f_fss_commentss_t_initialize f_string_rangess_t_initialize - #define f_macro_fss_commentss_t_clear(quotess) f_macro_string_rangess_t_clear(quotess); - - #define f_macro_fss_commentss_t_new(status, quotess, length) f_macro_string_rangess_t_new(status, quotess, length); - - #define f_macro_fss_commentss_t_resize(status, quotess, length) f_macro_string_rangess_t_resize(status, quotess, length); - #define f_macro_fss_commentss_t_adjust(status, quotess, length) f_macro_string_rangess_t_adjust(status, quotess, length); + #define f_macro_fss_commentss_t_clear(commentss) f_macro_string_rangess_t_clear(commentss) - #define f_macro_fss_commentss_t_delete(status, quotess) f_macro_string_rangess_t_delete(status, quotess); - #define f_macro_fss_commentss_t_destroy(status, quotess) f_macro_string_rangess_t_destroy(status, quotess); + #define f_macro_fss_commentss_t_resize(status, commentss, length) f_macro_string_rangess_t_resize(status, commentss, length) + #define f_macro_fss_commentss_t_adjust(status, commentss, length) f_macro_string_rangess_t_adjust(status, commentss, length) - #define f_macro_fss_commentss_t_delete_simple(quotess) f_macro_string_rangess_t_delete_simple(quotess); - #define f_macro_fss_commentss_t_destroy_simple(quotess) f_macro_string_rangess_t_destroy_simple(quotess); + #define f_macro_fss_commentss_t_delete_simple(commentss) f_macro_string_rangess_t_delete_simple(commentss) + #define f_macro_fss_commentss_t_destroy_simple(commentss) f_macro_string_rangess_t_destroy_simple(commentss) - #define f_macro_fss_commentss_t_increase(status, rangess) f_macro_string_rangess_t_increase(status, rangess); - #define f_macro_fss_commentss_t_increase_by(status, rangess, amount) f_macro_string_rangess_t_increase_by(status, rangess, amount); - #define f_macro_fss_commentss_t_decrease_by(status, rangess, amount) f_macro_string_rangess_t_decrease_by(status, rangess, amount); - #define f_macro_fss_commentss_t_decimate_by(status, rangess, amount) f_macro_string_rangess_t_decimate_by(status, rangess, amount); + #define f_macro_fss_commentss_t_increase(status, commentss) f_macro_string_rangess_t_increase(status, commentss) + #define f_macro_fss_commentss_t_increase_by(status, commentss, amount) f_macro_string_rangess_t_increase_by(status, commentss, amount) + #define f_macro_fss_commentss_t_decrease_by(status, commentss, amount) f_macro_string_rangess_t_decrease_by(status, commentss, amount) + #define f_macro_fss_commentss_t_decimate_by(status, commentss, amount) f_macro_string_rangess_t_decimate_by(status, commentss, amount) #endif // _di_f_fss_commentss_t_ #ifdef __cplusplus diff --git a/level_0/f_fss/c/fss_delimit.h b/level_0/f_fss/c/fss_delimit.h index f68a24d..fc1eb8b 100644 --- a/level_0/f_fss/c/fss_delimit.h +++ b/level_0/f_fss/c/fss_delimit.h @@ -35,21 +35,18 @@ extern "C" { #define f_fss_delimits_t_initialize f_string_lengths_t_initialize - #define f_macro_fss_delimits_t_new(status, lengths, length) f_macro_string_lengths_t_new(status, lengths, length); + #define f_macro_fss_delimits_t_clear(delimits) f_macro_string_lengths_t_clear(delimits) - #define f_macro_fss_delimits_t_resize(status, lengths, length) f_macro_string_lengths_t_resize(status, lengths, length); - #define f_macro_fss_delimits_t_adjust(status, lengths, length) f_macro_string_lengths_t_adjust(status, lengths, length); + #define f_macro_fss_delimits_t_resize(status, delimits, length) f_macro_string_lengths_t_resize(status, delimits, length) + #define f_macro_fss_delimits_t_adjust(status, delimits, length) f_macro_string_lengths_t_adjust(status, delimits, length) - #define f_macro_fss_delimits_t_delete(status, lengths) f_macro_string_lengths_t_delete(status, lengths); - #define f_macro_fss_delimits_t_destroy(status, lengths) f_macro_string_lengths_t_destroy(status, lengths); + #define f_macro_fss_delimits_t_delete_simple(delimits) f_macro_string_lengths_t_delete_simple(delimits) + #define f_macro_fss_delimits_t_destroy_simple(delimits) f_macro_string_lengths_t_destroy_simple(delimits) - #define f_macro_fss_delimits_t_delete_simple(lengths) f_macro_string_lengths_t_delete_simple(lengths); - #define f_macro_fss_delimits_t_destroy_simple(lengths) f_macro_string_lengths_t_destroy_simple(lengths); - - #define f_macro_fss_delimits_t_increase(status, lengths) f_macro_string_lengths_t_increase(status, lengths); - #define f_macro_fss_delimits_t_increase_by(status, lengths, amount) f_macro_string_lengths_t_increase_by(status, lengths, amount); - #define f_macro_fss_delimits_t_decrease_by(status, lengths, amount) f_macro_string_lengths_t_decrease_by(status, lengths, amount); - #define f_macro_fss_delimits_t_decimate_by(status, lengths, amount) f_macro_string_lengths_t_decimate_by(status, lengths, amount); + #define f_macro_fss_delimits_t_increase(status, delimits) f_macro_string_lengths_t_increase(status, delimits) + #define f_macro_fss_delimits_t_increase_by(status, delimits, amount) f_macro_string_lengths_t_increase_by(status, delimits, amount) + #define f_macro_fss_delimits_t_decrease_by(status, delimits, amount) f_macro_string_lengths_t_decrease_by(status, delimits, amount) + #define f_macro_fss_delimits_t_decimate_by(status, delimits, amount) f_macro_string_lengths_t_decimate_by(status, delimits, amount) #endif // _di_f_fss_delimits_t_ /** @@ -64,23 +61,18 @@ extern "C" { #define f_fss_delimitss_t_initialize f_string_lengthss_t_initialize - #define f_macro_fss_delimitss_t_clear(delimitss) f_macro_string_lengthss_t_clear(delimitss); - - #define f_macro_fss_delimitss_t_new(status, delimitss, length) f_macro_string_lengthss_t_new(status, delimitss, length); - - #define f_macro_fss_delimitss_t_resize(status, delimitss, length) f_macro_string_lengthss_t_resize(status, delimitss, length); - #define f_macro_fss_delimitss_t_adjust(status, delimitss, length) f_macro_string_lengthss_t_adjust(status, delimitss, length); + #define f_macro_fss_delimitss_t_clear(delimitss) f_macro_string_lengthss_t_clear(delimitss) - #define f_macro_fss_delimitss_t_delete(status, delimitss) f_macro_string_lengthss_t_delete(status, delimitss); - #define f_macro_fss_delimitss_t_destroy(status, delimitss) f_macro_string_lengthss_t_destroy(status, delimitss); + #define f_macro_fss_delimitss_t_resize(status, delimitss, length) f_macro_string_lengthss_t_resize(status, delimitss, length) + #define f_macro_fss_delimitss_t_adjust(status, delimitss, length) f_macro_string_lengthss_t_adjust(status, delimitss, length) - #define f_macro_fss_delimitss_t_delete_simple(delimitss) f_macro_string_lengthss_t_delete_simple(delimitss); - #define f_macro_fss_delimitss_t_destroy_simple(delimitss) f_macro_string_lengthss_t_destroy_simple(delimitss); + #define f_macro_fss_delimitss_t_delete_simple(delimitss) f_macro_string_lengthss_t_delete_simple(delimitss) + #define f_macro_fss_delimitss_t_destroy_simple(delimitss) f_macro_string_lengthss_t_destroy_simple(delimitss) - #define f_macro_fss_delimitss_t_increase(status, lengthss) f_macro_string_lengthss_t_increase(status, lengthss); - #define f_macro_fss_delimitss_t_increase_by(status, lengthss, amount) f_macro_string_lengthss_t_increase_by(status, lengthss, amount); - #define f_macro_fss_delimitss_t_decrease_by(status, lengthss, amount) f_macro_string_lengthss_t_decrease_by(status, lengthss, amount); - #define f_macro_fss_delimitss_t_decimate_by(status, lengthss, amount) f_macro_string_lengthss_t_decimate_by(status, lengthss, amount); + #define f_macro_fss_delimitss_t_increase(status, delimitss) f_macro_string_lengthss_t_increase(status, delimitss) + #define f_macro_fss_delimitss_t_increase_by(status, delimitss, amount) f_macro_string_lengthss_t_increase_by(status, delimitss, amount) + #define f_macro_fss_delimitss_t_decrease_by(status, delimitss, amount) f_macro_string_lengthss_t_decrease_by(status, delimitss, amount) + #define f_macro_fss_delimitss_t_decimate_by(status, delimitss, amount) f_macro_string_lengthss_t_decimate_by(status, delimitss, amount) #endif // _di_f_fss_delimitss_t_ #ifdef __cplusplus diff --git a/level_0/f_fss/c/fss_named.c b/level_0/f_fss/c/fss_named.c index b6a96e2..770cdf6 100644 --- a/level_0/f_fss/c/fss_named.c +++ b/level_0/f_fss/c/fss_named.c @@ -5,6 +5,99 @@ extern "C" { #endif +#ifndef _di_f_fss_named_adjust_ + f_status_t f_fss_named_adjust(const f_string_length_t length, f_fss_named_t *named) { + #ifndef _di_level_0_parameter_checking_ + if (!named) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_fss_named_adjust(length, named); + } +#endif // _di_f_fss_named_adjust_ + +#ifndef _di_f_fss_named_decimate_by_ + f_status_t f_fss_named_decimate_by(const f_array_length_t amount, f_fss_named_t *named) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!named) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (named->objects.size - amount > 0) { + return private_f_fss_named_adjust(named->objects.size - amount, named); + } + + return private_f_fss_named_adjust(0, named); + } +#endif // _di_f_fss_named_decimate_by_ + +#ifndef _di_f_fss_named_decrease_by_ + f_status_t f_fss_named_decrease_by(const f_array_length_t amount, f_fss_named_t *named) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!named) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (named->objects.size - amount > 0) { + return private_f_fss_named_resize(named->objects.size - amount, named); + } + + return private_f_fss_named_resize(0, named); + } +#endif // _di_f_fss_named_decrease_by_ + +#ifndef _di_f_fss_named_increase_ + f_status_t f_fss_named_increase(f_fss_named_t *named) { + #ifndef _di_level_0_parameter_checking_ + if (!named) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (named->objects.used + 1 > named->objects.size) { + f_array_length_t size = named->objects.used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (named->objects.used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_fss_named_resize(size, named); + } + + return F_data_not; + } +#endif // _di_f_fss_named_increase_ + +#ifndef _di_f_fss_named_increase_by_ + f_status_t f_fss_named_increase_by(const f_array_length_t amount, f_fss_named_t *named) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!named) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (named->objects.used + amount > named->objects.size) { + if (named->objects.used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_fss_named_resize(named->objects.used + amount, named); + } + + return F_data_not; + } +#endif // _di_f_fss_named_increase_by_ + +#ifndef _di_f_fss_named_resize_ + f_status_t f_fss_named_resize(const f_string_length_t length, f_fss_named_t *named) { + #ifndef _di_level_0_parameter_checking_ + if (!named) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_fss_named_resize(length, named); + } +#endif // _di_f_fss_named_resize_ + #ifndef _di_f_fss_nameds_adjust_ f_status_t f_fss_nameds_adjust(const f_string_length_t length, f_fss_nameds_t *nameds) { #ifndef _di_level_0_parameter_checking_ @@ -45,26 +138,6 @@ extern "C" { } #endif // _di_f_fss_nameds_decrease_by_ -#ifndef _di_f_fss_nameds_delete_ - f_status_t f_fss_nameds_delete(f_fss_nameds_t *nameds) { - #ifndef _di_level_0_parameter_checking_ - if (!nameds) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_nameds_resize(0, nameds); - } -#endif // _di_f_fss_nameds_delete_ - -#ifndef _di_f_fss_nameds_destroy_ - f_status_t f_fss_nameds_destroy(f_fss_nameds_t *nameds) { - #ifndef _di_level_0_parameter_checking_ - if (!nameds) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_nameds_adjust(0, nameds); - } -#endif // _di_f_fss_nameds_destroy_ - #ifndef _di_f_fss_nameds_increase_ f_status_t f_fss_nameds_increase(f_fss_nameds_t *nameds) { #ifndef _di_level_0_parameter_checking_ @@ -85,7 +158,7 @@ extern "C" { return private_f_fss_nameds_resize(size, nameds); } - return F_none; + return F_data_not; } #endif // _di_f_fss_nameds_increase_ @@ -104,7 +177,7 @@ extern "C" { return private_f_fss_nameds_resize(nameds->used + amount, nameds); } - return F_none; + return F_data_not; } #endif // _di_f_fss_nameds_increase_by_ diff --git a/level_0/f_fss/c/fss_named.h b/level_0/f_fss/c/fss_named.h index ae767d8..060f8a1 100644 --- a/level_0/f_fss/c/fss_named.h +++ b/level_0/f_fss/c/fss_named.h @@ -22,10 +22,10 @@ extern "C" { * The objects, contents, and quotess should each be of the same used and size. * Any deviation to this would require implementing custom equivelents to the standard management macros. * - * object: The name representing this set. - * objects: The array of objects. + * object: The name representing this set. + * objects: The array of objects. * contents: The array of contents. - * quotess: The array of quote for each content. + * quotess: The array of quote for each content. */ #ifndef _di_f_fss_named_t_ typedef struct { @@ -44,16 +44,11 @@ extern "C" { f_macro_fss_contents_t_clear(named.contents) \ f_macro_fss_quotess_t_clear(named.quotess) - #define f_macro_fss_named_t_new(status, named, length) f_macro_memory_structure_new(status, named, f_fss_named_t, length); - #define f_macro_fss_named_t_resize(status, named, length) status = f_fss_named_resize(length, &named); #define f_macro_fss_named_t_adjust(status, named, length) status = f_fss_named_adjust(length, &named); - #define f_macro_fss_named_t_delete(status, named) status = f_fss_named_delete(&named); - #define f_macro_fss_named_t_destroy(status, named) status = f_fss_named_destroy(&named); - - #define f_macro_fss_named_t_delete_simple(named) f_fss_named_delete(&named); - #define f_macro_fss_named_t_destroy_simple(named) f_fss_named_destroy(&named); + #define f_macro_fss_named_t_delete_simple(named) f_fss_named_resize(0, &named); + #define f_macro_fss_named_t_destroy_simple(named) f_fss_named_adjust(0, &named); #define f_macro_fss_named_t_increase(status, named) status = f_fss_named_increase(&named); #define f_macro_fss_named_t_increase_by(status, named, amount) status = f_fss_named_increase_by(amount, &named); @@ -78,28 +73,13 @@ extern "C" { #define f_fss_nameds_t_initialize { 0, 0, 0 } - /** - * Reset a fss content nameds to 0 (clear all values). - * - * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. - * - * nameds: the f_fss_nameds_t structure to operate on. - */ - #define f_macro_fss_nameds_t_clear(nameds) \ - nameds.array = 0; \ - nameds.size = 0; \ - nameds.used = 0; - - #define f_macro_fss_nameds_t_new(status, nameds, length) f_macro_memory_structure_new(status, nameds, f_fss_named_t, length); + #define f_macro_fss_nameds_t_clear(nameds) f_macro_memory_structure_clear(nameds); #define f_macro_fss_nameds_t_resize(status, nameds, length) status = f_fss_nameds_resize(length, &nameds); #define f_macro_fss_nameds_t_adjust(status, nameds, length) status = f_fss_nameds_adjust(length, &nameds); - #define f_macro_fss_nameds_t_delete(status, nameds) status = f_fss_nameds_delete(&nameds); - #define f_macro_fss_nameds_t_destroy(status, nameds) status = f_fss_nameds_destroy(&nameds); - - #define f_macro_fss_nameds_t_delete_simple(nameds) f_fss_nameds_delete(&nameds); - #define f_macro_fss_nameds_t_destroy_simple(nameds) f_fss_nameds_destroy(&nameds); + #define f_macro_fss_nameds_t_delete_simple(nameds) f_fss_nameds_resize(0, &nameds); + #define f_macro_fss_nameds_t_destroy_simple(nameds) f_fss_nameds_adjust(0, &nameds); #define f_macro_fss_nameds_t_increase(status, nameds) status = f_fss_nameds_increase(&nameds); #define f_macro_fss_nameds_t_increase_by(status, nameds, amount) status = f_fss_nameds_increase_by(amount, &nameds); @@ -108,24 +88,25 @@ extern "C" { #endif // _di_fss_nameds_t_ /** - * Resize the named array. + * Resize all parts of the named structure using the same length. * * @param length * The new size to use. - * @param nameds - * The nameds array to resize. + * @param named + * The named structure to adjust. * * @return * F_none 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_fss_nameds_adjust_ - extern f_status_t f_fss_nameds_adjust(const f_array_length_t length, f_fss_nameds_t *nameds); -#endif // _di_f_fss_nameds_adjust_ +#ifndef _di_f_fss_named_adjust_ + extern f_status_t f_fss_named_adjust(const f_array_length_t length, f_fss_named_t *named); +#endif // _di_f_fss_named_adjust_ /** - * Resize the named array to a smaller size. + * Resize all parts of the named structure 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. @@ -133,20 +114,21 @@ extern "C" { * * @param amount * A positive number representing how much to decimate the size by. - * @param nameds - * The nameds array to resize. + * @param named + * The named array to resize. * * @return * F_none 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_fss_nameds_decimate_by_ - extern f_status_t f_fss_nameds_decimate_by(const f_array_length_t amount, f_fss_nameds_t *nameds); -#endif // _di_f_fss_nameds_decimate_by_ +#ifndef _di_f_fss_named_decimate_by_ + extern f_status_t f_fss_named_decimate_by(const f_array_length_t amount, f_fss_named_t *named); +#endif // _di_f_fss_named_decimate_by_ /** - * Resize the named array to a smaller size. + * Resize all parts of the named structure 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. @@ -154,45 +136,143 @@ extern "C" { * * @param amount * A positive number representing how much to decrease the size by. + * @param named + * The named array to resize. + * + * @return + * F_none 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_fss_named_decrease_by_ + extern f_status_t f_fss_named_decrease_by(const f_array_length_t amount, f_fss_named_t *named); +#endif // _di_f_fss_named_decrease_by_ + +/** + * Increase the size of all parts of the named structure, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param named + * The named array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_fss_named_increase_ + extern f_status_t f_fss_named_increase(f_fss_named_t *named); +#endif // _di_f_fss_named_increase_ + +/** + * Resize all parts of the named structure to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 named + * The named array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_fss_named_increase_by_ + extern f_status_t f_fss_named_increase_by(const f_array_length_t amount, f_fss_named_t *named); +#endif // _di_f_fss_named_increase_by_ + +/** + * Resize all parts of the named structure using the same length. + * + * @param length + * The new size to use. + * @param named + * The named structure to resize. + * + * @return + * F_none 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_fss_named_resize_ + extern f_status_t f_fss_named_resize(const f_array_length_t length, f_fss_named_t *named); +#endif // _di_f_fss_named_resize_ + +/** + * Resize the named array. + * + * @param length + * The new size to use. * @param nameds * The nameds array to resize. * * @return * F_none 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_fss_nameds_decrease_by_ - extern f_status_t f_fss_nameds_decrease_by(const f_array_length_t amount, f_fss_nameds_t *nameds); -#endif // _di_f_fss_nameds_decrease_by_ +#ifndef _di_f_fss_nameds_adjust_ + extern f_status_t f_fss_nameds_adjust(const f_array_length_t length, f_fss_nameds_t *nameds); +#endif // _di_f_fss_nameds_adjust_ /** - * Delete the array of named. + * Resize the named 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 ranges - * The ranges to delete. + * @param amount + * A positive number representing how much to decimate the size by. + * @param nameds + * The nameds array to resize. * * @return * F_none 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_fss_nameds_delete_ - extern f_status_t f_fss_nameds_delete(f_fss_nameds_t *ranges); -#endif // _di_f_fss_nameds_delete_ +#ifndef _di_f_fss_nameds_decimate_by_ + extern f_status_t f_fss_nameds_decimate_by(const f_array_length_t amount, f_fss_nameds_t *nameds); +#endif // _di_f_fss_nameds_decimate_by_ /** - * Delete the array of named. + * Resize the named 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 decrease the size by. * @param nameds - * The nameds to destroy. + * The nameds array to resize. * * @return * F_none 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_fss_nameds_destroy_ - extern f_status_t f_fss_nameds_destroy(f_fss_nameds_t *nameds); -#endif // _di_f_fss_nameds_destroy_ +#ifndef _di_f_fss_nameds_decrease_by_ + extern f_status_t f_fss_nameds_decrease_by(const f_array_length_t amount, f_fss_nameds_t *nameds); +#endif // _di_f_fss_nameds_decrease_by_ /** * Increase the size of the nameds array, but only if necessary. @@ -205,6 +285,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -227,6 +309,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -245,6 +329,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ diff --git a/level_0/f_fss/c/fss_nest.c b/level_0/f_fss/c/fss_nest.c index a254435..221cdb9 100644 --- a/level_0/f_fss/c/fss_nest.c +++ b/level_0/f_fss/c/fss_nest.c @@ -5,135 +5,6 @@ extern "C" { #endif -#ifndef _di_f_fss_item_adjust_ - f_status_t f_fss_item_adjust(const f_string_length_t length, f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_item_adjust(length, item); - } -#endif // _di_f_fss_item_adjust_ - -#ifndef _di_f_fss_item_decimate_by_ - f_status_t f_fss_item_decimate_by(const f_array_length_t amount, f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!amount) return F_status_set_error(F_parameter); - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (item->content.size - amount > 0) { - return private_f_fss_item_adjust(item->content.size - amount, item); - } - - return private_f_fss_item_adjust(0, item); - } -#endif // _di_f_fss_item_decimate_by_ - -#ifndef _di_f_fss_item_decrease_by_ - f_status_t f_fss_item_decrease_by(const f_array_length_t amount, f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!amount) return F_status_set_error(F_parameter); - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (item->content.size - amount > 0) { - return private_f_fss_item_resize(item->content.size - amount, item); - } - - return private_f_fss_item_resize(0, item); - } -#endif // _di_f_fss_item_decrease_by_ - -#ifndef _di_f_fss_item_delete_ - f_status_t f_fss_item_delete(f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_item_resize(0, item); - } -#endif // _di_f_fss_item_delete_ - -#ifndef _di_f_fss_item_destroy_ - f_status_t f_fss_item_destroy(f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_item_adjust(0, item); - } -#endif // _di_f_fss_item_destroy_ - -#ifndef _di_f_fss_item_increase_ - f_status_t f_fss_item_increase(f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (item->content.used + 1 > item->content.size) { - f_array_length_t size = item->content.used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (item->content.used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - return private_f_fss_item_resize(size, item); - } - - return F_none; - } -#endif // _di_f_fss_item_increase_ - -#ifndef _di_f_fss_item_increase_by_ - f_status_t f_fss_item_increase_by(const f_array_length_t amount, f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!amount) return F_status_set_error(F_parameter); - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (item->content.used + amount > item->content.size) { - if (item->content.used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - return private_f_fss_item_resize(item->content.used + amount, item); - } - - return F_none; - } -#endif // _di_f_fss_item_increase_by_ - -#ifndef _di_f_fss_item_new_ - f_status_t f_fss_item_new(const f_string_length_t length, f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - f_macro_fss_item_t_clear((*item)); - - f_status_t status = F_none; - - f_macro_memory_structure_new(status, item->content, f_fss_content_t, length); - - return status; - } -#endif // _di_f_fss_item_new_ - -#ifndef _di_f_fss_item_resize_ - f_status_t f_fss_item_resize(const f_string_length_t length, f_fss_item_t *item) { - #ifndef _di_level_0_parameter_checking_ - if (!item) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_item_resize(length, item); - } -#endif // _di_f_fss_item_resize_ - #ifndef _di_f_fss_items_adjust_ f_status_t f_fss_items_adjust(const f_string_length_t length, f_fss_items_t *items) { #ifndef _di_level_0_parameter_checking_ @@ -174,26 +45,6 @@ extern "C" { } #endif // _di_f_fss_items_decrease_by_ -#ifndef _di_f_fss_items_delete_ - f_status_t f_fss_items_delete(f_fss_items_t *items) { - #ifndef _di_level_0_parameter_checking_ - if (!items) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_items_resize(0, items); - } -#endif // _di_f_fss_items_delete_ - -#ifndef _di_f_fss_items_destroy_ - f_status_t f_fss_items_destroy(f_fss_items_t *items) { - #ifndef _di_level_0_parameter_checking_ - if (!items) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_items_adjust(0, items); - } -#endif // _di_f_fss_items_destroy_ - #ifndef _di_f_fss_items_increase_ f_status_t f_fss_items_increase(f_fss_items_t *items) { #ifndef _di_level_0_parameter_checking_ @@ -214,7 +65,7 @@ extern "C" { return private_f_fss_items_resize(size, items); } - return F_none; + return F_data_not; } #endif // _di_f_fss_items_increase_ @@ -233,7 +84,7 @@ extern "C" { return private_f_fss_items_resize(items->used + amount, items); } - return F_none; + return F_data_not; } #endif // _di_f_fss_items_increase_by_ @@ -287,26 +138,6 @@ extern "C" { } #endif // _di_f_fss_nest_decrease_by_ -#ifndef _di_f_fss_nest_delete_ - f_status_t f_fss_nest_delete(f_fss_nest_t *nest) { - #ifndef _di_level_0_parameter_checking_ - if (!nest) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_nest_resize(0, nest); - } -#endif // _di_f_fss_nest_delete_ - -#ifndef _di_f_fss_nest_destroy_ - f_status_t f_fss_nest_destroy(f_fss_nest_t *nest) { - #ifndef _di_level_0_parameter_checking_ - if (!nest) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_nest_adjust(0, nest); - } -#endif // _di_f_fss_nest_destroy_ - #ifndef _di_f_fss_nest_increase_ f_status_t f_fss_nest_increase(f_fss_nest_t *nest) { #ifndef _di_level_0_parameter_checking_ @@ -327,7 +158,7 @@ extern "C" { return private_f_fss_nest_resize(size, nest); } - return F_none; + return F_data_not; } #endif // _di_f_fss_nest_increase_ @@ -346,7 +177,7 @@ extern "C" { return private_f_fss_nest_resize(nest->used + amount, nest); } - return F_none; + return F_data_not; } #endif // _di_f_fss_nest_increase_by_ @@ -400,26 +231,6 @@ extern "C" { } #endif // _di_f_fss_nests_decrease_by_ -#ifndef _di_f_fss_nests_delete_ - f_status_t f_fss_nests_delete(f_fss_nests_t *nests) { - #ifndef _di_level_0_parameter_checking_ - if (!nests) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_nests_resize(0, nests); - } -#endif // _di_f_fss_nests_delete_ - -#ifndef _di_f_fss_nests_destroy_ - f_status_t f_fss_nests_destroy(f_fss_nests_t *nests) { - #ifndef _di_level_0_parameter_checking_ - if (!nests) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_nests_adjust(0, nests); - } -#endif // _di_f_fss_nests_destroy_ - #ifndef _di_f_fss_nests_increase_ f_status_t f_fss_nests_increase(f_fss_nests_t *nests) { #ifndef _di_level_0_parameter_checking_ @@ -440,7 +251,7 @@ extern "C" { return private_f_fss_nests_resize(size, nests); } - return F_none; + return F_data_not; } #endif // _di_f_fss_nests_increase_ @@ -459,7 +270,7 @@ extern "C" { return private_f_fss_nests_resize(nests->used + amount, nests); } - return F_none; + return F_data_not; } #endif // _di_f_fss_nests_increase_by_ diff --git a/level_0/f_fss/c/fss_nest.h b/level_0/f_fss/c/fss_nest.h index 83ac3af..52ba726 100644 --- a/level_0/f_fss/c/fss_nest.h +++ b/level_0/f_fss/c/fss_nest.h @@ -42,26 +42,20 @@ extern "C" { #define f_fss_item_t_initialize { f_fss_object_t_initialize, f_fss_content_t_initialize, 0 } #define f_macro_fss_item_t_clear(item) \ - item.object.start = 1; \ - item.object.stop = 0; \ + f_macro_fss_object_t_clear(item.object); \ f_macro_fss_content_t_clear(item.content); \ item.parent = 0; - #define f_macro_fss_item_t_new(status, item, length) status = f_fss_item_new(length, &item); + #define f_macro_fss_item_t_resize(status, item, length) f_macro_fss_content_t_resize(status, item.content, length) + #define f_macro_fss_item_t_adjust(status, item, length) f_macro_fss_content_t_adjust(status, item.content, length) - #define f_macro_fss_item_t_resize(status, item, length) status = f_fss_item_resize(length, &item); - #define f_macro_fss_item_t_adjust(status, item, length) status = f_fss_item_adjust(length, &item); + #define f_macro_fss_item_t_delete_simple(item) f_macro_fss_content_t_delete_simple(item.content) + #define f_macro_fss_item_t_destroy_simple(item) f_macro_fss_content_t_destroy_simple(item.content) - #define f_macro_fss_item_t_delete(status, item) status = f_fss_item_delete(&item); - #define f_macro_fss_item_t_destroy(status, item) status = f_fss_item_destroy(&item); - - #define f_macro_fss_item_t_delete_simple(item) f_fss_item_delete(&item); - #define f_macro_fss_item_t_destroy_simple(item) f_fss_item_destroy(&item); - - #define f_macro_fss_item_t_increase(status, item) status = f_fss_item_increase(&item); - #define f_macro_fss_item_t_increase_by(status, item, amount) status = f_fss_item_increase_by(amount, &item); - #define f_macro_fss_item_t_decrease_by(status, item, amount) status = f_fss_item_decrease_by(amount, &item); - #define f_macro_fss_item_t_decimate_by(status, item, amount) status = f_fss_item_decimate_by(amount, &item); + #define f_macro_fss_item_t_increase(status, item) f_macro_fss_content_t_increase(status, item.content) + #define f_macro_fss_item_t_increase_by(status, item, amount) f_macro_fss_content_t_increase_by(status, item.content, amount) + #define f_macro_fss_item_t_decrease_by(status, item, amount) f_macro_fss_content_t_decrease_by(status, item.content, amount) + #define f_macro_fss_item_t_decimate_by(status, item, amount) f_macro_fss_content_t_decimate_by(status, item.content, amount) #endif // _di_fss_item_t_ /** @@ -102,21 +96,13 @@ extern "C" { #define f_fss_items_t_initialize { 0, 0, 0 } - #define f_macro_fss_items_t_clear(items) \ - items.array = 0; \ - items.size = 0; \ - items.used = 0; - - #define f_macro_fss_items_t_new(status, items, length) f_macro_memory_structure_new(status, items, f_fss_items_t, length); + #define f_macro_fss_items_t_clear(items) f_macro_memory_structure_clear(items) #define f_macro_fss_items_t_resize(status, items, length) status = f_fss_items_resize(length, &items); #define f_macro_fss_items_t_adjust(status, items, length) status = f_fss_items_adjust(length, &items); - #define f_macro_fss_items_t_delete(status, items) status = f_fss_items_delete(&items); - #define f_macro_fss_items_t_destroy(status, items) status = f_fss_items_destroy(&items); - - #define f_macro_fss_items_t_delete_simple(items) f_fss_items_delete(&items); - #define f_macro_fss_items_t_destroy_simple(items) f_fss_items_destroy(&items); + #define f_macro_fss_items_t_delete_simple(items) f_fss_items_resize(0, &items); + #define f_macro_fss_items_t_destroy_simple(items) f_fss_items_adjust(0, &items); #define f_macro_fss_items_t_increase(status, items) status = f_fss_items_increase(&items); #define f_macro_fss_items_t_increase_by(status, items, amount) status = f_fss_items_increase_by(amount, &items); @@ -146,21 +132,13 @@ extern "C" { #define f_fss_nest_t_initialize { 0, 0, 0 } - #define f_macro_fss_nest_t_clear(nest) \ - nest.depth = 0; \ - nest.size = 0; \ - nest.used = 0; - - #define f_macro_fss_nest_t_new(status, nest, length) f_macro_memory_structure_new(status, nest, f_fss_nest_t, length); + #define f_macro_fss_nest_t_clear(nest) f_macro_memory_structures_clear(nest) #define f_macro_fss_nest_t_resize(status, nest, length) status = f_fss_nest_resize(length, &nest); #define f_macro_fss_nest_t_adjust(status, nest, length) status = f_fss_nest_adjust(length, &nest); - #define f_macro_fss_nest_t_delete(status, nest) status = f_fss_nest_delete(&nest); - #define f_macro_fss_nest_t_destroy(status, nest) status = f_fss_nest_destroy(&nest); - - #define f_macro_fss_nest_t_delete_simple(nest) f_fss_nest_delete(&nest); - #define f_macro_fss_nest_t_destroy_simple(nest) f_fss_nest_destroy(&nest); + #define f_macro_fss_nest_t_delete_simple(nest) f_fss_nest_resize(0, &nest); + #define f_macro_fss_nest_t_destroy_simple(nest) f_fss_nest_adjust(0, &nest); #define f_macro_fss_nest_t_increase(status, nest) status = f_fss_nest_increase(&nest); #define f_macro_fss_nest_t_increase_by(status, nest, amount) status = f_fss_nest_increase_by(amount, &nest); @@ -185,21 +163,13 @@ extern "C" { #define f_fss_nests_t_initialize { 0, 0, 0 } - #define f_macro_fss_nests_t_clear(nests) \ - nests.array = 0; \ - nests.size = 0; \ - nests.used = 0; - - #define f_macro_fss_nests_t_new(status, nests, length) f_macro_memory_structure_new(status, nests, f_fss_nests_t, length); + #define f_macro_fss_nests_t_clear(nests) f_macro_memory_structures_clear(nests) #define f_macro_fss_nests_t_resize(status, nests, length) status = f_fss_nests_resize(length, &nests); #define f_macro_fss_nests_t_adjust(status, nests, length) status = f_fss_nests_adjust(length, &nests); - #define f_macro_fss_nests_t_delete(status, nests) status = f_fss_nests_delete(&nests); - #define f_macro_fss_nests_t_destroy(status, nests) status = f_fss_nests_destroy(&nests); - - #define f_macro_fss_nests_t_delete_simple(nests) f_fss_nests_delete(&nests); - #define f_macro_fss_nests_t_destroy_simple(nests) f_fss_nests_destroy(&nests); + #define f_macro_fss_nests_t_delete_simple(nests) f_fss_nests_resize(0, &nests); + #define f_macro_fss_nests_t_destroy_simple(nests) f_fss_nests_adjust(0, &nests); #define f_macro_fss_nests_t_increase(status, nests) status = f_fss_nests_increase(&nests); #define f_macro_fss_nests_t_increase_by(status, nests, amount) status = f_fss_nests_increase_by(amount, &nests); @@ -212,175 +182,12 @@ extern "C" { * * @param length * The new size to use. - * @param item - * The item array to resize. - * - * @return - * F_none 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_fss_item_adjust_ - extern f_status_t f_fss_item_adjust(const f_array_length_t length, f_fss_item_t *item); -#endif // _di_f_fss_item_adjust_ - -/** - * Resize the nest 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 item - * The item array to resize. - * - * @return - * F_none 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_fss_item_decimate_by_ - extern f_status_t f_fss_item_decimate_by(const f_array_length_t amount, f_fss_item_t *item); -#endif // _di_f_fss_item_decimate_by_ - -/** - * Resize the nest 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 decrease the size by. - * @param item - * The item array to resize. - * - * @return - * F_none 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_fss_item_decrease_by_ - extern f_status_t f_fss_item_decrease_by(const f_array_length_t amount, f_fss_item_t *item); -#endif // _di_f_fss_item_decrease_by_ - -/** - * Delete the array of nest. - * - * @param ranges - * The ranges to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_item_delete_ - extern f_status_t f_fss_item_delete(f_fss_item_t *ranges); -#endif // _di_f_fss_item_delete_ - -/** - * Delete the array of nest. - * - * @param item - * The item to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_item_destroy_ - extern f_status_t f_fss_item_destroy(f_fss_item_t *item); -#endif // _di_f_fss_item_destroy_ - -/** - * Increase the size of the item array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param item - * The item array to resize. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if the new array length is too large. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_item_increase_ - extern f_status_t f_fss_item_increase(f_fss_item_t *item); -#endif // _di_f_fss_item_increase_ - -/** - * Resize the item array to a larger size. - * - * This will resize making the string larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). - * 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 item - * The item array to resize. - * - * @return - * F_none on success. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_array_too_large (with error bit) if the new array length is too large. - */ -#ifndef _di_f_fss_item_increase_by_ - extern f_status_t f_fss_item_increase_by(const f_array_length_t amount, f_fss_item_t *item); -#endif // _di_f_fss_item_increase_by_ - -/** - * Create a new item array. - * - * This clears all pointers, so be sure the structure is no longer allocated. - * - * @param length - * The new size to use. - * @param item - * The item array to adjust. - * - * @return - * F_none 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_fss_item_new_ - extern f_status_t f_fss_item_new(const f_array_length_t length, f_fss_item_t *item); -#endif // _di_f_fss_item_new_ - -/** - * Resize the item array. - * - * @param length - * The new size to use. - * @param item - * The item array to adjust. - * - * @return - * F_none 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_fss_item_resize_ - extern f_status_t f_fss_item_resize(const f_array_length_t length, f_fss_item_t *item); -#endif // _di_f_fss_item_resize_ - -/** - * Resize the nest array. - * - * @param length - * The new size to use. * @param items * The items array to resize. * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -402,6 +209,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -423,6 +231,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -431,34 +240,6 @@ extern "C" { #endif // _di_f_fss_items_decrease_by_ /** - * Delete the array of nest. - * - * @param ranges - * The ranges to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_items_delete_ - extern f_status_t f_fss_items_delete(f_fss_items_t *ranges); -#endif // _di_f_fss_items_delete_ - -/** - * Delete the array of nest. - * - * @param items - * The items to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_items_destroy_ - extern f_status_t f_fss_items_destroy(f_fss_items_t *items); -#endif // _di_f_fss_items_destroy_ - -/** * Increase the size of the items array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -469,6 +250,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -491,6 +274,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -509,6 +294,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -526,6 +312,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -547,6 +334,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -568,6 +356,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -576,34 +365,6 @@ extern "C" { #endif // _di_f_fss_nest_decrease_by_ /** - * Delete the array of nest. - * - * @param ranges - * The ranges to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_nest_delete_ - extern f_status_t f_fss_nest_delete(f_fss_nest_t *ranges); -#endif // _di_f_fss_nest_delete_ - -/** - * Delete the array of nest. - * - * @param nest - * The nest to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_nest_destroy_ - extern f_status_t f_fss_nest_destroy(f_fss_nest_t *nest); -#endif // _di_f_fss_nest_destroy_ - -/** * Increase the size of the nest array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -614,6 +375,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -636,6 +399,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -654,6 +419,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -671,6 +437,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -692,6 +459,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -713,6 +481,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -721,34 +490,6 @@ extern "C" { #endif // _di_f_fss_nests_decrease_by_ /** - * Delete the array of nest. - * - * @param ranges - * The ranges to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_nests_delete_ - extern f_status_t f_fss_nests_delete(f_fss_nests_t *ranges); -#endif // _di_f_fss_nests_delete_ - -/** - * Delete the array of nest. - * - * @param nests - * The nests to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_nests_destroy_ - extern f_status_t f_fss_nests_destroy(f_fss_nests_t *nests); -#endif // _di_f_fss_nests_destroy_ - -/** * Increase the size of the nests array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -759,6 +500,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -781,6 +524,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -799,6 +544,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ diff --git a/level_0/f_fss/c/fss_quote.h b/level_0/f_fss/c/fss_quote.h index 86df9fa..87f35c6 100644 --- a/level_0/f_fss/c/fss_quote.h +++ b/level_0/f_fss/c/fss_quote.h @@ -45,23 +45,18 @@ extern "C" { #define f_fss_quotes_t_initialize f_uint8s_t_initialize - #define f_macro_fss_quotes_t_clear(quotes) f_macro_uint8s_t_clear(quotes); + #define f_macro_fss_quotes_t_clear(quotes) f_macro_uint8s_t_clear(quotes) - #define f_macro_fss_quotes_t_new(status, quotes, length) f_macro_uint8s_t_new(status, quotes, length); + #define f_macro_fss_quotes_t_resize(status, quotes, length) f_macro_uint8s_t_resize(status, quotes, length) + #define f_macro_fss_quotes_t_adjust(status, quotes, length) f_macro_uint8s_t_adjust(status, quotes, length) - #define f_macro_fss_quotes_t_resize(status, quotes, length) f_macro_uint8s_t_resize(status, quotes, length); - #define f_macro_fss_quotes_t_adjust(status, quotes, length) f_macro_uint8s_t_adjust(status, quotes, length); + #define f_macro_fss_quotes_t_delete_simple(quotes) f_macro_uint8s_t_delete_simple(quotes) + #define f_macro_fss_quotes_t_destroy_simple(quotes) f_macro_uint8s_t_destroy_simple(quotes) - #define f_macro_fss_quotes_t_delete(status, quotes) f_macro_uint8s_t_delete(status, quotes); - #define f_macro_fss_quotes_t_destroy(status, quotes) f_macro_uint8s_t_destroy(status, quotes); - - #define f_macro_fss_quotes_t_delete_simple(quotes) f_macro_uint8s_t_delete_simple(quotes); - #define f_macro_fss_quotes_t_destroy_simple(quotes) f_macro_uint8s_t_destroy_simple(quotes); - - #define f_macro_fss_quotes_t_increase(status, quotes) f_macro_uint8s_t_increase(status, quotes); - #define f_macro_fss_quotes_t_increase_by(status, quotes, amount) f_macro_uint8s_t_increase_by(status, quotes, amount); - #define f_macro_fss_quotes_t_decrease_by(status, quotes, amount) f_macro_uint8s_t_decrease_by(status, quotes, amount); - #define f_macro_fss_quotes_t_decimate_by(status, quotes, amount) f_macro_uint8s_t_decimate_by(status, quotes, amount); + #define f_macro_fss_quotes_t_increase(status, quotes) f_macro_uint8s_t_increase(status, quotes) + #define f_macro_fss_quotes_t_increase_by(status, quotes, amount) f_macro_uint8s_t_increase_by(status, quotes, amount) + #define f_macro_fss_quotes_t_decrease_by(status, quotes, amount) f_macro_uint8s_t_decrease_by(status, quotes, amount) + #define f_macro_fss_quotes_t_decimate_by(status, quotes, amount) f_macro_uint8s_t_decimate_by(status, quotes, amount) #endif // _di_f_fss_quotes_t_ /** @@ -76,23 +71,18 @@ extern "C" { #define f_fss_quotess_t_initialize f_uint8ss_t_initialize - #define f_macro_fss_quotess_t_clear(quotess) f_macro_uint8ss_t_clear(quotess); - - #define f_macro_fss_quotess_t_new(status, quotess, length) f_macro_uint8ss_t_new(status, quotess, length); - - #define f_macro_fss_quotess_t_resize(status, quotess, length) f_macro_uint8ss_t_resize(status, quotess, length); - #define f_macro_fss_quotess_t_adjust(status, quotess, length) f_macro_uint8ss_t_adjust(status, quotess, length); + #define f_macro_fss_quotess_t_clear(quotess) f_macro_uint8ss_t_clear(quotess) - #define f_macro_fss_quotess_t_delete(status, quotess) f_macro_uint8ss_t_delete(status, quotess); - #define f_macro_fss_quotess_t_destroy(status, quotess) f_macro_uint8ss_t_destroy(status, quotess); + #define f_macro_fss_quotess_t_resize(status, quotess, length) f_macro_uint8ss_t_resize(status, quotess, length) + #define f_macro_fss_quotess_t_adjust(status, quotess, length) f_macro_uint8ss_t_adjust(status, quotess, length) - #define f_macro_fss_quotess_t_delete_simple(quotess) f_macro_uint8ss_t_delete_simple(quotess); - #define f_macro_fss_quotess_t_destroy_simple(quotess) f_macro_uint8ss_t_destroy_simple(quotess); + #define f_macro_fss_quotess_t_delete_simple(quotess) f_macro_uint8ss_t_delete_simple(quotess) + #define f_macro_fss_quotess_t_destroy_simple(quotess) f_macro_uint8ss_t_destroy_simple(quotess) - #define f_macro_fss_quotess_t_increase(status, quotess) f_macro_uint8ss_t_increase(status, quotess); - #define f_macro_fss_quotess_t_increase_by(status, quotess, amount) f_macro_uint8ss_t_increase_by(status, quotess, amount); - #define f_macro_fss_quotess_t_decrease_by(status, quotess, amount) f_macro_uint8ss_t_decrease_by(status, quotess, amount); - #define f_macro_fss_quotess_t_decimate_by(status, quotess, amount) f_macro_uint8ss_t_decimate_by(status, quotess, amount); + #define f_macro_fss_quotess_t_increase(status, quotess) f_macro_uint8ss_t_increase(status, quotess) + #define f_macro_fss_quotess_t_increase_by(status, quotess, amount) f_macro_uint8ss_t_increase_by(status, quotess, amount) + #define f_macro_fss_quotess_t_decrease_by(status, quotess, amount) f_macro_uint8ss_t_decrease_by(status, quotess, amount) + #define f_macro_fss_quotess_t_decimate_by(status, quotess, amount) f_macro_uint8ss_t_decimate_by(status, quotess, amount) #endif // _di_f_fss_quotess_t_ #ifdef __cplusplus diff --git a/level_0/f_fss/c/fss_set.c b/level_0/f_fss/c/fss_set.c index 382ea26..38f4ff1 100644 --- a/level_0/f_fss/c/fss_set.c +++ b/level_0/f_fss/c/fss_set.c @@ -45,26 +45,6 @@ extern "C" { } #endif // _di_f_fss_set_decrease_by_ -#ifndef _di_f_fss_set_delete_ - f_status_t f_fss_set_delete(f_fss_set_t *set) { - #ifndef _di_level_0_parameter_checking_ - if (!set) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_set_resize(0, set); - } -#endif // _di_f_fss_set_delete_ - -#ifndef _di_f_fss_set_destroy_ - f_status_t f_fss_set_destroy(f_fss_set_t *set) { - #ifndef _di_level_0_parameter_checking_ - if (!set) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_set_adjust(0, set); - } -#endif // _di_f_fss_set_destroy_ - #ifndef _di_f_fss_set_increase_ f_status_t f_fss_set_increase(f_fss_set_t *set) { #ifndef _di_level_0_parameter_checking_ @@ -85,7 +65,7 @@ extern "C" { return private_f_fss_set_resize(size, set); } - return F_none; + return F_data_not; } #endif // _di_f_fss_set_increase_ @@ -104,7 +84,7 @@ extern "C" { return private_f_fss_set_resize(set->objects.used + amount, set); } - return F_none; + return F_data_not; } #endif // _di_f_fss_set_increase_by_ @@ -198,7 +178,7 @@ extern "C" { return private_f_fss_set_quote_resize(size, set_quote); } - return F_none; + return F_data_not; } #endif // _di_f_fss_set_quote_increase_ @@ -217,7 +197,7 @@ extern "C" { return private_f_fss_set_quote_resize(set_quote->objects.used + amount, set_quote); } - return F_none; + return F_data_not; } #endif // _di_f_fss_set_quote_increase_by_ @@ -271,26 +251,6 @@ extern "C" { } #endif // _di_f_fss_set_quotes_decrease_by_ -#ifndef _di_f_fss_set_quotes_delete_ - f_status_t f_fss_set_quotes_delete(f_fss_set_quotes_t *set_quotes) { - #ifndef _di_level_0_parameter_checking_ - if (!set_quotes) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_set_quotes_resize(0, set_quotes); - } -#endif // _di_f_fss_set_quotes_delete_ - -#ifndef _di_f_fss_set_quotes_destroy_ - f_status_t f_fss_set_quotes_destroy(f_fss_set_quotes_t *set_quotes) { - #ifndef _di_level_0_parameter_checking_ - if (!set_quotes) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_set_quotes_adjust(0, set_quotes); - } -#endif // _di_f_fss_set_quotes_destroy_ - #ifndef _di_f_fss_set_quotes_increase_ f_status_t f_fss_set_quotes_increase(f_fss_set_quotes_t *set_quotes) { #ifndef _di_level_0_parameter_checking_ @@ -311,7 +271,7 @@ extern "C" { return private_f_fss_set_quotes_resize(size, set_quotes); } - return F_none; + return F_data_not; } #endif // _di_f_fss_set_quotes_increase_ @@ -330,7 +290,7 @@ extern "C" { return private_f_fss_set_quotes_resize(set_quotes->used + amount, set_quotes); } - return F_none; + return F_data_not; } #endif // _di_f_fss_set_quotes_increase_by_ @@ -384,26 +344,6 @@ extern "C" { } #endif // _di_f_fss_sets_decrease_by_ -#ifndef _di_f_fss_sets_delete_ - f_status_t f_fss_sets_delete(f_fss_sets_t *sets) { - #ifndef _di_level_0_parameter_checking_ - if (!sets) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_sets_resize(0, sets); - } -#endif // _di_f_fss_sets_delete_ - -#ifndef _di_f_fss_sets_destroy_ - f_status_t f_fss_sets_destroy(f_fss_sets_t *sets) { - #ifndef _di_level_0_parameter_checking_ - if (!sets) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_fss_sets_adjust(0, sets); - } -#endif // _di_f_fss_sets_destroy_ - #ifndef _di_f_fss_sets_increase_ f_status_t f_fss_sets_increase(f_fss_sets_t *sets) { #ifndef _di_level_0_parameter_checking_ @@ -424,7 +364,7 @@ extern "C" { return private_f_fss_sets_resize(size, sets); } - return F_none; + return F_data_not; } #endif // _di_f_fss_sets_increase_ @@ -443,7 +383,7 @@ extern "C" { return private_f_fss_sets_resize(sets->used + amount, sets); } - return F_none; + return F_data_not; } #endif // _di_f_fss_sets_increase_by_ diff --git a/level_0/f_fss/c/fss_set.h b/level_0/f_fss/c/fss_set.h index e2c4a5a..d88e045 100644 --- a/level_0/f_fss/c/fss_set.h +++ b/level_0/f_fss/c/fss_set.h @@ -34,19 +34,14 @@ extern "C" { #define f_fss_set_t_initialize { f_fss_objects_t_initialize, f_fss_contents_t_initialize } #define f_macro_fss_set_t_clear(set) \ - f_macro_fss_objects_t_clear(set.objects); \ - f_macro_fss_contents_t_clear(set.contents); - - #define f_macro_fss_set_t_new(status, set, length) f_macro_memory_structure_new(status, set, f_fss_set_t, length); + f_macro_fss_objects_t_clear(set.objects) \ + f_macro_fss_contents_t_clear(set.contents) #define f_macro_fss_set_t_resize(status, set, length) status = f_fss_set_resize(length, &set); #define f_macro_fss_set_t_adjust(status, set, length) status = f_fss_set_adjust(length, &set); - #define f_macro_fss_set_t_delete(status, set) status = f_fss_set_delete(&set); - #define f_macro_fss_set_t_destroy(status, set) status = f_fss_set_destroy(&set); - - #define f_macro_fss_set_t_delete_simple(set) f_fss_set_delete(&set); - #define f_macro_fss_set_t_destroy_simple(set) f_fss_set_destroy(&set); + #define f_macro_fss_set_t_delete_simple(set) f_fss_set_resize(0, &set); + #define f_macro_fss_set_t_destroy_simple(set) f_fss_set_adjust(0, &set); #define f_macro_fss_set_t_increase(status, set) status = f_fss_set_increase(&set); #define f_macro_fss_set_t_increase_by(status, set, amount) status = f_fss_set_increase_by(amount, &set); @@ -71,21 +66,13 @@ extern "C" { #define f_fss_sets_t_initialize { 0, 0, 0 } - #define f_macro_fss_sets_t_clear(sets) \ - sets.array = 0; \ - sets.size = 0; \ - sets.used = 0; - - #define f_macro_fss_sets_t_new(status, sets, length) f_macro_memory_structure_new(status, sets, f_fss_set_t, length); + #define f_macro_fss_sets_t_clear(sets) f_macro_memory_structure_t_clear(set.objects) #define f_macro_fss_sets_t_resize(status, sets, length) status = f_fss_sets_resize(length, &sets); #define f_macro_fss_sets_t_adjust(status, sets, length) status = f_fss_sets_adjust(length, &sets); - #define f_macro_fss_sets_t_delete(status, sets) status = f_fss_sets_delete(&sets); - #define f_macro_fss_sets_t_destroy(status, sets) status = f_fss_sets_destroy(&sets); - - #define f_macro_fss_sets_t_delete_simple(sets) f_fss_sets_delete(&sets); - #define f_macro_fss_sets_t_destroy_simple(sets) f_fss_sets_destroy(&sets); + #define f_macro_fss_sets_t_delete_simple(sets) f_fss_sets_resize(0, &sets); + #define f_macro_fss_sets_t_destroy_simple(sets) f_fss_sets_adjust(0, &sets); #define f_macro_fss_sets_t_increase(status, sets) status = f_fss_sets_increase(&sets); #define f_macro_fss_sets_t_increase_by(status, sets, amount) status = f_fss_sets_increase_by(amount, &sets); @@ -99,8 +86,8 @@ extern "C" { * The objects, contents, and quotes should each be of the same used and size. * Any deviation to this would require implementing custom equivelents to the standard management macros. * - * objects: the array of objects. - * contents: the array of contents. + * objects: the array of objects. + * contents: the array of contents. * objects_quote: the array of objects quote types. * contents_quote: the array of contents quote types. */ @@ -116,19 +103,14 @@ extern "C" { #define f_fss_set_quote_t_initialize { f_fss_objects_t_initialize, f_fss_contents_t_initialize, f_fss_quotes_t_initialize, f_fss_quotess_t_initialize } #define f_macro_fss_set_quote_t_clear(set) \ - f_macro_fss_objects_t_clear(set.objects); \ - f_macro_fss_contents_t_clear(set.contents); \ - f_macro_fss_quotes_t_clear(set.objects_quote); \ - f_macro_fss_quotess_t_clear(set.contents_quote); - - #define f_macro_fss_set_quote_t_new(status, set_quote, length) f_macro_memory_structure_new(status, set_quote, f_fss_set_quote_t, length); + f_macro_fss_objects_t_clear(set.objects) \ + f_macro_fss_contents_t_clear(set.contents) \ + f_macro_fss_quotes_t_clear(set.objects_quote) \ + f_macro_fss_quotess_t_clear(set.contents_quote) #define f_macro_fss_set_quote_t_resize(status, set_quote, length) status = f_fss_set_quote_resize(length, &set_quote); #define f_macro_fss_set_quote_t_adjust(status, set_quote, length) status = f_fss_set_quote_adjust(length, &set_quote); - #define f_macro_fss_set_quote_t_delete(status, set_quote) status = f_fss_set_quote_delete(&set_quote); - #define f_macro_fss_set_quote_t_destroy(status, set_quote) status = f_fss_set_quote_destroy(&set_quote); - #define f_macro_fss_set_quote_t_delete_simple(set_quote) f_fss_set_quote_delete(&set_quote); #define f_macro_fss_set_quote_t_destroy_simple(set_quote) f_fss_set_quote_destroy(&set_quote); @@ -155,21 +137,13 @@ extern "C" { #define f_fss_set_quotes_t_initialize { 0, 0, 0 } - #define f_macro_fss_set_quotes_t_clear(sets) \ - sets.array = 0; \ - sets.size = 0; \ - sets.used = 0; - - #define f_macro_fss_set_quotes_t_new(status, set_quotes, length) f_macro_memory_structure_new(status, set_quotes, f_fss_set_quotes_t, length); + #define f_macro_fss_set_quotes_t_clear(nameds) f_macro_memory_structure_clear(nameds) #define f_macro_fss_set_quotes_t_resize(status, set_quotes, length) status = f_fss_set_quotes_resize(length, &set_quotes); #define f_macro_fss_set_quotes_t_adjust(status, set_quotes, length) status = f_fss_set_quotes_adjust(length, &set_quotes); - #define f_macro_fss_set_quotes_t_delete(status, set_quotes) status = f_fss_set_quotes_delete(&set_quotes); - #define f_macro_fss_set_quotes_t_destroy(status, set_quotes) status = f_fss_set_quotes_destroy(&set_quotes); - - #define f_macro_fss_set_quotes_t_delete_simple(set_quotes) f_fss_set_quotes_delete(&set_quotes); - #define f_macro_fss_set_quotes_t_destroy_simple(set_quotes) f_fss_set_quotes_destroy(&set_quotes); + #define f_macro_fss_set_quotes_t_delete_simple(set_quotes) f_fss_set_quotes_resize(0, &set_quotes); + #define f_macro_fss_set_quotes_t_destroy_simple(set_quotes) f_fss_set_quotes_adjust(0, &set_quotes); #define f_macro_fss_set_quotes_t_increase(status, set_quotes) status = f_fss_set_quotes_increase(&set_quotes); #define f_macro_fss_set_quotes_t_increase_by(status, set_quotes, amount) status = f_fss_set_quotes_increase_by(amount, &set_quotes); @@ -187,6 +161,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -208,6 +183,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -229,6 +205,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -237,34 +214,6 @@ extern "C" { #endif // _di_f_fss_set_decrease_by_ /** - * Delete the array of set. - * - * @param ranges - * The ranges to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_set_delete_ - extern f_status_t f_fss_set_delete(f_fss_set_t *ranges); -#endif // _di_f_fss_set_delete_ - -/** - * Delete the array of set. - * - * @param set - * The set to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_set_destroy_ - extern f_status_t f_fss_set_destroy(f_fss_set_t *set); -#endif // _di_f_fss_set_destroy_ - -/** * Increase the size of the set array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -275,6 +224,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -297,6 +248,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -315,6 +268,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -332,6 +286,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -353,6 +308,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -374,6 +330,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -389,6 +346,7 @@ extern "C" { * * @return * F_none on success. + * * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_fss_set_quote_delete_ @@ -403,6 +361,7 @@ extern "C" { * * @return * F_none on success. + * * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_fss_set_quote_destroy_ @@ -420,6 +379,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -442,6 +403,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -460,6 +423,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -477,6 +441,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -498,6 +463,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -519,6 +485,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -527,34 +494,6 @@ extern "C" { #endif // _di_f_fss_set_quotes_decrease_by_ /** - * Delete the array of set_quote. - * - * @param ranges - * The ranges to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_set_quotes_delete_ - extern f_status_t f_fss_set_quotes_delete(f_fss_set_quotes_t *ranges); -#endif // _di_f_fss_set_quotes_delete_ - -/** - * Delete the array of set_quote. - * - * @param set_quotes - * The set_quotes to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_set_quotes_destroy_ - extern f_status_t f_fss_set_quotes_destroy(f_fss_set_quotes_t *set_quotes); -#endif // _di_f_fss_set_quotes_destroy_ - -/** * Increase the size of the set_quotes array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -565,6 +504,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -587,6 +528,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -605,6 +548,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -622,6 +566,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -643,6 +588,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -664,6 +610,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -672,34 +619,6 @@ extern "C" { #endif // _di_f_fss_sets_decrease_by_ /** - * Delete the array of set. - * - * @param ranges - * The ranges to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_sets_delete_ - extern f_status_t f_fss_sets_delete(f_fss_sets_t *ranges); -#endif // _di_f_fss_sets_delete_ - -/** - * Delete the array of set. - * - * @param sets - * The sets to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_fss_sets_destroy_ - extern f_status_t f_fss_sets_destroy(f_fss_sets_t *sets); -#endif // _di_f_fss_sets_destroy_ - -/** * Increase the size of the sets array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -710,6 +629,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -732,6 +653,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -750,6 +673,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ diff --git a/level_0/f_fss/c/private-fss.c b/level_0/f_fss/c/private-fss.c index dca80d7..391095d 100644 --- a/level_0/f_fss/c/private-fss.c +++ b/level_0/f_fss/c/private-fss.c @@ -5,84 +5,13 @@ extern "C" { #endif -#if !defined(_di_f_fss_item_adjust_) || !defined(_di_f_fss_item_decimate_by_) || !defined(_di_f_fss_item_destroy_) - f_status_t private_f_fss_item_adjust(const f_array_length_t length, f_fss_item_t *item) { - f_status_t status = F_none; - - if (length < item->content.size) { - - // item->object has no allocatable child elements. - - for (f_array_length_t i = item->content.size - length; i < item->content.size; ++i) { - f_macro_fss_content_t_destroy(status, item->content); - if (F_status_is_error(status)) return status; - } // for - } - - status = f_memory_adjust((void **) & item->content.array, sizeof(f_fss_content_t), item->content.size, length); - - if (F_status_is_error_not(status)) { - if (!length) { - item->object.start = 1; - item->object.stop = 0; - item->parent = 0; - } - - item->content.size = length; - - if (item->content.used > item->content.size) { - item->content.used = length; - } - } - - return status; - } -#endif // !defined(_di_f_fss_item_adjust_) || !defined(_di_f_fss_item_decimate_by_) || !defined(_di_f_fss_item_destroy_) - -#if !defined(_di_f_fss_item_decrease_by_) || !defined(_di_f_fss_item_delete_) || !defined(_di_f_fss_item_increase_) || !defined(_di_f_fss_item_increase_by_) || !defined(_di_f_fss_item_resize_) - f_status_t private_f_fss_item_resize(const f_array_length_t length, f_fss_item_t *item) { - f_status_t status = F_none; - - if (length < item->content.size) { - - // item->object has no allocatable child elements. - - for (f_array_length_t i = item->content.size - length; i < item->content.size; ++i) { - f_macro_fss_content_t_delete(status, item->content); - if (F_status_is_error(status)) return status; - } // for - } - - status = f_memory_resize((void **) & item->content.array, sizeof(f_fss_content_t), item->content.size, length); - - if (F_status_is_error_not(status)) { - if (!length) { - item->object.start = 1; - item->object.stop = 0; - item->parent = 0; - } - - item->content.size = length; - - if (item->content.used > item->content.size) { - item->content.used = length; - } - } - - return status; - } -#endif // !defined(_di_f_fss_item_decrease_by_) || !defined(_di_f_fss_item_delete_) || !defined(_di_f_fss_item_increase_) || !defined(_di_f_fss_item_increase_by_) || !defined(_di_f_fss_item_resize_) - -#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_items_destroy_) +#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) f_status_t private_f_fss_items_adjust(const f_array_length_t length, f_fss_items_t *items) { f_status_t status = F_none; - if (length < items->size) { - for (f_array_length_t i = items->size - length; i < items->size; ++i) { - status = private_f_fss_item_adjust(0, &items->array[i]); - if (F_status_is_error(status)) return status; - } // for - } + for (f_array_length_t i = length; i < items->size; ++i) { + f_macro_fss_item_t_adjust(status, items->array[i], 0) + } // for status = f_memory_adjust((void **) & items->array, sizeof(f_fss_item_t), items->size, length); @@ -96,18 +25,15 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_items_destroy_) +#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) -#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_delete_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_) +#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_) f_status_t private_f_fss_items_resize(const f_array_length_t length, f_fss_items_t *items) { f_status_t status = F_none; - if (length < items->size) { - for (f_array_length_t i = items->size - length; i < items->size; ++i) { - status = private_f_fss_item_resize(0, &items->array[i]); - if (F_status_is_error(status)) return status; - } // for - } + for (f_array_length_t i = length; i < items->size; ++i) { + f_macro_fss_item_t_resize(status, items->array[i], 0) + } // for status = f_memory_resize((void **) & items->array, sizeof(f_fss_item_t), items->size, length); @@ -121,72 +47,48 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_delete_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_) +#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_) -#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_destroy_) || !defined(_di_f_fss_nameds_decimate_by_) - f_status_t private_f_fss_named_destroy(f_fss_named_t *named) { +#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) + f_status_t private_f_fss_named_adjust(const f_array_length_t length, f_fss_named_t *named) { f_status_t status = F_none; - f_macro_string_ranges_t_destroy(status, named->objects); + f_macro_string_ranges_t_adjust(status, named->objects, length) if (F_status_is_error(status)) return status; - named->objects.size = 0; - named->objects.used = 0; - - f_macro_string_rangess_t_destroy(status, named->contents); + f_macro_string_rangess_t_adjust(status, named->contents, length) if (F_status_is_error(status)) return status; - named->contents.size = 0; - named->contents.used = 0; - - f_macro_uint8ss_t_destroy(status, named->quotess); - - if (F_status_is_error_not(status)) { - named->quotess.size = 0; - named->quotess.used = 0; - } + f_macro_uint8ss_t_adjust(status, named->quotess, length) return status; } -#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_destroy_) || !defined(_di_f_fss_nameds_decimate_by_) +#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) -#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_delete_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) - f_status_t private_f_fss_named_delete(f_fss_named_t *named) { +#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) + f_status_t private_f_fss_named_resize(const f_array_length_t length, f_fss_named_t *named) { f_status_t status = F_none; - f_macro_string_ranges_t_delete(status, named->objects); + f_macro_string_ranges_t_resize(status, named->objects, length) if (F_status_is_error(status)) return status; - named->objects.size = 0; - named->objects.used = 0; - - f_macro_string_rangess_t_delete(status, named->contents); + f_macro_string_rangess_t_resize(status, named->contents, length) if (F_status_is_error(status)) return status; - named->contents.size = 0; - named->contents.used = 0; - - f_macro_uint8ss_t_delete(status, named->quotess); - - if (F_status_is_error_not(status)) { - named->quotess.size = 0; - named->quotess.used = 0; - } + f_macro_uint8ss_t_resize(status, named->quotess, length) return status; } -#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_delete_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) +#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) -#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) || !defined(_di_f_fss_nameds_destroy_) +#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) f_status_t private_f_fss_nameds_adjust(const f_array_length_t length, f_fss_nameds_t *nameds) { f_status_t status = F_none; - if (length < nameds->size) { - for (f_array_length_t i = nameds->size - length; i < nameds->size; ++i) { - status = private_f_fss_named_destroy(&nameds->array[i]); - if (F_status_is_error(status)) return status; - } // for - } + for (f_array_length_t i = length; i < nameds->size; ++i) { + status = private_f_fss_named_adjust(0, &nameds->array[i]); + if (F_status_is_error(status)) return status; + } // for status = f_memory_adjust((void **) & nameds->array, sizeof(f_fss_named_t), nameds->size, length); @@ -200,18 +102,16 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) || !defined(_di_f_fss_nameds_destroy_) +#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) -#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_delete_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) +#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) f_status_t private_f_fss_nameds_resize(const f_array_length_t length, f_fss_nameds_t *nameds) { f_status_t status = F_none; - if (length < nameds->size) { - for (f_array_length_t i = nameds->size - length; i < nameds->size; ++i) { - status = private_f_fss_named_delete(&nameds->array[i]); - if (F_status_is_error(status)) return status; - } // for - } + for (f_array_length_t i = length; i < nameds->size; ++i) { + status = private_f_fss_named_resize(0, &nameds->array[i]); + if (F_status_is_error(status)) return status; + } // for status = f_memory_resize((void **) & nameds->array, sizeof(f_fss_named_t), nameds->size, length); @@ -225,18 +125,16 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_delete_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) +#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) -#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_) || !defined(_di_f_fss_nest_destroy_) +#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_) f_status_t private_f_fss_nest_adjust(const f_array_length_t length, f_fss_nest_t *nest) { f_status_t status = F_none; - if (length < nest->size) { - for (f_array_length_t i = nest->size - length; i < nest->size; ++i) { - status = private_f_fss_items_adjust(0, &nest->depth[i]); - if (F_status_is_error(status)) return status; - } // for - } + for (f_array_length_t i = length; i < nest->size; ++i) { + status = private_f_fss_items_adjust(0, &nest->depth[i]); + if (F_status_is_error(status)) return status; + } // for status = f_memory_adjust((void **) & nest->depth, sizeof(f_fss_items_t), nest->size, length); @@ -250,20 +148,16 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_) || !defined(_di_f_fss_nest_destroy_) +#endif // !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_) -#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_delete_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_) +#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_) f_status_t private_f_fss_nest_resize(const f_array_length_t length, f_fss_nest_t *nest) { f_status_t status = F_none; - if (length < nest->size) { - if (length) { - for (f_array_length_t i = nest->size - length; i < nest->size; ++i) { - status = private_f_fss_items_resize(0, &nest->depth[i]); - if (F_status_is_error(status)) return status; - } // for - } - } + for (f_array_length_t i = length; i < nest->size; ++i) { + status = private_f_fss_items_resize(0, &nest->depth[i]); + if (F_status_is_error(status)) return status; + } // for status = f_memory_resize((void **) & nest->depth, sizeof(f_fss_items_t), nest->size, length); @@ -277,18 +171,16 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_delete_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_) +#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_) -#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_) || !defined(_di_f_fss_nests_destroy_) +#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_) f_status_t private_f_fss_nests_adjust(const f_array_length_t length, f_fss_nests_t *nests) { f_status_t status = F_none; - if (length < nests->size) { - for (f_array_length_t i = nests->size - length; i < nests->size; ++i) { - status = private_f_fss_nest_adjust(0, &nests->array[i]); - if (F_status_is_error(status)) return status; - } // for - } + for (f_array_length_t i = length; i < nests->size; ++i) { + status = private_f_fss_nest_adjust(0, &nests->array[i]); + if (F_status_is_error(status)) return status; + } // for status = f_memory_adjust((void **) & nests->array, sizeof(f_fss_nest_t), nests->size, length); @@ -302,18 +194,16 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_) || !defined(_di_f_fss_nests_destroy_) +#endif // !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_) -#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_delete_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_) +#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_) f_status_t private_f_fss_nests_resize(const f_array_length_t length, f_fss_nests_t *nests) { f_status_t status = F_none; - if (length < nests->size) { - for (f_array_length_t i = nests->size - length; i < nests->size; ++i) { - status = private_f_fss_nest_resize(0, &nests->array[i]); - if (F_status_is_error(status)) return status; - } // for - } + for (f_array_length_t i = length; i < nests->size; ++i) { + status = private_f_fss_nest_resize(0, &nests->array[i]); + if (F_status_is_error(status)) return status; + } // for status = f_memory_resize((void **) & nests->array, sizeof(f_fss_nest_t), nests->size, length); @@ -327,244 +217,90 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_delete_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_) +#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_) -#if !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_) || !defined(_di_f_fss_set_destroy_) +#if !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_) f_status_t private_f_fss_set_adjust(const f_array_length_t length, f_fss_set_t *set) { f_status_t status = F_none; - if (length < set->objects.size) { - f_array_length_t i = set->objects.size - length; - - // set->objects has no allocatable child elements. - - if (length < set->contents.size) { - if (length) { - for (i = set->contents.size - length; i < set->contents.size; ++i) { - f_macro_fss_content_t_destroy(status, set->contents.array[i]); - if (F_status_is_error(status)) return status; - } // for - } - else { - f_macro_fss_contents_t_destroy(status, set->contents); - } - } - } - f_macro_fss_objects_t_adjust(status, set->objects, length); if (F_status_is_error(status)) return status; f_macro_fss_contents_t_adjust(status, set->contents, length); - if (F_status_is_error(status)) return status; return status; } -#endif // !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_) || !defined(_di_f_fss_set_destroy_) +#endif // !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_) -#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_delete_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_) +#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_) f_status_t private_f_fss_set_resize(const f_array_length_t length, f_fss_set_t *set) { f_status_t status = F_none; - if (length < set->objects.size) { - f_array_length_t i = set->objects.size - length; - - // set->objects has no allocatable child elements. - - if (length < set->contents.size) { - if (length) { - for (i = set->contents.size - length; i < set->contents.size; ++i) { - f_macro_fss_content_t_delete(status, set->contents.array[i]); - if (F_status_is_error(status)) return status; - } // for - } - else { - f_macro_fss_contents_t_delete(status, set->contents); - } - } - } - f_macro_fss_objects_t_resize(status, set->objects, length); if (F_status_is_error(status)) return status; f_macro_fss_contents_t_resize(status, set->contents, length); - if (F_status_is_error(status)) return status; return status; } -#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_delete_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_) +#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_) -#if !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_) || !defined(_di_f_fss_set_quote_destroy_) +#if !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_) f_status_t private_f_fss_set_quote_adjust(const f_array_length_t length, f_fss_set_quote_t *set_quote) { f_status_t status = F_none; - if (length < set_quote->objects.size) { - f_array_length_t i = set_quote->contents.size - length; - - // set_quote->objects has no allocatable child elements. - - if (length < set_quote->contents.size) { - if (length) { - for (; i < set_quote->contents.size; ++i) { - f_macro_fss_content_t_destroy(status, set_quote->contents.array[i]); - if (F_status_is_error(status)) return status; - } // for - } - else { - f_macro_fss_contents_t_destroy(status, set_quote->contents); - } - } - - // set_quote->objects_quote has no allocatable child elements. - - if (length < set_quote->contents_quote.size) { - if (length) { - for (i = set_quote->contents_quote.size - length; i < set_quote->contents_quote.size; ++i) { - f_macro_fss_quotes_t_destroy(status, set_quote->contents_quote.array[i]); - if (F_status_is_error(status)) return status; - } // for - } - else { - f_macro_fss_quotess_t_delete(status, set_quote->contents_quote); - } - } - } - - status = f_memory_adjust((void **) & set_quote->objects.array, sizeof(f_fss_objects_t), set_quote->objects.size, length); - if (F_status_is_error(status)) return status; - - set_quote->objects.size = length; - - if (set_quote->objects.used > set_quote->objects.size) { - set_quote->objects.used = length; - } - - status = f_memory_adjust((void **) & set_quote->contents.array, sizeof(f_fss_contents_t), set_quote->contents.size, length); + f_macro_fss_objects_t_adjust(status, set_quote->objects, length); if (F_status_is_error(status)) return status; - set_quote->contents.size = length; - - if (set_quote->contents.used > set_quote->contents.size) { - set_quote->contents.used = length; - } - - status = f_memory_adjust((void **) & set_quote->objects_quote.array, sizeof(f_fss_quotes_t), set_quote->objects_quote.size, length); + f_macro_fss_contents_t_adjust(status, set_quote->contents, length); if (F_status_is_error(status)) return status; - set_quote->objects_quote.size = length; - - if (set_quote->objects_quote.used > set_quote->objects_quote.size) { - set_quote->objects_quote.used = length; - } - - status = f_memory_adjust((void **) & set_quote->contents_quote.array, sizeof(f_fss_quotess_t), set_quote->contents_quote.size, length); + f_macro_fss_quotes_t_adjust(status, set_quote->objects_quote, length); if (F_status_is_error(status)) return status; - set_quote->contents_quote.size = length; - - if (set_quote->contents_quote.used > set_quote->contents_quote.size) { - set_quote->contents_quote.used = length; - } + f_macro_fss_quotess_t_adjust(status, set_quote->contents_quote, length); return status; } -#endif // !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_) || !defined(_di_f_fss_set_quote_destroy_) +#endif // !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_) -#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_delete_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_) +#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_) f_status_t private_f_fss_set_quote_resize(const f_array_length_t length, f_fss_set_quote_t *set_quote) { f_status_t status = F_none; - if (length < set_quote->objects.size) { - f_array_length_t i = set_quote->contents.size - length; - - // set_quote->objects has no allocatable child elements. - - if (length < set_quote->contents.size) { - if (length) { - for (; i < set_quote->contents.size; ++i) { - f_macro_fss_content_t_delete(status, set_quote->contents.array[i]); - if (F_status_is_error(status)) return status; - } // for - } - else { - f_macro_fss_contents_t_delete(status, set_quote->contents); - } - } - - // set_quote->objects_quote has no allocatable child elements. - - if (length < set_quote->contents_quote.size) { - if (length) { - for (i = set_quote->contents_quote.size - length; i < set_quote->contents_quote.size; ++i) { - f_macro_fss_quotes_t_delete(status, set_quote->contents_quote.array[i]); - if (F_status_is_error(status)) return status; - } // for - } - else { - f_macro_fss_quotess_t_delete(status, set_quote->contents_quote); - } - } - } - - status = f_memory_resize((void **) & set_quote->objects.array, sizeof(f_fss_objects_t), set_quote->objects.size, length); + f_macro_fss_objects_t_resize(status, set_quote->objects, length); if (F_status_is_error(status)) return status; - set_quote->objects.size = length; - - if (set_quote->objects.used > set_quote->objects.size) { - set_quote->objects.used = length; - } - - status = f_memory_resize((void **) & set_quote->contents.array, sizeof(f_fss_contents_t), set_quote->contents.size, length); + f_macro_fss_contents_t_resize(status, set_quote->contents, length); if (F_status_is_error(status)) return status; - set_quote->contents.size = length; - - if (set_quote->contents.used > set_quote->contents.size) { - set_quote->contents.used = length; - } - - status = f_memory_resize((void **) & set_quote->objects_quote.array, sizeof(f_fss_quotes_t), set_quote->objects_quote.size, length); - if (F_status_is_error(status)) return status; - - set_quote->objects_quote.size = length; - - if (set_quote->objects_quote.used > set_quote->objects_quote.size) { - set_quote->objects_quote.used = length; - } - - status = f_memory_resize((void **) & set_quote->contents_quote.array, sizeof(f_fss_quotess_t), set_quote->contents_quote.size, length); + f_macro_fss_quotes_t_resize(status, set_quote->objects_quote, length); if (F_status_is_error(status)) return status; - set_quote->contents_quote.size = length; - - if (set_quote->contents_quote.used > set_quote->contents_quote.size) { - set_quote->contents_quote.used = length; - } + f_macro_fss_quotess_t_resize(status, set_quote->contents_quote, length); return status; } -#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_delete_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_) +#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_) -#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_) || !defined(_di_f_fss_set_quotes_destroy_) +#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_) f_status_t private_f_fss_set_quotes_adjust(const f_array_length_t length, f_fss_set_quotes_t *set_quotes) { f_status_t status = F_none; - if (length < set_quotes->size) { - for (f_array_length_t i = set_quotes->size - length; i < set_quotes->size; ++i) { + for (f_array_length_t i = length; i < set_quotes->size; ++i) { - f_macro_fss_objects_t_destroy(status, set_quotes->array[i].objects); - if (F_status_is_error(status)) return status; + f_macro_fss_objects_t_adjust(status, set_quotes->array[i].objects, 0); + if (F_status_is_error(status)) return status; - f_macro_fss_contents_t_destroy(status, set_quotes->array[i].contents); - if (F_status_is_error(status)) return status; + f_macro_fss_contents_t_adjust(status, set_quotes->array[i].contents, 0); + if (F_status_is_error(status)) return status; - f_macro_fss_quotes_t_destroy(status, set_quotes->array[i].objects_quote); - if (F_status_is_error(status)) return status; + f_macro_fss_quotes_t_adjust(status, set_quotes->array[i].objects_quote, 0); + if (F_status_is_error(status)) return status; - f_macro_fss_quotess_t_destroy(status, set_quotes->array[i].contents_quote); - if (F_status_is_error(status)) return status; - } // for - } + f_macro_fss_quotess_t_adjust(status, set_quotes->array[i].contents_quote, 0); + if (F_status_is_error(status)) return status; + } // for status = f_memory_adjust((void **) & set_quotes->array, sizeof(f_fss_set_quote_t), set_quotes->size, length); @@ -578,28 +314,26 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_) || !defined(_di_f_fss_set_quotes_destroy_) +#endif // !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_) -#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_delete_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_) +#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_) f_status_t private_f_fss_set_quotes_resize(const f_array_length_t length, f_fss_set_quotes_t *set_quotes) { f_status_t status = F_none; - if (length < set_quotes->size) { - for (f_array_length_t i = set_quotes->size - length; i < set_quotes->size; ++i) { + for (f_array_length_t i = length; i < set_quotes->size; ++i) { - f_macro_fss_objects_t_delete(status, set_quotes->array[i].objects); - if (F_status_is_error(status)) return status; + f_macro_fss_objects_t_resize(status, set_quotes->array[i].objects, 0); + if (F_status_is_error(status)) return status; - f_macro_fss_contents_t_delete(status, set_quotes->array[i].contents); - if (F_status_is_error(status)) return status; + f_macro_fss_contents_t_resize(status, set_quotes->array[i].contents, 0); + if (F_status_is_error(status)) return status; - f_macro_fss_quotes_t_delete(status, set_quotes->array[i].objects_quote); - if (F_status_is_error(status)) return status; + f_macro_fss_quotes_t_resize(status, set_quotes->array[i].objects_quote, 0); + if (F_status_is_error(status)) return status; - f_macro_fss_quotess_t_delete(status, set_quotes->array[i].contents_quote); - if (F_status_is_error(status)) return status; - } // for - } + f_macro_fss_quotess_t_resize(status, set_quotes->array[i].contents_quote, 0); + if (F_status_is_error(status)) return status; + } // for status = f_memory_resize((void **) & set_quotes->array, sizeof(f_fss_set_quote_t), set_quotes->size, length); @@ -613,22 +347,20 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_delete_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_) +#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_) -#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_) || !defined(_di_f_fss_sets_destroy_) +#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_) f_status_t private_f_fss_sets_adjust(const f_array_length_t length, f_fss_sets_t *sets) { f_status_t status = F_none; - if (length < sets->size) { - for (f_array_length_t i = sets->size - length; i < sets->size; ++i) { + for (f_array_length_t i = length; i < sets->size; ++i) { - f_macro_fss_objects_t_destroy(status, sets->array[i].objects); - if (F_status_is_error(status)) return status; + f_macro_fss_objects_t_adjust(status, sets->array[i].objects, 0); + if (F_status_is_error(status)) return status; - f_macro_fss_contents_t_destroy(status, sets->array[i].contents); - if (F_status_is_error(status)) return status; - } // for - } + f_macro_fss_contents_t_adjust(status, sets->array[i].contents, 0); + if (F_status_is_error(status)) return status; + } // for f_memory_adjust((void **) & sets->array, sizeof(f_fss_set_t), sets->size, length); @@ -642,22 +374,20 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_) || !defined(_di_f_fss_sets_destroy_) +#endif // !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_) -#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_delete_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_) +#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_) f_status_t private_f_fss_sets_resize(const f_array_length_t length, f_fss_sets_t *sets) { f_status_t status = F_none; - if (length < sets->size) { - for (f_array_length_t i = sets->size - length; i < sets->size; ++i) { + for (f_array_length_t i = length; i < sets->size; ++i) { - f_macro_fss_objects_t_delete(status, sets->array[i].objects); - if (F_status_is_error(status)) return status; + f_macro_fss_objects_t_resize(status, sets->array[i].objects, 0); + if (F_status_is_error(status)) return status; - f_macro_fss_contents_t_delete(status, sets->array[i].contents); - if (F_status_is_error(status)) return status; - } // for - } + f_macro_fss_contents_t_resize(status, sets->array[i].contents, 0); + if (F_status_is_error(status)) return status; + } // for status = f_memory_resize((void **) & sets->array, sizeof(f_fss_set_t), sets->size, length); @@ -671,7 +401,7 @@ extern "C" { return status; } -#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_delete_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_) +#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_) #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/c/private-fss.h b/level_0/f_fss/c/private-fss.h index dbf4c2b..f7212b1 100644 --- a/level_0/f_fss/c/private-fss.h +++ b/level_0/f_fss/c/private-fss.h @@ -22,75 +22,24 @@ extern "C" { * * @param length * The new size to use. - * @param item - * The item to adjust. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_fss_nest_t_destroy(). - * - * @see f_macro_fss_nest_t_destroy() - * - * @see f_fss_item_adjust() - * @see f_fss_item_decimate_by() - * @see f_fss_item_destroy() - */ -#if !defined(_di_f_fss_item_adjust_) || !defined(_di_f_fss_item_decimate_by_) || !defined(_di_f_fss_item_destroy_) - extern f_status_t private_f_fss_item_adjust(const f_array_length_t length, f_fss_item_t *item) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_item_adjust_) || !defined(_di_f_fss_item_decimate_by_) || !defined(_di_f_fss_item_destroy_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param item - * The item to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: private_f_fss_nest_delete(). - * - * @see private_f_fss_nest_delete() - * - * @see f_fss_item_decrease_by() - * @see f_fss_item_delete() - * @see f_fss_item_increase() - * @see f_fss_item_increase_by() - * @see f_fss_item_resize() - */ -#if !defined(_di_f_fss_item_decrease_by_) || !defined(_di_f_fss_item_delete_) || !defined(_di_f_fss_item_increase_) || !defined(_di_f_fss_item_increase_by_) || !defined(_di_f_fss_item_resize_) - extern f_status_t private_f_fss_item_resize(const f_array_length_t length, f_fss_item_t *item) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_item_decrease_by_) || !defined(_di_f_fss_item_delete_) || !defined(_di_f_fss_item_increase_) || !defined(_di_f_fss_item_increase_by_) || !defined(_di_f_fss_item_resize_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. * @param items * The items to adjust. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_fss_nest_t_destroy(). + * Errors (with error bit) from: f_macro_fss_item_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). * - * @see f_macro_fss_nest_t_destroy() + * @see f_macro_fss_item_t_adjust() * * @see f_fss_items_adjust() * @see f_fss_items_decimate_by() - * @see f_fss_items_destroy() + * @see f_memory_adjust() */ -#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_items_destroy_) +#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) extern f_status_t private_f_fss_items_adjust(const f_array_length_t length, f_fss_items_t *items) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_items_destroy_) +#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) /** * Private implementation for resizing. @@ -105,71 +54,78 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: private_f_fss_nest_delete(). + * Errors (with error bit) from: f_macro_fss_item_t_resize(). + * Errors (with error bit) from: f_memory_resize(). * - * @see private_f_fss_nest_delete() + * @see f_macro_fss_item_t_resize() * * @see f_fss_items_decrease_by() - * @see f_fss_items_delete() * @see f_fss_items_increase() * @see f_fss_items_increase_by() * @see f_fss_items_resize() + * @see f_memory_resize() */ -#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_delete_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_) +#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_) extern f_status_t private_f_fss_items_resize(const f_array_length_t length, f_fss_items_t *items) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_delete_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_) +#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_) /** - * Private implementation for destroying. + * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. * + * @param length + * The new size to use. * @param named - * The named to destroy. + * The named to adjust. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_ranges_t_destroy(). - * Errors (with error bit) from: f_macro_string_rangess_t_destroy(). - * Errors (with error bit) from: f_macro_uint8ss_t_destroy(). + * Errors (with error bit) from: f_macro_string_ranges_t_adjust(). + * Errors (with error bit) from: f_macro_string_rangess_t_adjust(). + * Errors (with error bit) from: f_macro_uint8ss_t_adjust(). * - * @see f_macro_string_ranges_t_destroy() - * @see f_macro_string_rangess_t_destroy() - * @see f_macro_uint8ss_t_destroy() + * @see f_macro_string_ranges_t_adjust() + * @see f_macro_string_rangess_t_adjust() + * @see f_macro_uint8ss_t_adjust() * * @see f_fss_nameds_adjust() * @see f_fss_nameds_decimate_by() */ #if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) - extern f_status_t private_f_fss_named_destroy(f_fss_named_t *named) f_gcc_attribute_visibility_internal; + extern f_status_t private_f_fss_named_adjust(const f_array_length_t length, f_fss_named_t *named) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) /** - * Private implementation for deleting. + * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. * + * @param length + * The new size to use. * @param named - * The named to delete. + * The named to resize. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_ranges_t_delete(). - * Errors (with error bit) from: f_macro_string_rangess_t_delete(). - * Errors (with error bit) from: f_macro_uint8ss_t_delete(). + * Errors (with error bit) from: f_macro_string_ranges_t_resize(). + * Errors (with error bit) from: f_macro_string_rangess_t_resize(). + * Errors (with error bit) from: f_macro_uint8ss_t_resize(). * - * @see f_macro_string_ranges_t_delete() - * @see f_macro_string_rangess_t_delete() - * @see f_macro_uint8ss_t_delete() + * @see f_macro_string_ranges_t_resize() + * @see f_macro_string_rangess_t_resize() + * @see f_macro_uint8ss_t_resize() * * @see f_fss_nameds_decrease_by() + * @see f_fss_nameds_incease() + * @see f_fss_nameds_incease_by() * @see f_fss_nameds_resize() */ -#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_) - extern f_status_t private_f_fss_named_delete(f_fss_named_t *named) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_) +#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) + extern f_status_t private_f_fss_named_resize(const f_array_length_t length, f_fss_named_t *named) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) /** * Private implementation for resizing. @@ -184,17 +140,18 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_fss_named_t_destroy(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_fss_named_adjust(). * - * @see f_macro_fss_named_t_destroy() + * @see private_f_fss_named_adjust() * * @see f_fss_nameds_adjust() * @see f_fss_nameds_decimate_by() - * @see f_fss_nameds_destroy() + * @see f_memory_adjust() */ -#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) || !defined(_di_f_fss_nameds_destroy_) +#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) extern f_status_t private_f_fss_nameds_adjust(const f_array_length_t length, f_fss_nameds_t *nameds) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) || !defined(_di_f_fss_nameds_destroy_) +#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_) /** * Private implementation for resizing. @@ -209,19 +166,20 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: private_f_fss_named_delete(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_fss_named_resize(). * - * @see private_f_fss_named_delete() + * @see private_f_fss_named_resize() * * @see f_fss_nameds_decrease_by() - * @see f_fss_nameds_delete() * @see f_fss_nameds_increase() * @see f_fss_nameds_increase_by() * @see f_fss_nameds_resize() + * @see f_memory_resize() */ -#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_delete_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) +#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) extern f_status_t private_f_fss_nameds_resize(const f_array_length_t length, f_fss_nameds_t *nameds) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_delete_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) +#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_) /** * Private implementation for resizing. @@ -236,17 +194,18 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_fss_nest_t_destroy(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: f_macro_fss_nest_t_adjust(). * - * @see f_macro_fss_nest_t_destroy() + * @see f_macro_fss_nest_t_adjust() * * @see f_fss_nest_adjust() * @see f_fss_nest_decimate_by() - * @see f_fss_nest_destroy() + * @see f_memory_adjust() */ -#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_) || !defined(_di_f_fss_nest_destroy_) +#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_) extern f_status_t private_f_fss_nest_adjust(const f_array_length_t length, f_fss_nest_t *nest) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_) || !defined(_di_f_fss_nest_destroy_) +#endif // !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_) /** * Private implementation for resizing. @@ -261,19 +220,20 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: private_f_fss_nest_delete(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_macro_fss_nest_t_resize(). * - * @see private_f_fss_nest_delete() + * @see f_macro_fss_nest_t_resize() * * @see f_fss_nest_decrease_by() - * @see f_fss_nest_delete() * @see f_fss_nest_increase() * @see f_fss_nest_increase_by() * @see f_fss_nest_resize() + * @see f_memory_resize() */ -#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_delete_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_) +#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_) extern f_status_t private_f_fss_nest_resize(const f_array_length_t length, f_fss_nest_t *nest) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_delete_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_) +#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_) /** * Private implementation for resizing. @@ -288,17 +248,18 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_fss_nest_t_destroy(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: f_macro_fss_nest_t_adjust(). * - * @see f_macro_fss_nest_t_destroy() + * @see f_macro_fss_nest_t_adjust() * * @see f_fss_nests_adjust() * @see f_fss_nests_decimate_by() - * @see f_fss_nests_destroy() + * @see f_memory_adjust() */ -#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_) || !defined(_di_f_fss_nests_destroy_) +#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_) extern f_status_t private_f_fss_nests_adjust(const f_array_length_t length, f_fss_nests_t *nests) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_) || !defined(_di_f_fss_nests_destroy_) +#endif // !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_) /** * Private implementation for resizing. @@ -313,19 +274,20 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: private_f_fss_nest_delete(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_macro_fss_nest_t_resize(). * - * @see private_f_fss_nest_delete() + * @see f_macro_fss_nest_t_resize() * * @see f_fss_nests_decrease_by() - * @see f_fss_nests_delete() * @see f_fss_nests_increase() * @see f_fss_nests_increase_by() * @see f_fss_nests_resize() + * @see f_memory_resize() */ -#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_delete_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_) +#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_) extern f_status_t private_f_fss_nests_resize(const f_array_length_t length, f_fss_nests_t *nests) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_delete_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_) +#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_) /** * Private implementation for resizing. @@ -340,17 +302,18 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_fss_set_t_destroy(). + * Errors (with error bit) from: f_macro_fss_contents_t_adjust(). + * Errors (with error bit) from: f_macro_fss_objects_t_adjust(). * - * @see f_macro_fss_set_t_destroy() + * @see f_macro_fss_contents_t_adjust() + * @see f_macro_fss_objects_t_adjust() * * @see f_fss_set_adjust() * @see f_fss_set_decimate_by() - * @see f_fss_set_destroy() */ -#if !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_) || !defined(_di_f_fss_set_destroy_) +#if !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_) extern f_status_t private_f_fss_set_adjust(const f_array_length_t length, f_fss_set_t *set) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_) || !defined(_di_f_fss_set_destroy_) +#endif // !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_) /** * Private implementation for resizing. @@ -365,19 +328,20 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: private_f_fss_set_delete(). + * Errors (with error bit) from: f_macro_fss_contents_t_resize(). + * Errors (with error bit) from: f_macro_fss_objects_t_resize(). * - * @see private_f_fss_set_delete() + * @see f_macro_fss_contents_t_resize() + * @see f_macro_fss_objects_t_resize() * * @see f_fss_set_decrease_by() - * @see f_fss_set_delete() * @see f_fss_set_increase() * @see f_fss_set_increase_by() * @see f_fss_set_resize() */ -#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_delete_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_) +#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_) extern f_status_t private_f_fss_set_resize(const f_array_length_t length, f_fss_set_t *set) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_delete_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_) +#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_) /** * Private implementation for resizing. @@ -392,17 +356,22 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_fss_set_quote_t_destroy(). + * Errors (with error bit) from: f_macro_fss_contents_t_adjust(). + * Errors (with error bit) from: f_macro_fss_objects_t_adjust(). + * Errors (with error bit) from: f_macro_fss_quotes_t_adjust(). + * Errors (with error bit) from: f_macro_fss_quotess_t_adjust(). * - * @see f_macro_fss_set_quote_t_destroy() + * @see f_macro_fss_contents_t_adjust() + * @see f_macro_fss_objects_t_adjust() + * @see f_macro_fss_quotes_t_adjust() + * @see f_macro_fss_quotess_t_adjust() * * @see f_fss_set_quote_adjust() * @see f_fss_set_quote_decimate_by() - * @see f_fss_set_quote_destroy() */ -#if !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_) || !defined(_di_f_fss_set_quote_destroy_) +#if !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_) extern f_status_t private_f_fss_set_quote_adjust(const f_array_length_t length, f_fss_set_quote_t *set_quote) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_) || !defined(_di_f_fss_set_quote_destroy_) +#endif // !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_) /** * Private implementation for resizing. @@ -417,19 +386,24 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: private_f_fss_set_quote_delete(). + * Errors (with error bit) from: f_macro_fss_contents_t_resize(). + * Errors (with error bit) from: f_macro_fss_objects_t_resize(). + * Errors (with error bit) from: f_macro_fss_quotes_t_resize(). + * Errors (with error bit) from: f_macro_fss_quotess_t_resize(). * - * @see private_f_fss_set_quote_delete() + * @see f_macro_fss_contents_t_resize() + * @see f_macro_fss_objects_t_resize() + * @see f_macro_fss_quotes_t_resize() + * @see f_macro_fss_quotess_t_resize() * * @see f_fss_set_quote_decrease_by() - * @see f_fss_set_quote_delete() * @see f_fss_set_quote_increase() * @see f_fss_set_quote_increase_by() * @see f_fss_set_quote_resize() */ -#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_delete_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_) +#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_) extern f_status_t private_f_fss_set_quote_resize(const f_array_length_t length, f_fss_set_quote_t *set_quote) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_delete_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_) +#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_) /** * Private implementation for resizing. @@ -444,17 +418,24 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_fss_set_quote_t_destroy(). + * Errors (with error bit) from: f_macro_fss_contents_t_adjust(). + * Errors (with error bit) from: f_macro_fss_objects_t_adjust(). + * Errors (with error bit) from: f_macro_fss_quotes_t_adjust(). + * Errors (with error bit) from: f_macro_fss_quotess_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). * - * @see f_macro_fss_set_quote_t_destroy() + * @see f_macro_fss_contents_t_adjust() + * @see f_macro_fss_objects_t_adjust() + * @see f_macro_fss_quotes_t_adjust() + * @see f_macro_fss_quotess_t_adjust() * * @see f_fss_set_quotes_adjust() * @see f_fss_set_quotes_decimate_by() - * @see f_fss_set_quotes_destroy() + * @see f_memory_adjust() */ -#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_) || !defined(_di_f_fss_set_quotes_destroy_) +#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_) extern f_status_t private_f_fss_set_quotes_adjust(const f_array_length_t length, f_fss_set_quotes_t *set_quotes) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_) || !defined(_di_f_fss_set_quotes_destroy_) +#endif // !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_) /** * Private implementation for resizing. @@ -469,19 +450,26 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: private_f_fss_set_quote_delete(). + * Errors (with error bit) from: f_macro_fss_contents_t_resize(). + * Errors (with error bit) from: f_macro_fss_objects_t_resize(). + * Errors (with error bit) from: f_macro_fss_quotes_t_resize(). + * Errors (with error bit) from: f_macro_fss_quotess_t_resize(). + * Errors (with error bit) from: f_memory_resize(). * - * @see private_f_fss_set_quote_delete() + * @see f_macro_fss_contents_t_resize() + * @see f_macro_fss_objects_t_resize() + * @see f_macro_fss_quotes_t_resize() + * @see f_macro_fss_quotess_t_resize() * * @see f_fss_set_quotes_decrease_by() - * @see f_fss_set_quotes_delete() * @see f_fss_set_quotes_increase() * @see f_fss_set_quotes_increase_by() * @see f_fss_set_quotes_resize() + * @see f_memory_resize() */ -#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_delete_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_) +#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_) extern f_status_t private_f_fss_set_quotes_resize(const f_array_length_t length, f_fss_set_quotes_t *set_quotes) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_delete_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_) +#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_) /** * Private implementation for resizing. @@ -496,17 +484,20 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_fss_set_t_destroy(). + * Errors (with error bit) from: f_macro_fss_contents_t_adjust(). + * Errors (with error bit) from: f_macro_fss_objects_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). * - * @see f_macro_fss_set_t_destroy() + * @see f_macro_fss_contents_t_adjust() + * @see f_macro_fss_objects_t_adjust() * * @see f_fss_sets_adjust() * @see f_fss_sets_decimate_by() - * @see f_fss_sets_destroy() + * @see f_memory_adjust() */ -#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_) || !defined(_di_f_fss_sets_destroy_) +#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_) extern f_status_t private_f_fss_sets_adjust(const f_array_length_t length, f_fss_sets_t *sets) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_) || !defined(_di_f_fss_sets_destroy_) +#endif // !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_) /** * Private implementation for resizing. @@ -521,19 +512,22 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: private_f_fss_set_delete(). + * Errors (with error bit) from: f_macro_fss_contents_t_resize(). + * Errors (with error bit) from: f_macro_fss_objects_t_resize(). + * Errors (with error bit) from: f_memory_resize(). * - * @see private_f_fss_set_delete() + * @see f_macro_fss_contents_t_resize() + * @see f_macro_fss_objects_t_resize() * * @see f_fss_sets_decrease_by() - * @see f_fss_sets_delete() * @see f_fss_sets_increase() * @see f_fss_sets_increase_by() * @see f_fss_sets_resize() + * @see f_memory_resize() */ -#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_delete_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_) +#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_) extern f_status_t private_f_fss_sets_resize(const f_array_length_t length, f_fss_sets_t *sets) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_delete_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_) +#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_) #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/data/build/dependencies b/level_0/f_fss/data/build/dependencies index deb9037..be7c275 100644 --- a/level_0/f_fss/data/build/dependencies +++ b/level_0/f_fss/data/build/dependencies @@ -3,5 +3,6 @@ f_type f_status f_memory +f_type_array f_string f_utf diff --git a/level_0/f_fss/data/build/settings b/level_0/f_fss/data/build/settings index 13c9630..93dce31 100644 --- a/level_0/f_fss/data/build/settings +++ b/level_0/f_fss/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lf_memory -lf_string -lf_utf +build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf build_sources_library fss.c private-fss.c fss_named.c fss_nest.c fss_set.c build_sources_program build_sources_headers fss.h private-fss.h fss-common.h fss_comment.h fss_delimit.h fss_named.h fss_nest.h fss_quote.h fss_set.h diff --git a/level_0/f_iki/c/iki-common.h b/level_0/f_iki/c/iki-common.h index 7fe89a5..96ff488 100644 --- a/level_0/f_iki/c/iki-common.h +++ b/level_0/f_iki/c/iki-common.h @@ -89,14 +89,9 @@ extern "C" { #define f_macro_iki_variable_t_clear(variable) f_macro_string_ranges_t_clear(variable) - #define f_macro_iki_variable_t_new(status, variable, length) f_macro_string_ranges_t_new(status, variable, length) - #define f_macro_iki_variable_t_resize(status, variable, new_length) f_macro_string_ranges_t_resize(status, variable, new_length) #define f_macro_iki_variable_t_adjust(status, variable, new_length) f_macro_string_ranges_t_adjust(status, variable, new_length) - #define f_macro_iki_variable_t_delete(status, variable) f_macro_string_ranges_t_delete(status, variable) - #define f_macro_iki_variable_t_destroy(status, variable) f_macro_string_ranges_t_destroy(status, variable) - #define f_macro_iki_variable_t_delete_simple(variable) f_macro_string_ranges_t_delete_simple(variable) #define f_macro_iki_variable_t_destroy_simple(variable) f_macro_string_ranges_t_destroy_simple(variable) #endif // _di_iki_variable_t_ @@ -115,14 +110,9 @@ extern "C" { #define f_macro_iki_vocabulary_t_clear(vocabulary) f_macro_string_ranges_t_clear(vocabulary) - #define f_macro_iki_vocabulary_t_new(status, vocabulary, length) f_macro_string_ranges_t_new(status, vocabulary, length) - #define f_macro_iki_vocabulary_t_resize(status, vocabulary, new_length) f_macro_string_ranges_t_resize(status, vocabulary, new_length) #define f_macro_iki_vocabulary_t_adjust(status, vocabulary, new_length) f_macro_string_ranges_t_adjust(status, vocabulary, new_length) - #define f_macro_iki_vocabulary_t_delete(status, vocabulary) f_macro_string_ranges_t_delete(status, vocabulary) - #define f_macro_iki_vocabulary_t_destroy(status, vocabulary) f_macro_string_ranges_t_destroy(status, vocabulary) - #define f_macro_iki_vocabulary_t_delete_simple(vocabulary) f_macro_string_ranges_t_delete_simple(vocabulary) #define f_macro_iki_vocabulary_t_destroy_simple(vocabulary) f_macro_string_ranges_t_destroy_simple(vocabulary) #endif // _di_iki_vocabulary_t_ @@ -141,14 +131,9 @@ extern "C" { #define f_macro_iki_vocabularys_t_clear(content) f_macro_string_rangess_t_clear(content) - #define f_macro_iki_vocabularys_t_new(status, content, length) f_macro_string_rangess_t_new(status, content, length) - #define f_macro_iki_vocabularys_t_resize(status, content, new_length) f_macro_string_rangess_t_resize(status, content, new_length) #define f_macro_iki_vocabularys_t_adjust(status, content, new_length) f_macro_string_rangess_t_adjust(status, content, new_length) - #define f_macro_iki_vocabularys_t_delete(status, content) f_macro_string_rangess_t_delete(status, content) - #define f_macro_iki_vocabularys_t_destroy(status, content) f_macro_string_rangess_t_destroy(status, content) - #define f_macro_iki_vocabularys_t_delete_simple(content) f_macro_string_rangess_t_delete_simple(content) #define f_macro_iki_vocabularys_t_destroy_simple(content) f_macro_string_rangess_t_destroy_simple(content) #endif // _di_iki_vocabularys_t_ @@ -169,14 +154,9 @@ extern "C" { #define f_macro_iki_content_t_clear(content) f_macro_string_ranges_t_clear(content) - #define f_macro_iki_content_t_new(status, content, length) f_macro_string_ranges_t_new(status, content, length) - #define f_macro_iki_content_t_resize(status, content, new_length) f_macro_string_ranges_t_resize(status, content, new_length) #define f_macro_iki_content_t_adjust(status, content, new_length) f_macro_string_ranges_t_adjust(status, content, new_length) - #define f_macro_iki_content_t_delete(status, content) f_macro_string_ranges_t_delete(status, content) - #define f_macro_iki_content_t_destroy(status, content) f_macro_string_ranges_t_destroy(status, content) - #define f_macro_iki_content_t_delete_simple(content) f_macro_string_ranges_t_delete_simple(content) #define f_macro_iki_content_t_destroy_simple(content) f_macro_string_ranges_t_destroy_simple(content) #endif // _di_iki_content_t_ @@ -195,14 +175,9 @@ extern "C" { #define f_macro_iki_contents_t_clear(content) f_macro_string_rangess_t_clear(content) - #define f_macro_iki_contents_t_new(status, content, length) f_macro_string_rangess_t_new(status, content, length) - #define f_macro_iki_contents_t_resize(status, content, new_length) f_macro_string_rangess_t_resize(status, content, new_length) #define f_macro_iki_contents_t_adjust(status, content, new_length) f_macro_string_rangess_t_adjust(status, content, new_length) - #define f_macro_iki_contents_t_delete(status, content) f_macro_string_rangess_t_delete(status, content) - #define f_macro_iki_contents_t_destroy(status, content) f_macro_string_rangess_t_destroy(status, content) - #define f_macro_iki_contents_t_delete_simple(content) f_macro_string_rangess_t_delete_simple(content) #define f_macro_iki_contents_t_destroy_simple(content) f_macro_string_rangess_t_destroy_simple(content) #endif // _di_iki_contents_t_ diff --git a/level_0/f_iki/c/iki.c b/level_0/f_iki/c/iki.c index 457730a..69632cf 100644 --- a/level_0/f_iki/c/iki.c +++ b/level_0/f_iki/c/iki.c @@ -128,7 +128,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -143,7 +143,7 @@ extern "C" { } while (F_status_is_fine(status) && buffer->string[range->start] == f_iki_syntax_placeholder); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -157,7 +157,7 @@ extern "C" { // this is not a valid vocabulary name so seek until a non-word, non-dash, or non-plus character. f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_false); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -200,7 +200,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } // while @@ -213,7 +213,7 @@ extern "C" { status = f_utf_is_word_dash_plus(buffer->string + range->start, width_max, F_false); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -222,15 +222,15 @@ extern "C" { f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_true); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } else if (range->start > range->stop) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return F_data_not_stop; } else if (range->start >= buffer->used) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return F_data_not_eos; } @@ -241,7 +241,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } // while @@ -264,7 +264,7 @@ extern "C" { f_macro_iki_allocate_delimits_if_necessary(status, delimits); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -290,7 +290,7 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -310,7 +310,7 @@ extern "C" { buffer->string[delimits.array[i]] = f_iki_syntax_placeholder; } // for - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); if (F_status_is_error(status)) return status; range->start++; @@ -355,7 +355,7 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } @@ -375,7 +375,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, (&content_range), 1); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } // while @@ -388,7 +388,7 @@ extern "C" { f_macro_iki_allocate_delimits_if_necessary(status, delimits); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -417,7 +417,7 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -437,7 +437,7 @@ extern "C" { buffer->string[delimits.array[i]] = f_iki_syntax_placeholder; } // for - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); if (F_status_is_error(status)) return status; range->start++; @@ -465,7 +465,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } // while @@ -474,7 +474,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } // while @@ -496,7 +496,7 @@ extern "C" { buffer->string[delimits.array[i]] = f_iki_syntax_placeholder; } // for - f_macro_string_lengths_t_delete(status, delimits); + f_macro_string_lengths_t_delete_simple(delimits); if (F_status_is_error(status)) return status; if (range->start > range->stop) { diff --git a/level_0/f_limit/c/limit-common.h b/level_0/f_limit/c/limit-common.h index 440d767..94e85ac 100644 --- a/level_0/f_limit/c/limit-common.h +++ b/level_0/f_limit/c/limit-common.h @@ -49,23 +49,18 @@ extern "C" { #define f_limit_values_t_initialize { 0, 0, 0 } - #define f_macro_limit_values_t_clear(values) f_macro_memory_structure_clear(values); + #define f_macro_limit_values_t_clear(values) f_macro_memory_structure_clear(values) - #define f_macro_limit_values_t_new(status, values, length) f_macro_memory_structure_new(status, values, f_limit_value_t, length); + #define f_macro_limit_values_t_resize(status, values, length) f_macro_memory_structure_resize(status, values, f_limit_value_t, length) + #define f_macro_limit_values_t_adjust(status, values, length) f_macro_memory_structure_adjust(status, values, f_limit_value_t, length) - #define f_macro_limit_values_t_resize(status, values, length) f_macro_memory_structure_resize(status, values, f_limit_value_t, length); - #define f_macro_limit_values_t_adjust(status, values, length) f_macro_memory_structure_adjust(status, values, f_limit_value_t, length); + #define f_macro_limit_values_t_delete_simple(values) f_macro_memory_structure_delete_simple(values, f_limit_value_t) + #define f_macro_limit_values_t_destroy_simple(values) f_macro_memory_structure_destroy_simple(values, f_limit_value_t) - #define f_macro_limit_values_t_delete(status, values) f_macro_memory_structure_delete(status, values, f_limit_value_t); - #define f_macro_limit_values_t_destroy(status, values) f_macro_memory_structure_destroy(status, values, f_limit_value_t); - - #define f_macro_limit_values_t_delete_simple(values) f_macro_memory_structure_delete_simple(values, f_limit_value_t); - #define f_macro_limit_values_t_destroy_simple(values) f_macro_memory_structure_destroy_simple(values, f_limit_value_t); - - #define f_macro_limit_values_t_increase(status, values) f_macro_memory_structure_increase(status, values, f_limit_value_t); - #define f_macro_limit_values_t_increase_by(status, values, amount) f_macro_memory_structure_increase_by(status, values, f_limit_value_t, amount); - #define f_macro_limit_values_t_decrease_by(status, values, amount) f_macro_memory_structure_decrease_by(status, values, f_limit_value_t, amount); - #define f_macro_limit_values_t_decimate_by(status, values, amount) f_macro_memory_structure_decimate_by(status, values, f_limit_value_t, amount); + #define f_macro_limit_values_t_increase(status, values) f_macro_memory_structure_increase(status, values, f_limit_value_t) + #define f_macro_limit_values_t_increase_by(status, values, amount) f_macro_memory_structure_increase_by(status, values, f_limit_value_t, amount) + #define f_macro_limit_values_t_decrease_by(status, values, amount) f_macro_memory_structure_decrease_by(status, values, f_limit_value_t, amount) + #define f_macro_limit_values_t_decimate_by(status, values, amount) f_macro_memory_structure_decimate_by(status, values, f_limit_value_t, amount) #endif // _di_f_limit_values_t_ /** @@ -104,23 +99,18 @@ extern "C" { #define f_limit_sets_t_initialize { 0, 0, 0 } - #define f_macro_limit_sets_t_clear(sets) f_macro_memory_structure_clear(sets); - - #define f_macro_limit_sets_t_new(status, sets, length) f_macro_memory_structure_new(status, sets, f_limit_set_t, length); - - #define f_macro_limit_sets_t_resize(status, sets, length) f_macro_memory_structure_resize(status, sets, f_limit_set_t, length); - #define f_macro_limit_sets_t_adjust(status, sets, length) f_macro_memory_structure_adjust(status, sets, f_limit_set_t, length); + #define f_macro_limit_sets_t_clear(sets) f_macro_memory_structure_clear(sets) - #define f_macro_limit_sets_t_delete(status, sets) f_macro_memory_structure_delete(status, sets, f_limit_set_t); - #define f_macro_limit_sets_t_destroy(status, sets) f_macro_memory_structure_destroy(status, sets, f_limit_set_t); + #define f_macro_limit_sets_t_resize(status, sets, length) f_macro_memory_structure_resize(status, sets, f_limit_set_t, length) + #define f_macro_limit_sets_t_adjust(status, sets, length) f_macro_memory_structure_adjust(status, sets, f_limit_set_t, length) - #define f_macro_limit_sets_t_delete_simple(sets) f_macro_memory_structure_delete_simple(sets, f_limit_set_t); - #define f_macro_limit_sets_t_destroy_simple(sets) f_macro_memory_structure_destroy_simple(sets, f_limit_set_t); + #define f_macro_limit_sets_t_delete_simple(sets) f_macro_memory_structure_delete_simple(sets, f_limit_set_t) + #define f_macro_limit_sets_t_destroy_simple(sets) f_macro_memory_structure_destroy_simple(sets, f_limit_set_t) - #define f_macro_limit_sets_t_increase(status, sets) f_macro_memory_structure_increase(status, sets, f_limit_set_t); - #define f_macro_limit_sets_t_increase_by(status, sets, amount) f_macro_memory_structure_increase_by(status, sets, f_limit_set_t, amount); - #define f_macro_limit_sets_t_decrease_by(status, sets, amount) f_macro_memory_structure_decrease_by(status, sets, f_limit_set_t, amount); - #define f_macro_limit_sets_t_decimate_by(status, sets, amount) f_macro_memory_structure_decimate_by(status, sets, f_limit_set_t, amount); + #define f_macro_limit_sets_t_increase(status, sets) f_macro_memory_structure_increase(status, sets, f_limit_set_t) + #define f_macro_limit_sets_t_increase_by(status, sets, amount) f_macro_memory_structure_increase_by(status, sets, f_limit_set_t, amount) + #define f_macro_limit_sets_t_decrease_by(status, sets, amount) f_macro_memory_structure_decrease_by(status, sets, f_limit_set_t, amount) + #define f_macro_limit_sets_t_decimate_by(status, sets, amount) f_macro_memory_structure_decimate_by(status, sets, f_limit_set_t, amount) #endif // _di_f_limit_sets_t_ #ifdef __cplusplus diff --git a/level_0/f_memory/c/memory-common.h b/level_0/f_memory/c/memory-common.h index ef63804..0c8dbdd 100644 --- a/level_0/f_memory/c/memory-common.h +++ b/level_0/f_memory/c/memory-common.h @@ -17,27 +17,15 @@ extern "C" { #endif /** - * Provide defines to alter compile time uses of certain memory functions. + * Check to make sure these two macros are not defined at the same time. * - * These are not intended as macros but are instead intended as a tool to automatically replace one function call with another (via the macro). - * - * If _f_memory_FORCE_secure_memory_ is defined, then all to-be removed address spaces are set to 0 before freeing or resizing. - * If _f_memory_FORCE_fast_memory_ is defined, then all to-be removed address spaces remain unchanged before freeing or resizing. + * If _f_memory_FORCE_secure_memory_ is defined, then all to-be deallocated address spaces are set to 0 before freeing or resizing. + * If _f_memory_FORCE_fast_memory_ is defined, then all to-be deallocated address spaces remain unchanged before freeing or resizing. */ -#ifdef _f_memory_FORCE_secure_memory_ - #define f_memory_delete(the_pointer, the_size, the_length) f_memory_destroy(the_pointer, the_size, the_length) - #define f_memory_resize(the_pointer, the_size, the_old_length, the_new_length) f_memory_adjust(the_pointer, the_size, the_old_length, the_new_length) - - #ifdef _f_memory_FORCE_fast_memory_ - #error You cannot define both _f_memory_FORCE_fast_memory_ and _f_memory_FORCE_secure_memory_ at the same time - #endif // _f_memory_FORCE_fast_memory_ +#if defined(_f_memory_FORCE_secure_memory_) && defined(_f_memory_FORCE_fast_memory_) + #error You cannot define both _f_memory_FORCE_fast_memory_ and _f_memory_FORCE_secure_memory_ at the same time. #endif // _f_memory_FORCE_secure_memory_ -#ifdef _f_memory_FORCE_fast_memory_ - #define f_memory_destroy(the_pointer, the_size, the_length) f_memory_delete(the_pointer, the_size, the_length) - #define f_memory_adjust(the_pointer, the_size, the_old_length, the_new_length) f_memory_resize(the_pointer, the_size, the_old_length, the_new_length) -#endif // _f_memory_FORCE_fast_memory_ - /** * Default allocation step. * @@ -68,21 +56,6 @@ extern "C" { #endif // _di_f_macro_memory_structure_clear_ /** - * Create a new generic memory structure. - * - * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. - * - * status: the status to return. - * structure: the structure to operate on. - * type: the structure type. - * length: the new size of the array. - */ -#ifndef _di_f_macro_memory_structure_new_ - #define f_macro_memory_structure_new(status, structure, type, length) \ - status = f_memory_structure_new(length, sizeof(type), (void **) &structure.array, &structure.used, &structure.size); -#endif // _di_f_macro_memory_structure_new_ - -/** * Resize a generic memory structure. * * status: the status to return. @@ -117,7 +90,7 @@ extern "C" { */ #ifndef _di_f_macro_memory_structure_delete_ #define f_macro_memory_structure_delete(status, structure, type) \ - status = f_memory_structure_delete(sizeof(type), (void **) &structure.array, &structure.used, &structure.size); + status = f_memory_structure_resize(0, sizeof(type), (void **) &structure.array, &structure.used, &structure.size); #endif // _di_f_macro_memory_structure_delete_ /** @@ -129,7 +102,7 @@ extern "C" { */ #ifndef _di_f_macro_memory_structure_destroy_ #define f_macro_memory_structure_destroy(status, structure, type) \ - status = f_memory_structure_destroy(sizeof(type), (void **) &structure.array, &structure.used, &structure.size); + status = f_memory_structure_adjust(0, sizeof(type), (void **) &structure.array, &structure.used, &structure.size); #endif // _di_f_macro_memory_structure_destroy_ /** @@ -140,7 +113,7 @@ extern "C" { */ #ifndef _di_f_macro_memory_structure_delete_simple_ #define f_macro_memory_structure_delete_simple(structure, type) \ - f_memory_structure_delete(sizeof(type), (void **) &structure.array, &structure.used, &structure.size); + f_memory_structure_resize(0, sizeof(type), (void **) &structure.array, &structure.used, &structure.size); #endif // _di_f_macro_memory_structure_delete_simple_ /** @@ -151,7 +124,7 @@ extern "C" { */ #ifndef _di_f_macro_memory_structure_destroy_simple_ #define f_macro_memory_structure_destroy_simple(structure, type) \ - f_memory_structure_destroy(sizeof(type), (void **) &structure.array, &structure.used, &structure.size); + f_memory_structure_adjust(0, sizeof(type), (void **) &structure.array, &structure.used, &structure.size); #endif // _di_f_macro_memory_structure_destroy_simple_ /** @@ -220,26 +193,6 @@ extern "C" { #endif // _di_f_macro_memory_structures_clear_ /** - * Create a new generic memory structures. - * - * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. - * - * status: the status to return. - * structures: the structures to operate on. - * type_stuctures: the structures type. - * length: the new size of the array. - */ -#ifndef _di_f_macro_memory_structures_new_ - #define f_macro_memory_structures_new(status, structures, type_structures, length) \ - f_macro_memory_structures_clear(structures) \ - status = f_memory_new((void **) & structures.array, sizeof(type_structures), length); \ - if (status == F_none) { \ - structures.size = length; \ - structures.used = 0; \ - } -#endif // _di_f_macro_memory_structures_new_ - -/** * Resize a generic memory structures. * * status: the status to return. @@ -253,16 +206,12 @@ extern "C" { #define f_macro_memory_structures_resize(status, structures, type_structure, type_structures, length, type_length) \ status = F_none; \ if (length < structures.size) { \ - for (type_length _macro__i = structures.size - length; _macro__i < structures.size; ++_macro__i) { \ - f_macro_memory_structure_delete(status, structures.array[_macro__i], type_structure); \ - if (status != F_none) break; \ + for (register type_length _macro__i = structures.size - length; _macro__i < structures.size; ++_macro__i) { \ + status = f_memory_structure_resize(0, sizeof(type_structure), (void **) &structures.array[_macro__i].array, &structures.array[_macro__i].used, &structures.array[_macro__i].size); \ + if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(type_structures), structures.size, length); \ - if (status == F_none) { \ - structures.size = length; \ - if (structures.used > structures.size) structures.used = length; \ - } + if (F_status_is_error_not(status)) status = f_memory_structure_resize(0, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_resize_ /** @@ -279,16 +228,12 @@ extern "C" { #define f_macro_memory_structures_adjust(status, structures, type_structure, type_structures, length, type_length) \ status = F_none; \ if (length < structures.size) { \ - for (type_length _macro__i = structures.size - length; _macro__i < structures.size; ++_macro__i) { \ - f_macro_memory_structure_destroy(status, structures.array[_macro__i], type_structure); \ - if (status != F_none) break; \ + for (register type_length _macro__i = structures.size - length; _macro__i < structures.size; ++_macro__i) { \ + status = f_memory_structure_adjust(0, sizeof(type_structure), (void **) &structures.array[_macro__i].array, &structures.array[_macro__i].used, &structures.array[_macro__i].size); \ + if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(type_structures), structures.size, length); \ - if (status == F_none) { \ - structures.size = length; \ - if (structures.used > structures.size) structures.used = length; \ - } + if (F_status_is_error_not(status)) status = f_memory_structure_adjust(0, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_adjust_ /** @@ -301,15 +246,13 @@ extern "C" { */ #ifndef _di_f_macro_memory_structures_delete_ #define f_macro_memory_structures_delete(status, structures, type_structure, type_structures) \ - status = F_none; \ structures.used = structures.size; \ while (structures.used) { \ structures.used--; \ - f_macro_memory_structure_delete(status, structures.array[structures.used], type_structure); \ - if (status != F_none) break; \ + status = f_memory_structure_resize(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \ + if (F_status_is_error(status)) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & structures.array, sizeof(type_structures), structures.size); \ - if (status == F_none) structures.size = 0; + if (F_status_is_error_not(status)) status = f_memory_structure_resize(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_delete_ /** @@ -322,15 +265,13 @@ extern "C" { */ #ifndef _di_f_macro_memory_structures_destroy_ #define f_macro_memory_structures_destroy(status, structures, type_structure, type_structures) \ - status = F_none; \ structures.used = structures.size; \ while (structures.used) { \ structures.used--; \ - f_macro_memory_structure_destroy(status, structures.array[structures.used], type_structure); \ - if (status != F_none) break; \ + status = f_memory_structure_adjust(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \ + if (F_status_is_error(status)) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & structures.array, sizeof(type_structures), structures.size); \ - if (status == F_none) structures.size = 0; + if (F_status_is_error_not(status)) status = f_memory_structure_adjust(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_destroy_ /** @@ -345,10 +286,9 @@ extern "C" { structures.used = structures.size; \ while (structures.used) { \ structures.used--; \ - f_macro_memory_structure_delete_simple(structures.array[structures.used], type_structure); \ + f_memory_structure_resize(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \ } \ - f_memory_delete((void **) & structures.array, sizeof(type_structures), structures.size); \ - structures.size = 0; + f_memory_structure_resize(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_delete_simple_ /** @@ -363,10 +303,9 @@ extern "C" { structures.used = structures.size; \ while (structures.used) { \ structures.used--; \ - f_macro_memory_structure_destroy_simple(structures.array[structures.used], type_structure); \ + f_memory_structure_adjust(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \ } \ - f_memory_destroy((void **) & structures.array, sizeof(type_structures), structures.size); \ - structures.size = 0; + f_memory_structure_adjust(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_destroy_simple_ /** @@ -381,25 +320,7 @@ extern "C" { */ #ifndef _di_f_macro_memory_structures_increase_ #define f_macro_memory_structures_increase(status, structures, type_structures, type_length) \ - status = F_none; \ - if (structures.used + 1 > structures.size) { \ - type_length _macro__length = structures.used + f_memory_default_allocation_step; \ - if (_macro__length > f_array_length_t_size) { \ - if (structures.used + 1 > f_array_length_t_size) { \ - status = F_status_set_error(F_array_too_large); \ - } \ - else { \ - _macro__length = f_array_length_t_size; \ - } \ - } \ - if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(type_structures), structures.size, _macro__length); \ - if (status == F_none) { \ - structures.size = _macro__length; \ - } \ - } \ - else { \ - status = F_data_not; \ - } + status = f_memory_structure_increase(sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_increase_ /** @@ -415,19 +336,7 @@ extern "C" { */ #ifndef _di_f_macro_memory_structures_increase_by_ #define f_macro_memory_structures_increase_by(status, structures, type_structures, type_length, amount) \ - status = F_none; \ - if (structures.used + amount > structures.size) { \ - if (amount > f_array_length_t_size) { \ - status = F_status_set_error(F_array_too_large); \ - } \ - if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(type_structures), structures.size, amount); \ - if (status == F_none) { \ - structures.size = amount; \ - } \ - } \ - else { \ - status = F_data_not; \ - } + status = f_memory_structure_increase_by(amount, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_increase_by_ /** @@ -437,28 +346,15 @@ extern "C" { * structures: the structures to operate on. * type_stucture: the structure type. * type_stuctures: the structures type. - * amount: the amount to decrease by. * type_length: the data type of the length variable type. + * amount: the amount to decrease by. */ #ifndef _di_f_macro_memory_structures_decrease_by_ - #define f_macro_memory_structures_decrease_by(status, structures, type_structure, type_structures, amount, type_length) \ - if (amount) { \ - status = F_none; \ - if (amount <= structures.size) { \ - type_length _macro__length = structures.size - amount; \ - f_macro_memory_structures_resize(status, structures, type_structure, type_structures, _macro__length, type_length); \ - } \ - else { \ - f_macro_memory_structures_delete(status, structures, type_structure, type_structures); \ - if (status == F_none) { \ - structures.used = 0; \ - structures.size = 0; \ - } \ - } \ + #define f_macro_memory_structures_decrease_by(status, structures, type_structure, type_structures, type_length, amount) \ + if (amount && structures.size) { \ + f_macro_memory_structures_resize(status, structures, type_structure, type_structures, (amount < structures.size ? structures.size - amount : 0), type_length); \ } \ - else { \ - status = F_data_not; \ - } + status = f_memory_structure_decrease_by(amount, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_decrease_by_ /** @@ -468,28 +364,15 @@ extern "C" { * structures: the structures to operate on. * type_stucture: the structure type. * type_stuctures: the structures type. - * amount: the amount to decimate by. * type_length: the data type of the length variable type. + * amount: the amount to decimate by. */ #ifndef _di_f_macro_memory_structures_decimate_by_ - #define f_macro_memory_structures_decimate_by(status, structures, type_structure, type_structures, amount, type_length) \ - if (amount) { \ - status = F_none; \ - if (amount <= structures.size) { \ - type_length _macro__length = structures.size - amount; \ - f_macro_memory_structures_adjust(status, structures, type_structure, type_structures, _macro__length, type_length); \ - } \ - else { \ - f_macro_memory_structures_destroy(status, structures, type_structure, type_structures); \ - if (status == F_none) { \ - structures.used = 0; \ - structures.size = 0; \ - } \ - } \ + #define f_macro_memory_structures_decimate_by(status, structures, type_structure, type_structures, type_length, amount) \ + if (amount && structures.size) { \ + f_macro_memory_structures_adjust(status, structures, type_structure, type_structures, (amount < structures.size ? structures.size - amount : 0), type_length); \ } \ - else { \ - status = F_data_not; \ - } + status = f_memory_structure_decimate_by(amount, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size); #endif // _di_f_macro_memory_structures_decimate_by_ /** diff --git a/level_0/f_memory/c/memory.c b/level_0/f_memory/c/memory.c index e2de9ce..80529e4 100644 --- a/level_0/f_memory/c/memory.c +++ b/level_0/f_memory/c/memory.c @@ -8,9 +8,7 @@ extern "C" { #ifndef _di_f_memory_adjust_ f_status_t f_memory_adjust(void **pointer, const size_t size, const size_t old_length, const size_t new_length) { #ifndef _di_level_0_parameter_checking_ - if (size <= 0) return F_status_set_error(F_parameter); - if (old_length < 0) return F_status_set_error(F_parameter); - if (new_length < 0) return F_status_set_error(F_parameter); + if (!size) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -20,34 +18,7 @@ extern "C" { return private_f_memory_adjust(old_length, new_length, size, pointer); #endif // _f_memory_FORCE_fast_memory_ } -#endif // _di_f_memory_adjust_ - -#ifndef _di_f_memory_new_aligned_ - f_status_t f_memory_new_aligned(void **pointer, const size_t alignment, const size_t length) { - #ifndef _di_level_0_parameter_checking_ - if (alignment <= 0) return F_status_set_error(F_parameter); - if (length <= 0) return F_status_set_error(F_parameter); - if (!pointer) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - // prevent double-allocations. - if (*pointer || length == 0) return F_none; - - const int result = posix_memalign(pointer, alignment, length); - - if (result) { - if (result == EINVAL) return F_status_set_error(F_parameter); - - return F_status_set_error(F_memory_not); - } - - // uint8_t * is of a data size size of 1, casting it to uint8_t should result in a single-length increment. - // this is done to avoid problems with (void *) having arithmetic issues. - memset(((uint8_t *) *pointer), 0, length); - - return F_none; - } -#endif // _di_f_memory_new_aligned_ +#endif // _di_f_memory_adjust_-#ifndef _di_f_memory_delete_ #ifndef _di_f_memory_delete_ f_status_t f_memory_delete(void **pointer, const size_t size, const size_t length) { @@ -56,10 +27,10 @@ extern "C" { #endif // _di_level_0_parameter_checking_ // prevent double-frees. - if (!*pointer || !size || !length) return F_none; + if (!*pointer || !size) return F_data_not; #ifdef _f_memory_FORCE_secure_memory_ - if (length > 0) { + if (!length) { memset(*pointer, 0, size * length); } #endif // _f_memory_FORCE_secure_memory_ @@ -76,16 +47,15 @@ extern "C" { #ifndef _di_f_memory_destroy_ f_status_t f_memory_destroy(void **pointer, const size_t size, const size_t length) { #ifndef _di_level_0_parameter_checking_ - if (length < 0) return F_status_set_error(F_parameter); - if (size <= 0) return F_status_set_error(F_parameter); + if (!size) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ // prevent double-frees. - if (!*pointer || !length) return F_none; + if (!*pointer) return F_data_not; #ifndef _f_memory_FORCE_fast_memory_ - if (length > 0) { + if (!length) { memset(*pointer, 0, size * length); } #endif // _f_memory_FORCE_fast_memory_ @@ -102,13 +72,12 @@ extern "C" { #ifndef _di_f_memory_new_ f_status_t f_memory_new(void **pointer, const size_t size, const size_t length) { #ifndef _di_level_0_parameter_checking_ - if (size <= 0) return F_status_set_error(F_parameter); - if (length <= 0) return F_status_set_error(F_parameter); + if (!size) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ // prevent double-allocations. - if (*pointer || length == 0) return F_none; + if (*pointer || !length) return F_data_not; // Some people use malloc(size * length) to produce the same results. // This has been observed to sometimes causes an increase in L1/L2 cache misses (0.02% L1 increase, 0.01% L2 increase). @@ -127,12 +96,37 @@ extern "C" { } #endif // _di_f_memory_new_ + +#ifndef _di_f_memory_new_aligned_ + f_status_t f_memory_new_aligned(void **pointer, const size_t alignment, const size_t length) { + #ifndef _di_level_0_parameter_checking_ + if (!alignment) return F_status_set_error(F_parameter); + if (!pointer) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + // prevent double-allocations. + if (*pointer || !length) return F_data_not; + + const int result = posix_memalign(pointer, alignment, length); + + if (result) { + if (result == EINVAL) return F_status_set_error(F_parameter); + + return F_status_set_error(F_memory_not); + } + + // uint8_t * is of a data size size of 1, casting it to uint8_t should result in a single-length increment. + // this is done to avoid problems with (void *) having arithmetic issues. + memset(((uint8_t *) *pointer), 0, length); + + return F_none; + } +#endif // _di_f_memory_new_aligned_ + #ifndef _di_f_memory_resize_ f_status_t f_memory_resize(void **pointer, const size_t size, const size_t old_length, const size_t new_length) { #ifndef _di_level_0_parameter_checking_ - if (size <= 0) return F_status_set_error(F_parameter); - if (old_length < 0) return F_status_set_error(F_parameter); - if (new_length < 0) return F_status_set_error(F_parameter); + if (!size) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ diff --git a/level_0/f_memory/c/memory.h b/level_0/f_memory/c/memory.h index 3d02a6d..4b088c0 100644 --- a/level_0/f_memory/c/memory.h +++ b/level_0/f_memory/c/memory.h @@ -21,7 +21,6 @@ // fll-0 includes #include -#include #include // fll-0 memory includes @@ -48,6 +47,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there was nothing to do. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * @@ -60,31 +61,6 @@ extern "C" { #endif // _di_f_memory_adjust_ /** - * Create some dynamically allocated array of some length, guaranteeing aligned memory. - * - * @param pointer - * A pointer that will be updated to the address of the newly allocated memory. - * @param alignment - * The size of the alignment, such as sizeof(void *). - * Must be greater than 0. - * @param length - * The total number of blocks to be allocated. - * Must be greater than 0. - * Must be a multiple of alignment. - * - * @return - * F_none on success. - * F_memory_not (with error bit) on allocation error. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see posix_memalign() - * @see memset() - */ -#ifndef _di_f_memory_new_aligned_ - extern f_status_t f_memory_new_aligned(void **pointer, const size_t alignment, const size_t length); -#endif // _di_f_memory_new_aligned_ - -/** * Delete dynamically allocated data. * * Will not change any of the data to 0 prior to deallocation. @@ -102,6 +78,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there was nothing to do. + * * F_parameter (with error bit) if a parameter is invalid. * * @see free() @@ -126,6 +104,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there was nothing to do. + * * F_parameter (with error bit) if a parameter is invalid. * * @see free() @@ -149,6 +129,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there was nothing to do. + * * F_memory_not (with error bit) on allocation error. * F_parameter (with error bit) if a parameter is invalid. * @@ -160,6 +142,33 @@ extern "C" { #endif // _di_f_memory_new_ /** + * Create some dynamically allocated array of some length, guaranteeing aligned memory. + * + * @param pointer + * A pointer that will be updated to the address of the newly allocated memory. + * @param alignment + * The size of the alignment, such as sizeof(void *). + * Must be greater than 0. + * @param length + * The total number of blocks to be allocated. + * Must be greater than 0. + * Must be a multiple of alignment. + * + * @return + * F_none on success. + * F_data_not on success, but there was nothing to do. + * + * F_memory_not (with error bit) on allocation error. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see posix_memalign() + * @see memset() + */ +#ifndef _di_f_memory_new_aligned_ + extern f_status_t f_memory_new_aligned(void **pointer, const size_t alignment, const size_t length); +#endif // _di_f_memory_new_aligned_ + +/** * Resize dynamically allocated data. * * Will not change any of the data prior to deallocation. @@ -175,6 +184,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there was nothing to do. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * diff --git a/level_0/f_memory/c/memory_structure.c b/level_0/f_memory/c/memory_structure.c index c98212e..6b65968 100644 --- a/level_0/f_memory/c/memory_structure.c +++ b/level_0/f_memory/c/memory_structure.c @@ -27,7 +27,7 @@ extern "C" { if (!size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (amount) { + if (amount && *size) { return private_f_memory_structure_adjust(amount <= *size ? *size - amount : 0, type_size, structure, used, size); } @@ -44,7 +44,7 @@ extern "C" { if (!size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (amount) { + if (amount && *size) { return private_f_memory_structure_resize(amount <= *size ? *size - amount : 0, type_size, structure, used, size); } @@ -52,32 +52,6 @@ extern "C" { } #endif // _di_f_memory_structure_decrease_by_ -#ifndef _di_f_memory_structure_delete_ - f_status_t f_memory_structure_delete(const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) { - #ifndef _di_level_0_parameter_checking_ - if (!type_size) return F_status_set_error(F_parameter); - if (!structure) return F_status_set_error(F_parameter); - if (!used) return F_status_set_error(F_parameter); - if (!size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_memory_structure_resize(0, type_size, structure, used, size); - } -#endif // _di_f_memory_structure_delete_ - -#ifndef _di_f_memory_structure_destroy_ - f_status_t f_memory_structure_destroy(const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) { - #ifndef _di_level_0_parameter_checking_ - if (!type_size) return F_status_set_error(F_parameter); - if (!structure) return F_status_set_error(F_parameter); - if (!used) return F_status_set_error(F_parameter); - if (!size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_memory_structure_adjust(0, type_size, structure, used, size); - } -#endif // _di_f_memory_structure_destroy_ - #ifndef _di_f_memory_structure_increase_ f_status_t f_memory_structure_increase(const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) { #ifndef _di_level_0_parameter_checking_ @@ -101,7 +75,7 @@ extern "C" { return private_f_memory_structure_resize(length_new, type_size, structure, used, size); } - return F_none; + return F_data_not; } #endif // _di_f_memory_structure_increase_ @@ -114,10 +88,6 @@ extern "C" { if (!size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (!amount) { - return F_data_not; - } - if (*used + amount > *size) { if (*used + amount > f_array_length_t_size) { return F_status_set_error(F_array_too_large); @@ -126,28 +96,10 @@ extern "C" { return private_f_memory_structure_resize(*used + amount, type_size, structure, used, size); } - return F_none; + return F_data_not; } #endif // _di_f_memory_structure_increase_by_ -#ifndef _di_f_memory_structure_new_ - f_status_t f_memory_structure_new(const size_t length_new, const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) { - #ifndef _di_level_0_parameter_checking_ - if (!type_size) return F_status_set_error(F_parameter); - if (!length_new) return F_status_set_error(F_parameter); - if (!structure) return F_status_set_error(F_parameter); - if (!used) return F_status_set_error(F_parameter); - if (!size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - *structure = 0; - *size = 0; - *used = 0; - - return private_f_memory_structure_resize(length_new, type_size, structure, used, size); - } -#endif // _di_f_memory_structure_new_ - #ifndef _di_f_memory_structure_resize_ f_status_t f_memory_structure_resize(const size_t length_new, const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) { #ifndef _di_level_0_parameter_checking_ diff --git a/level_0/f_memory/c/memory_structure.h b/level_0/f_memory/c/memory_structure.h index 581d5a8..518c772 100644 --- a/level_0/f_memory/c/memory_structure.h +++ b/level_0/f_memory/c/memory_structure.h @@ -67,7 +67,7 @@ extern "C" { * * @return * F_none on success. - * F_data_not on success, but amount is 0 so there is nothing to do. + * F_data_not on success, but there is no reason to decimate size (amount = 0 or size = 0). * * F_memory_not (with error bit) on out of memory. * @@ -99,7 +99,7 @@ extern "C" { * * @return * F_none on success. - * F_data_not on success, but amount is 0 so there is nothing to do. + * F_data_not on success, but there is no reason to decrease size (amount = 0 or size = 0). * * F_memory_not (with error bit) on allocation error. * @@ -112,64 +112,6 @@ extern "C" { #endif // _di_f_memory_structure_decrease_by_ /** - * Delete the structure. - * - * Memory being deleted will not be wiped. - * - * @param type_size - * The size of the structure type (such as: sizeof(structure_size)). - * Must be greater than 0. - * @param structure - * The structure to delete. - * @param used - * The amount of data used by the structure. - * @param size - * The amount of data allocated to the structure. - * - * @return - * F_none on success. - * F_data_not on success, but amount is 0 so there is nothing to do. - * - * F_memory_not (with error bit) on allocation error. - * - * @see calloc() - * @see free() - * @see memset() - */ -#ifndef _di_f_memory_structure_delete_ - extern f_status_t f_memory_structure_delete(const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size); -#endif // _di_f_memory_structure_delete_ - -/** - * Destroy the structure. - * - * Memory being deleted will be wiped. - * - * @param type_size - * The size of the structure type (such as: sizeof(structure_size)). - * Must be greater than 0. - * @param structure - * The structure to delete. - * @param used - * The amount of data used by the structure. - * @param size - * The amount of data allocated to the structure. - * - * @return - * F_none on success. - * F_data_not on success, but amount is 0 so there is nothing to do. - * - * F_memory_not (with error bit) on allocation error. - * - * @see calloc() - * @see free() - * @see memset() - */ -#ifndef _di_f_memory_structure_destroy_ - extern f_status_t f_memory_structure_destroy(const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size); -#endif // _di_f_memory_structure_destroy_ - -/** * Increase the size of the structure, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -187,7 +129,9 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on allocation error. * * @see calloc() @@ -219,8 +163,9 @@ extern "C" { * * @return * F_none on success. - * F_data_not on success, but amount is 0 so there is nothing to do. + * F_data_not on success, but there is no reason to increase size (amount = 0 or used + 1 <= size). * + * F_array_too_large (with error bit) if the new array length is too large. * F_memory_not (with error bit) on allocation error. * * @see calloc() @@ -232,38 +177,6 @@ extern "C" { #endif // _di_f_memory_structure_increase_by_ /** - * Initialize a new structure. - * - * The structure will be cleared before making changes. - * Be sure any existing data is deallocation as necessary. - * - * @param length_new - * The new size of the structure array. - * Must be greater than 0. - * @param type_size - * The size of the structure type (such as: sizeof(structure_size)). - * Must be greater than 0. - * @param structure - * The structure to delete. - * @param used - * The amount of data used by the structure. - * @param size - * The amount of data allocated to the structure. - * - * @return - * F_none on success. - * - * F_memory_not (with error bit) on allocation error. - * - * @see calloc() - * @see free() - * @see memset() - */ -#ifndef _di_f_memory_structure_new_ - extern f_status_t f_memory_structure_new(const size_t length_new, const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size); -#endif // _di_f_memory_structure_new_ - -/** * Resize the structure. * * Memory being deleted will not be wiped. diff --git a/level_0/f_memory/c/private-memory.c b/level_0/f_memory/c/private-memory.c index e618d6a..98e193e 100644 --- a/level_0/f_memory/c/private-memory.c +++ b/level_0/f_memory/c/private-memory.c @@ -5,11 +5,11 @@ extern "C" { #endif -#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_) || !defined(_di_f_memory_structure_decimate_by_) || !defined(_di_f_memory_structure_destroy_) +#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) f_status_t private_f_memory_adjust(const size_t length_old, const size_t length_new, const size_t type_size, void **pointer) { if (length_old == length_new) { - return F_none; + return F_data_not; } if (*pointer) { @@ -59,18 +59,18 @@ extern "C" { } } else { - return F_none; + return F_data_not; } return F_status_set_error(F_memory_not); } -#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_) || !defined(_di_f_memory_structure_decimate_by_) || !defined(_di_f_memory_structure_destroy_) +#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) -#if !defined(_di_memory_structure_decrease_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_delete_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_new_) || !defined(_di_f_memory_structure_resize_) +#if !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_) f_status_t private_f_memory_resize(const size_t length_old, const size_t length_new, const size_t type_size, void **pointer) { if (length_old == length_new) { - return F_none; + return F_data_not; } if (*pointer) { @@ -111,19 +111,19 @@ extern "C" { } } else { - return F_none; + return F_data_not; } return F_status_set_error(F_memory_not); } -#endif // !defined(_di_memory_structure_decrease_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_delete_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_new_) || !defined(_di_f_memory_structure_resize_) +#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_) -#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_) || !defined(_di_f_memory_structure_decimate_by_) || !defined(_di_f_memory_structure_destroy_) +#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) f_status_t private_f_memory_structure_adjust(const size_t length_new, const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) { const f_status_t status = private_f_memory_adjust(*size, length_new, type_size, structure); - if (status == F_none) { + if (F_status_is_error_not(status)) { *size = length_new; if (*used > *size) { @@ -133,14 +133,14 @@ extern "C" { return status; } -#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_) || !defined(_di_f_memory_structure_decimate_by_) || !defined(_di_f_memory_structure_destroy_) +#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) -#if !defined(_di_memory_structure_decrease_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_delete_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_new_) || !defined(_di_f_memory_structure_resize_) +#if !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_) f_status_t private_f_memory_structure_resize(const size_t length_new, const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) { const f_status_t status = private_f_memory_resize(*size, length_new, type_size, structure); - if (status == F_none) { + if (F_status_is_error_not(status)) { *size = length_new; if (*used > *size) { @@ -150,7 +150,7 @@ extern "C" { return status; } -#endif // !defined(_di_memory_structure_decrease_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_delete_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_new_) || !defined(_di_f_memory_structure_resize_) +#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_) #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_memory/c/private-memory.h b/level_0/f_memory/c/private-memory.h index 4e546f6..b721d3b 100644 --- a/level_0/f_memory/c/private-memory.h +++ b/level_0/f_memory/c/private-memory.h @@ -33,6 +33,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is nothing to do (length_old = length_new). * * F_memory_not (with error bit) on allocation error. * @@ -41,13 +42,11 @@ extern "C" { * @see memset() * * @see f_memory_structure_adjust() - * @see f_memory_structure_decimate() * @see f_memory_structure_decimate_by() - * @see f_memory_structure_destroy() */ -#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_) || !defined(_di_f_memory_structure_decimate_by_) || !defined(_di_f_memory_structure_destroy_) +#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) extern f_status_t private_f_memory_adjust(const size_t length_old, const size_t length_new, const size_t type_size, void **pointer) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_) || !defined(_di_f_memory_structure_decimate_by_) || !defined(_di_f_memory_structure_destroy_) +#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) /** * Private implementation for resizing. @@ -67,6 +66,7 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is nothing to do (length_old = length_new). * * F_memory_not (with error bit) on allocation error. * @@ -75,17 +75,15 @@ extern "C" { * @see memset() * * @see f_memory_structure_decrease_by() - * @see f_memory_structure_delete() * @see f_memory_structure_increase() * @see f_memory_structure_increase_by() - * @see f_memory_structure_new() * @see f_memory_structure_resize() * * @see private_f_memory_structure_resize() */ -#if !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_delete_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_new_) || !defined(_di_f_memory_structure_resize_) +#if !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_) extern f_status_t private_f_memory_resize(const size_t length_old, const size_t length_new, const size_t type_size, void **pointer) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_delete_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_new_) || !defined(_di_f_memory_structure_resize_) +#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_) /** * Private implementation for resizing a structure. @@ -111,13 +109,12 @@ extern "C" { * * @see f_memory_structure_adjust() * @see f_memory_structure_decimate_by() - * @see f_memory_structure_destroy() * * @see private_f_memory_adjust() */ -#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) || !defined(_di_f_memory_structure_destroy_) +#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) f_status_t private_f_memory_structure_adjust(const size_t length_new, const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) || !defined(_di_f_memory_structure_destroy_) +#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_) /** * Private implementation for resizing a structure. @@ -142,17 +139,15 @@ extern "C" { * Errors (with error bit) from: private_f_memory_structure_resize(). * * @see f_memory_structure_decrease_by() - * @see f_memory_structure_delete() * @see f_memory_structure_increase() * @see f_memory_structure_increase_by() - * @see f_memory_structure_new() * @see f_memory_structure_resize() * * @see private_f_memory_resize() */ -#if !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_delete_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_new_) || !defined(_di_f_memory_structure_resize_) +#if !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_) f_status_t private_f_memory_structure_resize(const size_t length_new, const size_t type_size, void **structure, f_array_length_t *used, f_array_length_t *size) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_delete_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_new_) || !defined(_di_f_memory_structure_resize_) +#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_) #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_path/c/path.c b/level_0/f_path/c/path.c index 2e173c5..18bd1b3 100644 --- a/level_0/f_path/c/path.c +++ b/level_0/f_path/c/path.c @@ -78,7 +78,8 @@ extern "C" { if (length + 1 > path->size) { f_status_t status = F_none; - f_macro_string_dynamic_t_new(status, (*path), length + 1); + f_macro_string_dynamic_t_clear((*path)) + f_macro_string_dynamic_t_resize(status, (*path), length + 1) 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 a658de4..37e6724 100644 --- a/level_0/f_serialize/c/serialize.c +++ b/level_0/f_serialize/c/serialize.c @@ -69,7 +69,8 @@ extern "C" { } if (total > strings->array[strings->used].size) { - f_macro_string_dynamic_t_new(status, strings->array[strings->used], total); + f_macro_string_dynamic_t_clear(strings->array[strings->used]) + f_macro_string_dynamic_t_resize(status, strings->array[strings->used], total) if (F_status_is_error(status)) return status; strings->array[strings->used].size = total; diff --git a/level_0/f_status/c/status_array.h b/level_0/f_status/c/status_array.h index f034890..e2e99b7 100644 --- a/level_0/f_status/c/status_array.h +++ b/level_0/f_status/c/status_array.h @@ -36,54 +36,18 @@ extern "C" { #define f_statuss_t_initialize { 0, 0, 0 } - #define f_macro_statuss_t_clear(statuss) f_macro_memory_structure_clear(statuss); + #define f_macro_statuss_t_clear(statuss) f_macro_memory_structure_clear(statuss) - #define f_macro_statuss_t_new(status, statuss, length) f_macro_memory_structure_new(status, statuss, f_status_t, length); + #define f_macro_statuss_t_resize(status, statuss, length) f_macro_memory_structure_resize(status, statuss, f_status_t, length) + #define f_macro_statuss_t_adjust(status, statuss, length) f_macro_memory_structure_adjust(status, statuss, f_status_t, length) - #define f_macro_statuss_t_resize(status, statuss, length) f_macro_memory_structure_resize(status, statuss, f_status_t, length); - #define f_macro_statuss_t_adjust(status, statuss, length) f_macro_memory_structure_adjust(status, statuss, f_status_t, length); + #define f_macro_statuss_t_delete_simple(statuss) f_macro_memory_structure_delete_simple(statuss, f_status_t) + #define f_macro_statuss_t_destroy_simple(statuss) f_macro_memory_structure_destroy_simple(statuss, f_status_t) - #define f_macro_statuss_t_delete(status, statuss) f_macro_memory_structure_delete(status, statuss, f_status_t); - #define f_macro_statuss_t_destroy(status, statuss) f_macro_memory_structure_destroy(status, statuss, f_status_t); - - #define f_macro_statuss_t_delete_simple(statuss) f_macro_memory_structure_delete_simple(statuss, f_status_t); - #define f_macro_statuss_t_destroy_simple(statuss) f_macro_memory_structure_destroy_simple(statuss, f_status_t); - - #define f_macro_statuss_t_increase(status, statuss) f_macro_memory_structure_increase(status, statuss, f_status_t); - #define f_macro_statuss_t_increase_by(status, statuss, amount) f_macro_memory_structure_increase_by(status, statuss, f_status_t, amount); - #define f_macro_statuss_t_decrease_by(status, statuss, amount) f_macro_memory_structure_decrease_by(status, statuss, f_status_t, amount); - #define f_macro_statuss_t_decimate_by(status, statuss, amount) f_macro_memory_structure_decimate_by(status, statuss, f_status_t, amount); -#endif // _di_f_statuss_t_ - -/** - * An array of an array of status codes. - * - * array: the array of an array of status codes. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_f_statusss_t_ - typedef struct { - f_statuss_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_statusss_t; - - #define f_statusss_t_initialize { 0, 0, 0 } - - #define f_macro_statusss_t_clear(statusss) f_macro_memory_structures_clear(statusss); - - #define f_macro_statusss_t_new(status, statusss, length) f_macro_memory_structures_new(status, statusss, f_status_t, f_statuss_t, length); - - #define f_macro_statusss_t_resize(status, statusss, length) f_macro_memory_structures_resize(status, statusss, f_status_t, f_statuss_t, length, f_array_length_t); - #define f_macro_statusss_t_adjust(status, statusss, length) f_macro_memory_structures_adjust(status, statusss, f_status_t, f_statuss_t, length, f_array_length_t); - - #define f_macro_statusss_t_delete(status, statusss) f_macro_memory_structures_delete(status, statusss, f_status_t, f_statuss_t); - #define f_macro_statusss_t_destroy(status, statusss) f_macro_memory_structures_destroy(status, statusss, f_status_t, f_statuss_t); - - #define f_macro_statusss_t_delete_simple(statusss) f_macro_memory_structures_delete_simple(statusss, f_status_t, f_statuss_t); - #define f_macro_statusss_t_destroy_simple(statusss) f_macro_memory_structures_destroy_simple(statusss, f_status_t, f_statuss_t); + #define f_macro_statuss_t_increase(status, statuss) f_macro_memory_structure_increase(status, statuss, f_status_t) + #define f_macro_statuss_t_increase_by(status, statuss, amount) f_macro_memory_structure_increase_by(status, statuss, f_status_t, amount) + #define f_macro_statuss_t_decrease_by(status, statuss, amount) f_macro_memory_structure_decrease_by(status, statuss, f_status_t, amount) + #define f_macro_statuss_t_decimate_by(status, statuss, amount) f_macro_memory_structure_decimate_by(status, statuss, f_status_t, amount) #endif // _di_f_statuss_t_ #ifdef __cplusplus diff --git a/level_0/f_string/c/private-string.c b/level_0/f_string/c/private-string.c index 60d13a0..d9b06d3 100644 --- a/level_0/f_string/c/private-string.c +++ b/level_0/f_string/c/private-string.c @@ -6,10 +6,17 @@ extern "C" { #endif #if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) - f_status_t private_f_string_dynamic_adjust(const f_string_length_t length, f_string_dynamic_t *string) { - f_status_t status = F_none; + f_status_t private_f_string_dynamic_adjust(const f_string_length_t length, f_string_dynamic_t *dynamic) { + + f_status_t status = f_memory_adjust((void **) & dynamic->string, sizeof(f_string_t), dynamic->size, length); + + if (F_status_is_error_not(status)) { + dynamic->size = length; - f_macro_string_dynamic_t_adjust(status, (*string), length); + if (dynamic->used > dynamic->size) { + dynamic->used = length; + } + } return status; } @@ -17,10 +24,9 @@ extern "C" { #if !defined(_di_f_string_append_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_mash_) f_status_t private_f_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - f_status_t status = F_none; if (destination->used + length > destination->size) { - status = private_f_string_dynamic_increase_by(length, destination); + const f_status_t status = private_f_string_dynamic_increase_by(length, destination); if (F_status_is_error(status)) return status; } @@ -83,130 +89,191 @@ extern "C" { } #endif // !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_mash_nulless_) -#if !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_delete_) - f_status_t private_f_string_dynamic_delete(f_string_dynamic_t *string) { - f_status_t status = F_none; - - f_macro_string_dynamic_t_delete(status, (*string)); - - return status; - } -#endif // !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_delete_) - -#if !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamic_delete_) - f_status_t private_f_string_dynamic_destroy(f_string_dynamic_t *string) { - f_status_t status = F_none; - - f_macro_string_dynamic_t_destroy(status, (*string)); - - return status; - } -#endif // !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamic_delete_) - #if !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_append_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) - f_status_t private_f_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *string) { + f_status_t private_f_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *dynamic) { - if (string->used + amount > string->size) { - if (string->used + amount > f_string_length_t_size) { + if (dynamic->used + amount > dynamic->size) { + if (dynamic->used + amount > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - return private_f_string_dynamic_resize(string->used + amount, string); + return private_f_string_dynamic_resize(dynamic->used + amount, dynamic); } - return F_none; + return F_data_not; } #endif // !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_append_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) #if !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) - f_status_t private_f_string_dynamic_resize(const f_string_length_t length, f_string_dynamic_t *string) { - f_status_t status = F_none; + f_status_t private_f_string_dynamic_resize(const f_string_length_t length, f_string_dynamic_t *dynamic) { - f_macro_string_dynamic_t_resize(status, (*string), length); + const f_status_t status = f_memory_resize((void **) & dynamic->string, sizeof(f_string_t), dynamic->size, length); + + if (F_status_is_error_not(status)) { + dynamic->size = length; + + if (dynamic->used > dynamic->size) { + dynamic->used = length; + } + } return status; } #endif // !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) #if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_decimate_by_) - f_status_t private_f_string_dynamics_adjust(const f_string_length_t length, f_string_dynamics_t *strings) { + f_status_t private_f_string_dynamics_adjust(const f_string_length_t length, f_string_dynamics_t *dynamics) { f_status_t status = F_none; - f_macro_string_dynamics_t_adjust(status, (*strings), length); + for (f_array_length_t i = length; i < dynamics->size; ++i) { + status = private_f_string_dynamic_adjust(0, &dynamics->array[i]); + if (F_status_is_error(status)) return status; + } // for - return status; - } -#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_decimate_by_) + status = f_memory_adjust((void **) & dynamics->array, sizeof(f_string_dynamic_t), dynamics->size, length); -#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_delete_) - f_status_t private_f_string_dynamics_delete(f_string_dynamics_t *string) { - f_status_t status = F_none; + if (F_status_is_error_not(status)) { + dynamics->size = length; - f_macro_string_dynamics_t_delete(status, (*string)); + if (dynamics->used > dynamics->size) { + dynamics->used = length; + } + } return status; } -#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_delete_) +#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_decimate_by_) -#if !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_dynamics_destroy_) - f_status_t private_f_string_dynamics_destroy(f_string_dynamics_t *string) { +#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) + f_status_t private_f_string_dynamics_resize(const f_string_length_t length, f_string_dynamics_t *dynamics) { f_status_t status = F_none; - f_macro_string_dynamics_t_destroy(status, (*string)); + for (f_array_length_t i = length; i < dynamics->size; ++i) { + status = private_f_string_dynamic_resize(0, &dynamics->array[i]); + if (F_status_is_error(status)) return status; + } // for - return status; - } -#endif // !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_dynamics_destroy_) + status = f_memory_resize((void **) & dynamics->array, sizeof(f_string_dynamic_t), dynamics->size, length); -#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) - f_status_t private_f_string_dynamics_resize(const f_string_length_t length, f_string_dynamics_t *strings) { - f_status_t status = F_none; + if (F_status_is_error_not(status)) { + dynamics->size = length; - f_macro_string_dynamics_t_resize(status, (*strings), length); + if (dynamics->used > dynamics->size) { + dynamics->used = length; + } + } return status; } #endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) -#if !defined(_di_f_string_maps_adjust_) - f_status_t private_f_string_maps_adjust(const f_string_length_t length, f_string_maps_t *maps) { +#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_string_length_t length, f_string_map_multis_t *map_multis) { f_status_t status = F_none; - f_macro_string_maps_t_adjust(status, (*maps), length); + for (f_array_length_t i = length; i < map_multis->size; ++i) { + + status = private_f_string_dynamic_adjust(0, &map_multis->array[i].name); + if (F_status_is_error(status)) return status; + + status = private_f_string_dynamics_adjust(0, &map_multis->array[i].value); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_adjust((void **) & map_multis->array, sizeof(f_string_map_multi_t), map_multis->size, length); + + if (F_status_is_error_not(status)) { + map_multis->size = length; + + if (map_multis->used > map_multis->size) { + map_multis->used = length; + } + } return status; } -#endif // !defined(_di_f_string_maps_adjust_) +#endif // !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_) -#if !defined(f_string_maps_decrease) || !defined(f_string_maps_decrease_by) || !defined(_di_f_string_maps_delete_) - f_status_t private_f_string_maps_delete(f_string_maps_t *maps) { +#if !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_terminate_) || !defined(_di_f_string_map_multis_terminate_after_) + f_status_t private_f_string_map_multis_resize(const f_string_length_t length, f_string_map_multis_t *map_multis) { f_status_t status = F_none; - f_macro_string_maps_t_delete(status, (*maps)); + for (f_array_length_t i = length; i < map_multis->size; ++i) { + + status = private_f_string_dynamic_resize(0, &map_multis->array[i].name); + if (F_status_is_error(status)) return status; + + status = private_f_string_dynamics_resize(0, &map_multis->array[i].value); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_resize((void **) & map_multis->array, sizeof(f_string_map_multi_t), map_multis->size, length); + + if (F_status_is_error_not(status)) { + map_multis->size = length; + + if (map_multis->used > map_multis->size) { + map_multis->used = length; + } + } return status; } -#endif // !defined(f_string_maps_decrease) || !defined(f_string_maps_decrease_by) || !defined(_di_f_string_maps_delete_) +#endif // !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_terminate_) || !defined(_di_f_string_map_multis_terminate_after_) -#if !defined(f_string_maps_decimate) || !defined(f_string_maps_decimate_by) || !defined(_di_f_string_maps_destroy_) - f_status_t private_f_string_maps_destroy(f_string_maps_t *maps) { +#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_) + f_status_t private_f_string_maps_adjust(const f_string_length_t length, f_string_maps_t *maps) { f_status_t status = F_none; - f_macro_string_maps_t_destroy(status, (*maps)); + for (f_array_length_t i = length; i < maps->size; ++i) { + + status = private_f_string_dynamic_adjust(0, &maps->array[i].name); + if (F_status_is_error(status)) return status; + + status = private_f_string_dynamic_adjust(0, &maps->array[i].value); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_adjust((void **) & maps->array, sizeof(f_string_map_t), maps->size, length); + + if (F_status_is_error_not(status)) { + maps->size = length; + + if (maps->used > maps->size) { + maps->used = length; + } + } return status; } -#endif // !defined(f_string_maps_decimate) || !defined(f_string_maps_decimate_by) || !defined(_di_f_string_maps_destroy_) +#endif // !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_) -#if !defined(_di_f_string_maps_decrease_) || !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_) +#if !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_) f_status_t private_f_string_maps_resize(const f_string_length_t length, f_string_maps_t *maps) { f_status_t status = F_none; - f_macro_string_maps_t_resize(status, (*maps), length); + for (f_array_length_t i = length; i < maps->size; ++i) { + + status = private_f_string_dynamic_resize(0, &maps->array[i].name); + if (F_status_is_error(status)) return status; + + status = private_f_string_dynamic_resize(0, &maps->array[i].value); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_resize((void **) & maps->array, sizeof(f_string_map_t), maps->size, length); + + if (F_status_is_error_not(status)) { + maps->size = length; + + if (maps->used > maps->size) { + maps->used = length; + } + } return status; } -#endif // !defined(_di_f_string_maps_decrease_) || !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_) +#endif // !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_) #if !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_) f_status_t private_f_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { @@ -299,121 +366,221 @@ extern "C" { } #endif // !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_) -#if !defined(_di_f_string_quantitys_adjust_) +#if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_) f_status_t private_f_string_quantitys_adjust(const f_string_length_t length, f_string_quantitys_t *quantitys) { - f_status_t status = F_none; - f_macro_string_quantitys_t_adjust(status, (*quantitys), length); + const f_status_t status = f_memory_adjust((void **) & quantitys->array, sizeof(f_string_quantity_t), quantitys->size, length); + + if (F_status_is_error_not(status)) { + quantitys->size = length; + + if (quantitys->used > quantitys->size) { + quantitys->used = length; + } + } return status; } -#endif // !defined(_di_f_string_quantitys_adjust_) +#endif // !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_) -#if !defined(f_string_quantitys_decrease) || !defined(f_string_quantitys_decrease_by) || !defined(_di_f_string_quantitys_delete_) - f_status_t private_f_string_quantitys_delete(f_string_quantitys_t *quantitys) { - f_status_t status = F_none; +#if !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_) + f_status_t private_f_string_quantitys_resize(const f_string_length_t length, f_string_quantitys_t *quantitys) { - f_macro_string_quantitys_t_delete(status, (*quantitys)); + const f_status_t status = f_memory_resize((void **) & quantitys->array, sizeof(f_string_quantity_t), quantitys->size, length); + + if (F_status_is_error_not(status)) { + quantitys->size = length; + + if (quantitys->used > quantitys->size) { + quantitys->used = length; + } + } return status; } -#endif // !defined(f_string_quantitys_decrease) || !defined(f_string_quantitys_decrease_by) || !defined(_di_f_string_quantitys_delete_) +#endif // !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_) -#if !defined(f_string_quantitys_decimate) || !defined(f_string_quantitys_decimate_by) || !defined(_di_f_string_quantitys_destroy_) - f_status_t private_f_string_quantitys_destroy(f_string_quantitys_t *quantitys) { +#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_) + f_status_t private_f_string_quantityss_adjust(const f_string_length_t length, f_string_quantityss_t *quantityss) { f_status_t status = F_none; - f_macro_string_quantitys_t_destroy(status, (*quantitys)); + for (f_array_length_t i = length; i < quantityss->size; ++i) { + status = private_f_string_quantitys_adjust(0, &quantityss->array[i]); + if (F_status_is_error(status)) return status; + } // for - return status; - } -#endif // !defined(f_string_quantitys_decimate) || !defined(f_string_quantitys_decimate_by) || !defined(_di_f_string_quantitys_destroy_) + status = f_memory_adjust((void **) & quantityss->array, sizeof(f_string_quantitys_t), quantityss->size, length); -#if !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_) - f_status_t private_f_string_quantitys_resize(const f_string_length_t length, f_string_quantitys_t *quantitys) { - f_status_t status = F_none; + if (F_status_is_error_not(status)) { + quantityss->size = length; - f_macro_string_quantitys_t_resize(status, (*quantitys), length); + if (quantityss->used > quantityss->size) { + quantityss->used = length; + } + } return status; } -#endif // !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_) +#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_) -#if !defined(_di_f_string_ranges_adjust_) - f_status_t private_f_string_ranges_adjust(const f_string_length_t length, f_string_ranges_t *ranges) { +#if !defined(_di_f_string_quantityss_decrease_) || !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_) + f_status_t private_f_string_quantityss_resize(const f_string_length_t length, f_string_quantityss_t *quantityss) { f_status_t status = F_none; - f_macro_string_ranges_t_adjust(status, (*ranges), length); + for (f_array_length_t i = length; i < quantityss->size; ++i) { + status = private_f_string_quantitys_resize(0, &quantityss->array[i]); + if (F_status_is_error(status)) return status; + } // for - return status; - } -#endif // !defined(_di_f_string_ranges_adjust_) + status = f_memory_resize((void **) & quantityss->array, sizeof(f_string_quantitys_t), quantityss->size, length); -#if !defined(f_string_ranges_decrease) || !defined(f_string_ranges_decrease_by) || !defined(_di_f_string_ranges_delete_) - f_status_t private_f_string_ranges_delete(f_string_ranges_t *ranges) { - f_status_t status = F_none; + if (F_status_is_error_not(status)) { + quantityss->size = length; - f_macro_string_ranges_t_delete(status, (*ranges)); + if (quantityss->used > quantityss->size) { + quantityss->used = length; + } + } return status; } -#endif // !defined(f_string_ranges_decrease) || !defined(f_string_ranges_decrease_by) || !defined(_di_f_string_ranges_delete_) +#endif // !defined(_di_f_string_quantityss_decrease_) || !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_) -#if !defined(f_string_ranges_decimate) || !defined(f_string_ranges_decimate_by) || !defined(_di_f_string_ranges_destroy_) - f_status_t private_f_string_ranges_destroy(f_string_ranges_t *ranges) { - f_status_t status = F_none; +#if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_) + f_status_t private_f_string_ranges_adjust(const f_string_length_t length, f_string_ranges_t *ranges) { + + const f_status_t status = f_memory_adjust((void **) & ranges->array, sizeof(f_string_range_t), ranges->size, length); - f_macro_string_ranges_t_destroy(status, (*ranges)); + if (F_status_is_error_not(status)) { + ranges->size = length; + + if (ranges->used > ranges->size) { + ranges->used = length; + } + } return status; } -#endif // !defined(f_string_ranges_decimate) || !defined(f_string_ranges_decimate_by) || !defined(_di_f_string_ranges_destroy_) +#endif // !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_) #if !defined(_di_f_string_ranges_decrease_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_) f_status_t private_f_string_ranges_resize(const f_string_length_t length, f_string_ranges_t *ranges) { - f_status_t status = F_none; - f_macro_string_ranges_t_resize(status, (*ranges), length); + const f_status_t status = f_memory_resize((void **) & ranges->array, sizeof(f_string_range_t), ranges->size, length); + + if (F_status_is_error_not(status)) { + ranges->size = length; + + if (ranges->used > ranges->size) { + ranges->used = length; + } + } return status; } #endif // !defined(_di_f_string_ranges_decrease_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_) -#if !defined(_di_f_string_triples_adjust_) - f_status_t private_f_string_triples_adjust(const f_string_length_t length, f_string_triples_t *triples) { +#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_) + f_status_t private_f_string_rangess_adjust(const f_string_length_t length, f_string_rangess_t *rangess) { f_status_t status = F_none; - f_macro_string_triples_t_adjust(status, (*triples), length); + for (f_array_length_t i = length; i < rangess->size; ++i) { + status = private_f_string_ranges_adjust(0, &rangess->array[i]); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_adjust((void **) & rangess->array, sizeof(f_string_ranges_t), rangess->size, length); + + if (F_status_is_error_not(status)) { + rangess->size = length; + + if (rangess->used > rangess->size) { + rangess->used = length; + } + } return status; } -#endif // !defined(_di_f_string_triples_adjust_) +#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_) -#if !defined(f_string_triples_decrease) || !defined(f_string_triples_decrease_by) || !defined(_di_f_string_triples_delete_) - f_status_t private_f_string_triples_delete(f_string_triples_t *triples) { +#if !defined(_di_f_string_rangess_decrease_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_) + f_status_t private_f_string_rangess_resize(const f_string_length_t length, f_string_rangess_t *rangess) { f_status_t status = F_none; - f_macro_string_triples_t_delete(status, (*triples)); + for (f_array_length_t i = length; i < rangess->size; ++i) { + status = private_f_string_ranges_resize(0, &rangess->array[i]); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_resize((void **) & rangess->array, sizeof(f_string_ranges_t), rangess->size, length); + + if (F_status_is_error_not(status)) { + rangess->size = length; + + if (rangess->used > rangess->size) { + rangess->used = length; + } + } return status; } -#endif // !defined(f_string_triples_decrease) || !defined(f_string_triples_decrease_by) || !defined(_di_f_string_triples_delete_) +#endif // !defined(_di_f_string_rangess_decrease_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_) -#if !defined(f_string_triples_decimate) || !defined(f_string_triples_decimate_by) || !defined(_di_f_string_triples_destroy_) - f_status_t private_f_string_triples_destroy(f_string_triples_t *triples) { +#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_) + f_status_t private_f_string_triples_adjust(const f_string_length_t length, f_string_triples_t *triples) { f_status_t status = F_none; - f_macro_string_triples_t_destroy(status, (*triples)); + for (f_array_length_t i = length; i < triples->size; ++i) { + + status = private_f_string_dynamic_adjust(0, &triples->array[i].one); + if (F_status_is_error(status)) return status; + + status = private_f_string_dynamic_adjust(0, &triples->array[i].two); + if (F_status_is_error(status)) return status; + + status = private_f_string_dynamic_adjust(0, &triples->array[i].three); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_adjust((void **) & triples->array, sizeof(f_string_triple_t), triples->size, length); + + if (F_status_is_error_not(status)) { + triples->size = length; + + if (triples->used > triples->size) { + triples->used = length; + } + } return status; } -#endif // !defined(f_string_triples_decimate) || !defined(f_string_triples_decimate_by) || !defined(_di_f_string_triples_destroy_) +#endif // !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_) #if !defined(_di_f_string_triples_decrease_) || !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_string_triples_terminate_after_) f_status_t private_f_string_triples_resize(const f_string_length_t length, f_string_triples_t *triples) { f_status_t status = F_none; - f_macro_string_triples_t_resize(status, (*triples), length); + for (f_array_length_t i = length; i < triples->size; ++i) { + + status = private_f_string_dynamic_resize(0, &triples->array[i].one); + if (F_status_is_error(status)) return status; + + status = private_f_string_dynamic_resize(0, &triples->array[i].two); + if (F_status_is_error(status)) return status; + + status = private_f_string_dynamic_resize(0, &triples->array[i].three); + if (F_status_is_error(status)) return status; + } // for + + status = f_memory_resize((void **) & triples->array, sizeof(f_string_triple_t), triples->size, length); + + if (F_status_is_error_not(status)) { + triples->size = length; + + if (triples->used > triples->size) { + triples->used = length; + } + } return status; } diff --git a/level_0/f_string/c/private-string.h b/level_0/f_string/c/private-string.h index 7e46de6..4928467 100644 --- a/level_0/f_string/c/private-string.h +++ b/level_0/f_string/c/private-string.h @@ -28,9 +28,9 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_dynamic_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). * - * @see f_macro_string_dynamic_t_adjust() + * @see f_memory_adjust() * @see f_string_dynamic_adjust() * @see f_string_dynamic_decimate_by() */ @@ -60,15 +60,16 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: private_f_string_dynamic_increase_by(). * * @see memcpy() * - * @see f_macro_string_dynamic_t_resize() * @see f_string_append() * @see f_string_dynamic_append() * @see f_string_dynamic_mash() * @see f_string_mash() + * + * @see private_f_string_dynamic_increase_by() */ #if !defined(_di_f_string_append_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_mash_) extern f_status_t private_f_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; @@ -89,7 +90,7 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: private_f_string_dynamic_increase_by(). * * @see memcpy() * @@ -98,52 +99,14 @@ extern "C" { * @see f_string_dynamic_append_nulless() * @see f_string_dynamic_mash_nulless() * @see f_string_mash_nulless() + * + * @see private_f_string_dynamic_increase_by() */ #if !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_mash_nulless_) extern f_status_t private_f_string_append_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_mash_nulless_) /** - * Private implementation of f_string_dynamic_delete(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param string - * The string to delete. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_dynamic_t_delete(). - * - * @see f_string_dynamic_decrease_by() - * @see f_string_dynamic_delete() - */ -#if !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_delete_) - extern f_status_t private_f_string_dynamic_delete(f_string_dynamic_t *string) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_delete_) - -/** - * Private implementation of f_string_dynamic_destroy(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param string - * The string to destroy. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_dynamic_t_destroy(). - * - * @see f_string_dynamic_decimate_by() - * @see f_string_dynamic_destroy() - */ -#if !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamic_destroy_) - extern f_status_t private_f_string_dynamic_destroy(f_string_dynamic_t *string) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamic_destroy_) - -/** * Private implementation of f_string_dynamic_increase_by(). * * Intended to be shared to each of the different implementation variations. @@ -155,9 +118,10 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). * F_string_too_large (with error bit) if the combined string is too large. * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: private_f_string_dynamic_resize(). * * @see memcpy() * @@ -192,9 +156,9 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: f_memory_resize(). * - * @see f_macro_string_dynamic_t_resize() + * @see f_memory_resize() * @see f_string_dynamic_decrease_by() * @see f_string_dynamic_increase() * @see f_string_dynamic_increase_by() @@ -218,57 +182,20 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_dynamics_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_macro_string_dynamics_t_adjust() + * @see f_memory_adjust() * @see f_string_dynamics_adjust() * @see f_string_dynamics_decimate_by() + * + * @see private_f_string_dynamic_adjust() */ #if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_decimate_by_) extern f_status_t private_f_string_dynamics_adjust(const f_string_length_t length, f_string_dynamics_t *strings) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_decimate_by_) /** - * Private implementation of f_string_dynamics_delete(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param strings - * The strings to delete. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_dynamics_t_delete(). - * - * @see f_string_dynamics_decrease_by() - * @see f_string_dynamics_delete() - */ -#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_delete_) - extern f_status_t private_f_string_dynamics_delete(f_string_dynamics_t *strings) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_delete_) - -/** - * Private implementation of f_string_dynamics_destroy(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param strings - * The strings to delete. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_dynamics_t_destroy(). - * - * @see f_string_dynamics_decimate_by() - * @see f_string_dynamics_destroy() - */ -#if !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_dynamics_delete_) - extern f_status_t private_f_string_dynamics_destroy(f_string_dynamics_t *strings) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_dynamics_delete_) - -/** * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. @@ -281,12 +208,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_dynamics_t_resize(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_string_dynamic_resize(). * - * @see f_macro_string_dynamics_t_resize() + * @see f_memory_resize() * @see f_string_dynamics_decrease_by() * @see f_string_dynamics_increase() * @see f_string_dynamics_increase_by() + * + * @see private_f_string_dynamic_resize() */ #if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) extern f_status_t private_f_string_dynamics_resize(const f_string_length_t length, f_string_dynamics_t *strings) f_gcc_attribute_visibility_internal; @@ -299,60 +229,77 @@ extern "C" { * * @param length * The new size to use. - * @param maps - * The maps to adjust. + * @param map_multis + * The map_multis to adjust. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_maps_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_macro_string_maps_t_adjust() - * @see f_string_maps_adjust() + * @see f_memory_adjust() + * @see f_string_map_multis_adjust() + * + * @see private_f_string_dynamic_adjust() */ -#if !defined(_di_f_string_maps_adjust_) - extern f_status_t private_f_string_maps_adjust(const f_string_length_t length, f_string_maps_t *maps) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_string_maps_adjust_) +#if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_) + extern f_status_t private_f_string_map_multis_adjust(const f_string_length_t length, f_string_map_multis_t *map_multis) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_) /** - * Private implementation of f_string_maps_delete(). + * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. * - * @param maps - * The maps to delete. + * @param length + * The new size to use. + * @param map_multis + * The map_multis to resize. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_maps_t_delete(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_string_dynamic_resize(). * - * @see f_string_maps_decrease_by() - * @see f_string_maps_delete() + * @see f_memory_adjust() + * @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_terminate() + * @see f_string_map_multis_terminate_after() + * + * @see private_f_string_dynamic_resize() */ -#if !defined(f_string_maps_decrease_by) || !defined(_di_f_string_maps_delete_) - extern f_status_t private_f_string_maps_delete(f_string_maps_t *maps) f_gcc_attribute_visibility_internal; -#endif // !defined(f_string_maps_decrease_by) || !defined(_di_f_string_maps_delete_) +#if !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_terminate_) || !defined(_di_f_string_map_multis_terminate_after_) + extern f_status_t private_f_string_map_multis_resize(const f_string_length_t length, f_string_map_multis_t *map_multis) f_gcc_attribute_visibility_internal; +#endif // !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_terminate_) || !defined(_di_f_string_map_multis_terminate_after_) /** - * Private implementation of f_string_maps_destroy(). + * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. * + * @param length + * The new size to use. * @param maps - * The maps to destroy. + * The maps to adjust. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_maps_t_destroy(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). + * + * @see f_memory_adjust() + * @see f_string_maps_adjust() * - * @see f_string_maps_decimate_by() - * @see f_string_maps_destroy() + * @see private_f_string_dynamic_adjust() */ -#if !defined(f_string_maps_decimate_by) || !defined(_di_f_string_maps_destroy_) - extern f_status_t private_f_string_maps_destroy(f_string_maps_t *maps) f_gcc_attribute_visibility_internal; -#endif // !defined(f_string_maps_decimate_by) || !defined(_di_f_string_maps_destroy_) +#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_) + extern f_status_t private_f_string_maps_adjust(const f_string_length_t length, f_string_maps_t *maps) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_) /** * Private implementation for resizing. @@ -367,14 +314,17 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_maps_t_resize(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_string_dynamic_resize(). * - * @see f_macro_string_dynamic_t_resize() + * @see f_memory_adjust() * @see f_string_maps_decrease_by() * @see f_string_maps_increase() * @see f_string_maps_increase_by() * @see f_string_maps_terminate() * @see f_string_maps_terminate_after() + * + * @see private_f_string_dynamic_resize() */ #if !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_) extern f_status_t private_f_string_maps_resize(const f_string_length_t length, f_string_maps_t *maps) f_gcc_attribute_visibility_internal; @@ -396,7 +346,7 @@ extern "C" { * F_none on success. * F_string_too_large (with error bit) if the combined string is too large. * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: private_f_string_dynamic_increase_by(). * * @see memcopy() * @see memmove() @@ -410,6 +360,8 @@ extern "C" { * @see f_string_mish() * @see f_string_prepend_assure() * @see f_string_prepend() + * + * @see private_f_string_dynamic_increase_by() */ #if !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_) extern f_status_t private_f_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; @@ -431,7 +383,7 @@ extern "C" { * F_none on success. * F_string_too_large (with error bit) if the combined string is too large. * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: private_f_string_dynamic_increase_by(). * * @see memcopy() * @see memmove() @@ -445,6 +397,8 @@ extern "C" { * @see f_string_mish_nulless() * @see f_string_prepend_assure_nulless() * @see f_string_prepend_nulless() + * + * @see private_f_string_dynamic_increase_by() */ #if !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_) extern f_status_t private_f_string_prepend_nulless(const f_string_t source, f_string_length_t length, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; @@ -463,54 +417,17 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_quantitys_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_macro_string_quantitys_t_adjust() + * @see f_memory_adjust() * @see f_string_quantitys_adjust() - */ -#if !defined(_di_f_string_quantitys_adjust_) - extern f_status_t private_f_string_quantitys_adjust(const f_string_length_t length, f_string_quantitys_t *quantitys) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_string_quantitys_adjust_) - -/** - * Private implementation of f_string_quantitys_delete(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param quantitys - * The quantitys to delete. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_quantitys_t_delete(). - * - * @see f_string_quantitys_decrease_by() - * @see f_string_quantitys_delete() - */ -#if !defined(f_string_quantitys_decrease_by) || !defined(_di_f_string_quantitys_delete_) - extern f_status_t private_f_string_quantitys_delete(f_string_quantitys_t *quantitys) f_gcc_attribute_visibility_internal; -#endif // !defined(f_string_quantitys_decrease_by) || !defined(_di_f_string_quantitys_delete_) - -/** - * Private implementation of f_string_quantitys_destroy(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param quantitys - * The quantitys to destroy. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_quantitys_t_destroy(). - * * @see f_string_quantitys_decimate_by() - * @see f_string_quantitys_destroy() + * @see private_f_string_dynamic_adjust() */ -#if !defined(f_string_quantitys_decimate_by) || !defined(_di_f_string_quantitys_destroy_) - extern f_status_t private_f_string_quantitys_destroy(f_string_quantitys_t *quantitys) f_gcc_attribute_visibility_internal; -#endif // !defined(f_string_quantitys_decimate_by) || !defined(_di_f_string_quantitys_destroy_) +#if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_) + extern f_status_t private_f_string_quantitys_adjust(const f_string_length_t length, f_string_quantitys_t *quantitys) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_) /** * Private implementation for resizing. @@ -525,14 +442,16 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_quantitys_t_resize(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_macro_string_dynamic_t_resize() + * @see f_memory_resize() * @see f_string_quantitys_decrease_by() * @see f_string_quantitys_increase() * @see f_string_quantitys_increase_by() * @see f_string_quantitys_terminate() * @see f_string_quantitys_terminate_after() + * @see private_f_string_dynamic_resize() */ #if !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_) extern f_status_t private_f_string_quantitys_resize(const f_string_length_t length, f_string_quantitys_t *quantitys) f_gcc_attribute_visibility_internal; @@ -545,60 +464,76 @@ extern "C" { * * @param length * The new size to use. - * @param ranges - * The ranges to adjust. + * @param quantityss + * The quantityss to adjust. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_ranges_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_macro_string_ranges_t_adjust() - * @see f_string_ranges_adjust() + * @see f_memory_adjust() + * @see f_string_quantityss_adjust() + * @see f_string_quantityss_decimate_by() + * @see private_f_string_dynamic_adjust() */ -#if !defined(_di_f_string_ranges_adjust_) - extern f_status_t private_f_string_ranges_adjust(const f_string_length_t length, f_string_ranges_t *ranges) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_string_ranges_adjust_) +#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_) + extern f_status_t private_f_string_quantityss_adjust(const f_string_length_t length, f_string_quantityss_t *quantityss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_) /** - * Private implementation of f_string_ranges_delete(). + * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. * - * @param ranges - * The ranges to delete. + * @param length + * The new size to use. + * @param quantityss + * The quantityss to resize. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_ranges_t_delete(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_string_ranges_decrease_by() - * @see f_string_ranges_delete() + * @see f_memory_resize() + * @see f_string_quantityss_decrease_by() + * @see f_string_quantityss_increase() + * @see f_string_quantityss_increase_by() + * @see f_string_quantityss_terminate() + * @see f_string_quantityss_terminate_after() + * @see private_f_string_dynamic_resize() */ -#if !defined(f_string_ranges_decrease_by) || !defined(_di_f_string_ranges_delete_) - extern f_status_t private_f_string_ranges_delete(f_string_ranges_t *ranges) f_gcc_attribute_visibility_internal; -#endif // !defined(f_string_ranges_decrease_by) || !defined(_di_f_string_ranges_delete_) +#if !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_) + extern f_status_t private_f_string_quantityss_resize(const f_string_length_t length, f_string_quantityss_t *quantityss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_) /** - * Private implementation of f_string_ranges_destroy(). + * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. * + * @param length + * The new size to use. * @param ranges - * The ranges to destroy. + * The ranges to adjust. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_ranges_t_destroy(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * + * @see f_memory_adjust() + * @see f_string_ranges_adjust() * @see f_string_ranges_decimate_by() - * @see f_string_ranges_destroy() + * @see private_f_string_dynamic_adjust() */ -#if !defined(f_string_ranges_decimate_by) || !defined(_di_f_string_ranges_destroy_) - extern f_status_t private_f_string_ranges_destroy(f_string_ranges_t *ranges) f_gcc_attribute_visibility_internal; -#endif // !defined(f_string_ranges_decimate_by) || !defined(_di_f_string_ranges_destroy_) +#if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_) + extern f_status_t private_f_string_ranges_adjust(const f_string_length_t length, f_string_ranges_t *ranges) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_) /** * Private implementation for resizing. @@ -613,14 +548,16 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_ranges_t_resize(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_macro_string_dynamic_t_resize() + * @see f_memory_resize() * @see f_string_ranges_decrease_by() * @see f_string_ranges_increase() * @see f_string_ranges_increase_by() * @see f_string_ranges_terminate() * @see f_string_ranges_terminate_after() + * @see private_f_string_dynamic_resize() */ #if !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_) extern f_status_t private_f_string_ranges_resize(const f_string_length_t length, f_string_ranges_t *ranges) f_gcc_attribute_visibility_internal; @@ -633,60 +570,76 @@ extern "C" { * * @param length * The new size to use. - * @param triples - * The triples to adjust. + * @param rangess + * The rangess to adjust. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_triples_t_adjust(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_macro_string_triples_t_adjust() - * @see f_string_triples_adjust() + * @see f_memory_adjust() + * @see f_string_rangess_adjust() + * @see f_string_rangess_decimate_by() + * @see private_f_string_dynamic_adjust() */ -#if !defined(_di_f_string_triples_adjust_) - extern f_status_t private_f_string_triples_adjust(const f_string_length_t length, f_string_triples_t *triples) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_f_string_triples_adjust_) +#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_) + extern f_status_t private_f_string_rangess_adjust(const f_string_length_t length, f_string_rangess_t *rangess) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_) /** - * Private implementation of f_string_triples_delete(). + * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. * - * @param triples - * The triples to delete. + * @param length + * The new size to use. + * @param rangess + * The rangess to resize. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_triples_t_delete(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_string_triples_decrease_by() - * @see f_string_triples_delete() + * @see f_memory_resize() + * @see f_string_rangess_decrease_by() + * @see f_string_rangess_increase() + * @see f_string_rangess_increase_by() + * @see f_string_rangess_terminate() + * @see f_string_rangess_terminate_after() + * @see private_f_string_dynamic_resize() */ -#if !defined(f_string_triples_decrease_by) || !defined(_di_f_string_triples_delete_) - extern f_status_t private_f_string_triples_delete(f_string_triples_t *triples) f_gcc_attribute_visibility_internal; -#endif // !defined(f_string_triples_decrease_by) || !defined(_di_f_string_triples_delete_) +#if !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_) + extern f_status_t private_f_string_rangess_resize(const f_string_length_t length, f_string_rangess_t *rangess) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_) /** - * Private implementation of f_string_triples_destroy(). + * Private implementation for resizing. * * Intended to be shared to each of the different implementation variations. * + * @param length + * The new size to use. * @param triples - * The triples to destroy. + * The triples to adjust. * * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_triples_t_destroy(). + * Errors (with error bit) from: f_memory_adjust(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * + * @see f_memory_adjust() + * @see f_string_triples_adjust() * @see f_string_triples_decimate_by() - * @see f_string_triples_destroy() + * @see private_f_string_dynamic_adjust() */ -#if !defined(f_string_triples_decimate_by) || !defined(_di_f_string_triples_destroy_) - extern f_status_t private_f_string_triples_destroy(f_string_triples_t *triples) f_gcc_attribute_visibility_internal; -#endif // !defined(f_string_triples_decimate_by) || !defined(_di_f_string_triples_destroy_) +#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_) + extern f_status_t private_f_string_triples_adjust(const f_string_length_t length, f_string_triples_t *triples) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_) /** * Private implementation for resizing. @@ -701,14 +654,16 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: f_macro_string_triples_t_resize(). + * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: private_f_string_dynamic_adjust(). * - * @see f_macro_string_dynamic_t_resize() + * @see f_memory_resize() * @see f_string_triples_decrease_by() * @see f_string_triples_increase() * @see f_string_triples_increase_by() * @see f_string_triples_terminate() * @see f_string_triples_terminate_after() + * @see private_f_string_dynamic_resize() */ #if !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_string_triples_terminate_after_) extern f_status_t private_f_string_triples_resize(const f_string_length_t length, f_string_triples_t *triples) f_gcc_attribute_visibility_internal; diff --git a/level_0/f_string/c/string-common.h b/level_0/f_string/c/string-common.h index 1c4e1c3..f7f2f11 100644 --- a/level_0/f_string/c/string-common.h +++ b/level_0/f_string/c/string-common.h @@ -34,16 +34,13 @@ extern "C" { #define f_string_t_initialize 0 - #define f_macro_string_t_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_string_t), length); + #define f_macro_string_t_clear(string) string = 0; #define f_macro_string_t_resize(status, string, length_old, length_new) status = f_memory_resize((void **) & string, sizeof(f_string_t), length_old, length_new); #define f_macro_string_t_adjust(status, string, length_old, length_new) status = f_memory_adjust((void **) & string, sizeof(f_string_t), length_old, length_new); - #define f_macro_string_t_delete(status, string, length) status = f_memory_delete((void **) & string, sizeof(f_string_t), length); - #define f_macro_string_t_destroy(status, string, length) status = f_memory_destroy((void **) & string, sizeof(f_string_t), length); - - #define f_macro_string_t_delete_simple(string, length) f_memory_delete((void **) & string, sizeof(f_string_t), length); - #define f_macro_string_t_destroy_simple(string, length) f_memory_destroy((void **) & string, sizeof(f_string_t), length); + #define f_macro_string_t_delete_simple(string, length) f_memory_resize((void **) & string, sizeof(f_string_t), length, 0); + #define f_macro_string_t_destroy_simple(string, length) f_memory_adjust((void **) & string, sizeof(f_string_t), length, 0); #endif // _di_f_string_t_ #ifndef _di_f_string_length_t_ @@ -73,23 +70,18 @@ extern "C" { #define f_string_lengths_t_initialize { 0, 0, 0 } - #define f_macro_string_lengths_t_clear(string_lengths) f_macro_memory_structures_clear(string_lengths); - - #define f_macro_string_lengths_t_new(status, string_lengths, length) f_macro_memory_structure_new(status, string_lengths, f_string_length_t, length); - - #define f_macro_string_lengths_t_resize(status, string_lengths, length) f_macro_memory_structure_resize(status, string_lengths, f_string_length_t, length); - #define f_macro_string_lengths_t_adjust(status, string_lengths, length) f_macro_memory_structure_adjust(status, string_lengths, f_string_length_t, length); + #define f_macro_string_lengths_t_clear(string_lengths) f_macro_memory_structures_clear(string_lengths) - #define f_macro_string_lengths_t_delete(status, string_lengths) f_macro_memory_structure_delete(status, string_lengths, f_string_length_t); - #define f_macro_string_lengths_t_destroy(status, string_lengths) f_macro_memory_structure_destroy(status, string_lengths, f_string_length_t); + #define f_macro_string_lengths_t_resize(status, string_lengths, length) f_macro_memory_structure_resize(status, string_lengths, f_string_length_t, length) + #define f_macro_string_lengths_t_adjust(status, string_lengths, length) f_macro_memory_structure_adjust(status, string_lengths, f_string_length_t, length) - #define f_macro_string_lengths_t_delete_simple(string_lengths) f_macro_memory_structure_delete_simple(string_lengths, f_string_length_t); - #define f_macro_string_lengths_t_destroy_simple(string_lengths) f_macro_memory_structure_destroy_simple(string_lengths, f_string_length_t); + #define f_macro_string_lengths_t_delete_simple(string_lengths) f_macro_memory_structure_delete_simple(string_lengths, f_string_length_t) + #define f_macro_string_lengths_t_destroy_simple(string_lengths) f_macro_memory_structure_destroy_simple(string_lengths, f_string_length_t) - #define f_macro_string_lengths_t_increase(status, string_lengths) f_macro_memory_structure_increase(status, string_lengths, f_string_length_t); - #define f_macro_string_lengths_t_increase_by(status, string_lengths, amount) f_macro_memory_structure_increase_by(status, string_lengths, f_string_length_t, amount); - #define f_macro_string_lengths_t_decrease_by(status, string_lengths, amount) f_macro_memory_structure_decrease_by(status, string_lengths, f_string_length_t, amount); - #define f_macro_string_lengths_t_decimate_by(status, string_lengths, amount) f_macro_memory_structure_decimate_by(status, string_lengths, f_string_length_t, amount); + #define f_macro_string_lengths_t_increase(status, string_lengths) f_macro_memory_structure_increase(status, string_lengths, f_string_length_t) + #define f_macro_string_lengths_t_increase_by(status, string_lengths, amount) f_macro_memory_structure_increase_by(status, string_lengths, f_string_length_t, amount) + #define f_macro_string_lengths_t_decrease_by(status, string_lengths, amount) f_macro_memory_structure_decrease_by(status, string_lengths, f_string_length_t, amount) + #define f_macro_string_lengths_t_decimate_by(status, string_lengths, amount) f_macro_memory_structure_decimate_by(status, string_lengths, f_string_length_t, amount) #endif // _di_f_string_lengths_t_ /** @@ -109,23 +101,18 @@ extern "C" { #define f_string_lengthss_t_initialize { 0, 0, 0 } - #define f_macro_string_lengthss_t_clear(lengthss) f_macro_memory_structures_clear(lengthss); - - #define f_macro_string_lengthss_t_new(status, lengthss, length) f_macro_memory_structures_new(status, lengthss, f_string_length_t, length); - - #define f_macro_string_lengthss_t_resize(status, lengthss, length) f_macro_memory_structures_resize(status, lengthss, f_string_length_t, f_string_lengths_t, length, f_array_length_t); - #define f_macro_string_lengthss_t_adjust(status, lengthss, length) f_macro_memory_structures_adjust(status, lengthss, f_string_length_t, f_string_lengths_t, length, f_array_length_t); + #define f_macro_string_lengthss_t_clear(lengthss) f_macro_memory_structures_clear(lengthss) - #define f_macro_string_lengthss_t_delete(status, lengthss) f_macro_memory_structures_delete(status, lengthss, f_string_length_t, f_string_lengths_t); - #define f_macro_string_lengthss_t_destroy(status, lengthss) f_macro_memory_structures_destroy(status, lengthss, f_string_length_t, f_string_lengths_t); + #define f_macro_string_lengthss_t_resize(status, lengthss, length) f_macro_memory_structures_resize(status, lengthss, f_string_length_t, f_string_lengths_t, length, f_array_length_t) + #define f_macro_string_lengthss_t_adjust(status, lengthss, length) f_macro_memory_structures_adjust(status, lengthss, f_string_length_t, f_string_lengths_t, length, f_array_length_t) - #define f_macro_string_lengthss_t_delete_simple(lengthss) f_macro_memory_structures_delete_simple(lengthss, f_string_length_t, f_string_lengths_t); - #define f_macro_string_lengthss_t_destroy_simple(lengthss) f_macro_memory_structures_destroy_simple(lengthss, f_string_length_t, f_string_lengths_t); + #define f_macro_string_lengthss_t_delete_simple(lengthss) f_macro_memory_structures_delete_simple(lengthss, f_string_length_t, f_string_lengths_t) + #define f_macro_string_lengthss_t_destroy_simple(lengthss) f_macro_memory_structures_destroy_simple(lengthss, f_string_length_t, f_string_lengths_t) - #define f_macro_string_lengthss_t_increase(status, string_lengths) f_macro_memory_structures_increase(status, string_lengths, f_string_length_t, f_array_length_t); - #define f_macro_string_lengthss_t_increase_by(status, string_lengths, amount) f_macro_memory_structures_increase_by(status, string_lengths, f_string_length_t, f_array_length_t, amount); - #define f_macro_string_lengthss_t_decrease_by(status, string_lengths, amount) f_macro_memory_structures_decrease_by(status, string_lengths, f_string_length_t, f_string_lengths_t, f_array_length_t, amount); - #define f_macro_string_lengthss_t_decimate_by(status, string_lengths, amount) f_macro_memory_structures_decimate_by(status, string_lengths, f_string_length_t, f_string_lengths_t, f_array_length_t, amount); + #define f_macro_string_lengthss_t_increase(status, string_lengths) f_macro_memory_structures_increase(status, string_lengths, f_string_length_t, f_array_length_t) + #define f_macro_string_lengthss_t_increase_by(status, string_lengths, amount) f_macro_memory_structures_increase_by(status, string_lengths, f_string_length_t, f_array_length_t, amount) + #define f_macro_string_lengthss_t_decrease_by(status, string_lengths, amount) f_macro_memory_structures_decrease_by(status, string_lengths, f_string_length_t, f_string_lengths_t, f_array_length_t, amount) + #define f_macro_string_lengthss_t_decimate_by(status, string_lengths, amount) f_macro_memory_structures_decimate_by(status, string_lengths, f_string_length_t, f_string_lengths_t, f_array_length_t, amount) #endif // _di_f_string_lengthss_t_ /** diff --git a/level_0/f_string/c/string_dynamic.c b/level_0/f_string/c/string_dynamic.c index 2ac33f4..ec2de97 100644 --- a/level_0/f_string/c/string_dynamic.c +++ b/level_0/f_string/c/string_dynamic.c @@ -10,211 +10,181 @@ extern "C" { #endif // _di_f_string_static_empty_s_ #ifndef _di_f_string_dynamic_adjust_ - f_status_t f_string_dynamic_adjust(const f_string_length_t length, f_string_dynamic_t *string) { + f_status_t f_string_dynamic_adjust(const f_string_length_t length, f_string_dynamic_t *dynamic) { #ifndef _di_level_0_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); + if (!dynamic) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - return private_f_string_dynamic_adjust(length, string); + return private_f_string_dynamic_adjust(length, dynamic); } #endif // _di_f_string_dynamic_adjust_ #ifndef _di_f_string_dynamic_decimate_by_ - f_status_t f_string_dynamic_decimate_by(const f_string_length_t amount, f_string_dynamic_t *string) { + f_status_t f_string_dynamic_decimate_by(const f_string_length_t amount, f_string_dynamic_t *dynamic) { #ifndef _di_level_0_parameter_checking_ if (!amount) return F_status_set_error(F_parameter); - if (!string) return F_status_set_error(F_parameter); + if (!dynamic) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (string->size - amount > 0) { - return private_f_string_dynamic_adjust(string->size - amount, string); + if (dynamic->size - amount > 0) { + return private_f_string_dynamic_adjust(dynamic->size - amount, dynamic); } - return private_f_string_dynamic_destroy(string); + return private_f_string_dynamic_adjust(0, dynamic); } #endif // _di_f_string_dynamic_decimate_by_ #ifndef _di_f_string_dynamic_decrease_by_ - f_status_t f_string_dynamic_decrease_by(const f_string_length_t amount, f_string_dynamic_t *string) { + f_status_t f_string_dynamic_decrease_by(const f_string_length_t amount, f_string_dynamic_t *dynamic) { #ifndef _di_level_0_parameter_checking_ if (!amount) return F_status_set_error(F_parameter); - if (!string) return F_status_set_error(F_parameter); + if (!dynamic) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (string->size - amount > 0) { - return private_f_string_dynamic_resize(string->size - amount, string); + if (dynamic->size - amount > 0) { + return private_f_string_dynamic_resize(dynamic->size - amount, dynamic); } - return private_f_string_dynamic_delete(string); + return private_f_string_dynamic_resize(0, dynamic); } #endif // _di_f_string_dynamic_decrease_by_ -#ifndef _di_f_string_dynamic_delete_ - f_status_t f_string_dynamic_delete(f_string_dynamic_t *string) { - #ifndef _di_level_0_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_dynamic_delete(string); - } -#endif // _di_f_string_dynamic_delete_ - -#ifndef _di_f_string_dynamic_destroy_ - f_status_t f_string_dynamic_destroy(f_string_dynamic_t *string) { - #ifndef _di_level_0_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_dynamic_destroy(string); - } -#endif // _di_f_string_dynamic_destroy_ - #ifndef _di_f_string_dynamic_increase_ - f_status_t f_string_dynamic_increase(f_string_dynamic_t *string) { + f_status_t f_string_dynamic_increase(f_string_dynamic_t *dynamic) { #ifndef _di_level_0_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); + if (!dynamic) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (string->used + 1 > string->size) { - f_array_length_t size = string->used + f_memory_default_allocation_step; + if (dynamic->used + 1 > dynamic->size) { + f_array_length_t size = dynamic->used + f_memory_default_allocation_step; if (size > f_string_length_t_size) { - if (string->used + 1 > f_string_length_t_size) { + if (dynamic->used + 1 > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } size = f_string_length_t_size; } - return private_f_string_dynamic_resize(size, string); + return private_f_string_dynamic_resize(size, dynamic); } - return F_none; + return F_data_not; } #endif // _di_f_string_dynamic_increase_ #ifndef _di_f_string_dynamic_increase_by_ - f_status_t f_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *string) { + f_status_t f_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *dynamic) { #ifndef _di_level_0_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); + if (!dynamic) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - return private_f_string_dynamic_increase_by(amount, string); + return private_f_string_dynamic_increase_by(amount, dynamic); } #endif // _di_f_string_dynamic_increase_by_ #ifndef _di_f_string_dynamic_resize_ - f_status_t f_string_dynamic_resize(const f_string_length_t length, f_string_dynamic_t *string) { + f_status_t f_string_dynamic_resize(const f_string_length_t length, f_string_dynamic_t *dynamic) { #ifndef _di_level_0_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); + if (!dynamic) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - return private_f_string_dynamic_resize(length, string); + return private_f_string_dynamic_resize(length, dynamic); } #endif // _di_f_string_dynamic_resize_ #ifndef _di_f_string_dynamics_adjust_ - f_status_t f_string_dynamics_adjust(const f_string_length_t length, f_string_dynamics_t *strings) { + f_status_t f_string_dynamics_adjust(const f_string_length_t length, f_string_dynamics_t *dynamics) { #ifndef _di_level_0_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); + if (!dynamics) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - return private_f_string_dynamics_adjust(length, strings); + return private_f_string_dynamics_adjust(length, dynamics); } #endif // _di_f_string_dynamics_adjust_ #ifndef _di_f_string_dynamics_decimate_by_ - f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *strings) { + f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) { #ifndef _di_level_0_parameter_checking_ if (!amount) return F_status_set_error(F_parameter); - if (!strings) return F_status_set_error(F_parameter); + if (!dynamics) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (strings->size - amount > 0) { - return private_f_string_dynamics_adjust(strings->size - amount, strings); + if (dynamics->size - amount > 0) { + return private_f_string_dynamics_adjust(dynamics->size - amount, dynamics); } - return private_f_string_dynamics_destroy(strings); + return private_f_string_dynamics_adjust(0, dynamics); } #endif // _di_f_string_dynamics_decimate_by_ #ifndef _di_f_string_dynamics_decrease_by_ - f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *strings) { + f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) { #ifndef _di_level_0_parameter_checking_ if (!amount) return F_status_set_error(F_parameter); - if (!strings) return F_status_set_error(F_parameter); + if (!dynamics) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (strings->size - amount > 0) { - return private_f_string_dynamics_resize(strings->size - amount, strings); + if (dynamics->size - amount > 0) { + return private_f_string_dynamics_resize(dynamics->size - amount, dynamics); } - return private_f_string_dynamics_delete(strings); + return private_f_string_dynamics_resize(0, dynamics); } #endif // _di_f_string_dynamics_decrease_by_ -#ifndef _di_f_string_dynamics_delete_ - f_status_t f_string_dynamics_delete(f_string_dynamics_t *strings) { - #ifndef _di_level_0_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_dynamics_delete(strings); - } -#endif // _di_f_string_dynamics_delete_ - -#ifndef _di_f_string_dynamics_destroy_ - f_status_t f_string_dynamics_destroy(f_string_dynamics_t *strings) { - #ifndef _di_level_0_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_dynamics_destroy(strings); - } -#endif // _di_f_string_dynamics_destroy_ - #ifndef _di_f_string_dynamics_increase_ - f_status_t f_string_dynamics_increase(f_string_dynamics_t *strings) { + f_status_t f_string_dynamics_increase(f_string_dynamics_t *dynamics) { #ifndef _di_level_0_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); + if (!dynamics) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (strings->used + 1 > strings->size) { - f_array_length_t size = strings->used + f_memory_default_allocation_step; + if (dynamics->used + 1 > dynamics->size) { + f_array_length_t size = dynamics->used + f_memory_default_allocation_step; if (size > f_array_length_t_size) { - if (strings->used + 1 > f_array_length_t_size) { + if (dynamics->used + 1 > f_array_length_t_size) { return F_status_set_error(F_array_too_large); } size = f_array_length_t_size; } - return private_f_string_dynamics_resize(size, strings); + return private_f_string_dynamics_resize(size, dynamics); } - return F_none; + return F_data_not; } #endif // _di_f_string_dynamics_increase_ #ifndef _di_f_string_dynamics_increase_by_ - f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *strings) { + f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) { #ifndef _di_level_0_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); + if (!dynamics) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (strings->used + amount > strings->size) { - if (strings->used + amount > f_array_length_t_size) { + if (dynamics->used + amount > dynamics->size) { + if (dynamics->used + amount > f_array_length_t_size) { return F_status_set_error(F_array_too_large); } - return private_f_string_dynamics_resize(strings->used + amount, strings); + return private_f_string_dynamics_resize(dynamics->used + amount, dynamics); } - return F_none; + 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_string_length_t length, f_string_dynamics_t *dynamics) { + #ifndef _di_level_0_parameter_checking_ + if (!dynamics) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_string_dynamics_resize(length, dynamics); + } +#endif // _di_f_string_dynamics_resize_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string_dynamic.h b/level_0/f_string/c/string_dynamic.h index 6a37527..e63b7c6 100644 --- a/level_0/f_string/c/string_dynamic.h +++ b/level_0/f_string/c/string_dynamic.h @@ -24,8 +24,8 @@ extern "C" { * A special f_macro_string_static_t_initialize() is provided for the special purpose of easily initialize a static string. * * string: the string. - * size: total amount of space available. - * used: total number of space used. + * size: total amount of space available. + * used: total number of space used. */ #ifndef _di_f_string_static_t_ typedef struct { @@ -54,8 +54,8 @@ extern "C" { * It is recommended that f_string_static_t are not otherwise casted into f_string_dynamic_t to avoid potential memory allocation issues. * * string: the string. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_string_dynamic_t_ typedef f_string_static_t f_string_dynamic_t; @@ -64,59 +64,24 @@ extern "C" { #define f_macro_string_dynamic_t_clear(dynamic) f_macro_string_static_t_clear(dynamic) - #define f_macro_string_dynamic_t_new(status, dynamic, length) \ - f_macro_string_dynamic_t_clear(dynamic) \ - status = f_memory_new((void **) & dynamic.string, sizeof(f_string_t), length); \ - if (status == F_none) { \ - dynamic.size = length; \ - dynamic.used = 0; \ - } - - #define f_macro_string_dynamic_t_resize(status, dynamic, length) \ - status = f_memory_resize((void **) & dynamic.string, sizeof(f_string_t), dynamic.size, length); \ - if (status == F_none) { \ - dynamic.size = length; \ - if (dynamic.used > dynamic.size) dynamic.used = length; \ - } - - #define f_macro_string_dynamic_t_adjust(status, dynamic, length) \ - status = f_memory_adjust((void **) & dynamic.string, sizeof(f_string_t), dynamic.size, length); \ - if (status == F_none) { \ - dynamic.size = length; \ - if (dynamic.used > dynamic.size) dynamic.used = length; \ - } - - #define f_macro_string_dynamic_t_delete(status, dynamic) \ - status = f_memory_delete((void **) & dynamic.string, sizeof(f_string_t), dynamic.size); \ - if (status == F_none) { \ - dynamic.size = 0; \ - dynamic.used = 0; \ - } - - #define f_macro_string_dynamic_t_destroy(status, dynamic) \ - status = f_memory_destroy((void **) & dynamic.string, sizeof(f_string_t), dynamic.size); \ - if (status == F_none) { \ - dynamic.size = 0; \ - dynamic.used = 0; \ - } - - #define f_macro_string_dynamic_t_delete_simple(dynamic) \ - f_memory_delete((void **) & dynamic.string, sizeof(f_string_t), dynamic.size); \ - dynamic.size = 0; \ - dynamic.used = 0; - - #define f_macro_string_dynamic_t_destroy_simple(dynamic) \ - f_memory_destroy((void **) & dynamic.string, sizeof(f_string_t), dynamic.size); \ - dynamic.size = 0; \ - dynamic.used = 0; + #define f_macro_string_dynamic_t_resize(status, dynamic, length) status = f_string_dynamic_resize(length, &dynamic); + #define f_macro_string_dynamic_t_adjust(status, dynamic, length) status = f_string_dynamic_adjust(length, &dynamic); + + #define f_macro_string_dynamic_t_delete_simple(dynamic) f_string_dynamic_resize(0, &dynamic); + #define f_macro_string_dynamic_t_destroy_simple(dynamic) f_string_dynamic_adjust(0, &dynamic); + + #define f_macro_string_dynamic_t_increase(status, dynamic) status = f_string_dynamic_increase(&dynamic); + #define f_macro_string_dynamic_t_increase_by(status, dynamic, amount) status = f_string_dynamic_increase_by(amount, &dynamic); + #define f_macro_string_dynamic_t_decrease_by(status, dynamic, amount) status = f_string_dynamic_decrease_by(amount, &dynamic); + #define f_macro_string_dynamic_t_decimate_by(status, dynamic, amount) status = f_string_dynamic_decimate_by(amount, &dynamic); #endif // _di_f_string_dynamic_t_ /** - * An array of static strings. + * An array of static dynamics. * - * array: the array of static strings. - * size: total amount of space available. - * used: total number of space used. + * array: the array of static dynamics. + * size: total amount of space available. + * used: total number of space used. */ #ifndef _di_f_string_statics_t_ typedef struct { @@ -135,11 +100,11 @@ extern "C" { #endif // _di_f_string_statics_t_ /** - * An array of dynamic strings. + * An array of dynamic dynamics. * - * array: the array of dynamic strings. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * array: the array of dynamic dynamics. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_string_dynamics_t_ typedef f_string_statics_t f_string_dynamics_t; @@ -148,83 +113,16 @@ extern "C" { #define f_macro_string_dynamics_t_clear(dynamics) f_macro_string_statics_t_clear(dynamics) - #define f_macro_string_dynamics_new(status, dynamics, length) \ - f_macro_string_dynamics_t_clear(dynamics) \ - status = f_memory_new((void **) & dynamics.array, sizeof(f_string_dynamic_t), length); \ - if (status == F_none) { \ - dynamics.size = length; \ - dynamics.used = 0; \ - } - - #define f_macro_string_dynamics_t_resize(status, dynamics, length) \ - status = F_none; \ - if (length < dynamics.size) { \ - for (register f_array_length_t _macro__i = dynamics.size - length; _macro__i < dynamics.size; ++_macro__i) { \ - f_macro_string_dynamic_t_delete(status, dynamics.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size, length); \ - if (status == F_none) { \ - dynamics.size = length; \ - if (dynamics.used > dynamics.size) dynamics.used = length; \ - } - - #define f_macro_string_dynamics_t_adjust(status, dynamics, length) \ - status = F_none; \ - if (length < dynamics.size) { \ - for (register f_array_length_t _macro__i = dynamics.size - length; _macro__i < dynamics.size; ++_macro__i) { \ - f_macro_string_dynamic_t_destroy(status, dynamics.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size, length); \ - if (status == F_none) { \ - dynamics.size = length; \ - if (dynamics.used > dynamics.size) dynamics.used = length; \ - } - - #define f_macro_string_dynamics_t_delete(status, dynamics) \ - status = F_none; \ - dynamics.used = dynamics.size; \ - while (dynamics.used) { \ - dynamics.used--; \ - f_macro_string_dynamic_t_delete(status, dynamics.array[dynamics.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size); \ - if (status == F_none) dynamics.size = 0; - - #define f_macro_string_dynamics_t_destroy(status, dynamics) \ - status = F_none; \ - dynamics.used = dynamics.size; \ - while (dynamics.used) { \ - dynamics.used--; \ - f_macro_string_dynamic_t_destroy(status, dynamics.array[dynamics.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size); \ - if (status == F_none) dynamics.size = 0; - - #define f_macro_string_dynamics_t_delete_simple(dynamics) \ - dynamics.used = dynamics.size; \ - while (dynamics.used) { \ - dynamics.used--; \ - f_macro_string_dynamic_t_delete_simple(dynamics.array[dynamics.used]); \ - } \ - f_memory_delete((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size); \ - dynamics.size = 0; - - #define f_macro_string_dynamics_t_destroy_simple(dynamics) \ - dynamics.used = dynamics.size; \ - while (dynamics.used > 0) { \ - dynamics.used--; \ - f_macro_string_dynamic_t_destroy_simple(dynamics.array[dynamics.used]); \ - } \ - f_memory_destroy((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size); \ - dynamics.size = 0; - - // @todo increase, decrease, decimate, increase_by, decrease_by, decimate_by + #define f_macro_string_dynamics_t_resize(status, dynamics, length) status = f_string_dynamics_resize(length, &dynamics); + #define f_macro_string_dynamics_t_adjust(status, dynamics, length) status = f_string_dynamics_adjust(length, &dynamics); + + #define f_macro_string_dynamics_t_delete_simple(dynamics) f_string_dynamics_resize(0, &dynamics); + #define f_macro_string_dynamics_t_destroy_simple(dynamics) f_string_dynamics_adjust(0, &dynamics); + + #define f_macro_string_dynamics_t_increase(status, dynamics) status = f_string_dynamics_increase(&dynamics); + #define f_macro_string_dynamics_t_increase_by(status, dynamics, amount) status = f_string_dynamics_increase_by(amount, &dynamics); + #define f_macro_string_dynamics_t_decrease_by(status, dynamics, amount) status = f_string_dynamics_decrease_by(amount, &dynamics); + #define f_macro_string_dynamics_t_decimate_by(status, dynamics, amount) status = f_string_dynamics_decimate_by(amount, &dynamics); #endif // _di_f_string_dynamics_t_ #ifndef _di_f_string_static_empty_s_ @@ -236,16 +134,17 @@ extern "C" { * * @param length * The new size to use. - * @param string + * @param dynamic * The string to resize. * * @return * F_none 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_array_length_t length, f_string_dynamic_t *string); + extern f_status_t f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t *dynamic); #endif // _di_f_string_dynamic_adjust_ /** @@ -257,47 +156,21 @@ extern "C" { * * @param amount * A positive number representing how much to decrease the size by. - * @param string + * @param dynamic * The string to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to decrease size (size = 0). + * * 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_decrease_by_ - extern f_status_t f_string_dynamic_decrease_by(const f_string_length_t amount, f_string_dynamic_t *string); + extern f_status_t f_string_dynamic_decrease_by(const f_string_length_t amount, f_string_dynamic_t *dynamic); #endif // _di_f_string_dynamic_decrease_by_ /** - * Delete the dynamic string. - * - * @param string - * The string to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_string_dynamic_delete_ - extern f_status_t f_string_dynamic_delete(f_string_dynamic_t *string); -#endif // _di_f_string_dynamic_delete_ - -/** - * Destroy the dynamic string. - * - * @param string - * The string to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_string_dynamic_destroy_ - extern f_status_t f_string_dynamic_destroy(f_string_dynamic_t *string); -#endif // _di_f_string_dynamic_destroy_ - -/** * Resize the dynamic string to a larger size. * * This will resize making the string larger based on the given length. @@ -306,17 +179,19 @@ extern "C" { * * @param amount * A positive number representing how much to increase the size by. - * @param string + * @param dynamic * The string to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + 1 <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_f_string_dynamic_increase_ - extern f_status_t f_string_dynamic_increase(f_string_dynamic_t *string); + extern f_status_t f_string_dynamic_increase(f_string_dynamic_t *dynamic); #endif // _di_f_string_dynamic_increase_ /** @@ -328,17 +203,19 @@ extern "C" { * * @param amount * A positive number representing how much to increase the size by. - * @param string + * @param dynamic * The string to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_f_string_dynamic_increase_by_ - extern f_status_t f_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *string); + extern f_status_t f_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *dynamic); #endif // _di_f_string_dynamic_increase_by_ /** @@ -346,16 +223,17 @@ extern "C" { * * @param length * The new size to use. - * @param string + * @param dynamic * The string to resize. * * @return * F_none 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_resize_ - extern f_status_t f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t *string); + extern f_status_t f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t *dynamic); #endif // _di_f_string_dynamic_resize_ /** @@ -363,16 +241,17 @@ extern "C" { * * @param length * The new size to use. - * @param strings + * @param dynamics * The string array to resize. * * @return * F_none 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_dynamics_adjust_ - extern f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *strings); + extern f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *dynamics); #endif // _di_f_string_dynamics_adjust_ /** @@ -384,16 +263,18 @@ extern "C" { * * @param amount * A positive number representing how much to decimate the size by. - * @param strings + * @param dynamics * The string array to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (size == 0). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_string_dynamics_decimate_by_ - extern f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *strings); + extern f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *dynamics); #endif // _di_f_string_dynamics_decimate_by_ /** @@ -405,63 +286,39 @@ extern "C" { * * @param amount * A positive number representing how much to decrease the size by. - * @param strings + * @param dynamics * The string array to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (size == 0). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_string_dynamics_decrease_by_ - extern f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *strings); + extern f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *dynamics); #endif // _di_f_string_dynamics_decrease_by_ /** - * Delete the array of dynamic strings. - * - * @param string - * The string to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_string_dynamics_delete_ - extern f_status_t f_string_dynamics_delete(f_string_dynamics_t *strings); -#endif // _di_f_string_dynamics_delete_ - -/** - * Destroy the array of dynamic strings. - * - * @param string - * The string to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_string_dynamics_destroy_ - extern f_status_t f_string_dynamics_destroy(f_string_dynamics_t *strings); -#endif // _di_f_string_dynamics_destroy_ - -/** * 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_array_length_t_size). * If already set to the maximum buffer size, then the resize will fail. * - * @param strings + * @param dynamics * The string array to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + 1 <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. */ #ifndef _di_f_string_dynamics_increase_ - extern f_status_t f_string_dynamics_increase(f_string_dynamics_t *strings); + extern f_status_t f_string_dynamics_increase(f_string_dynamics_t *dynamics); #endif // _di_f_string_dynamics_increase_ /** @@ -473,17 +330,19 @@ extern "C" { * * @param amount * A positive number representing how much to increase the size by. - * @param strings + * @param dynamics * The string array to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. */ #ifndef _di_f_string_dynamics_increase_by_ - extern f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *strings); + extern f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *dynamics); #endif // _di_f_string_dynamics_increase_by_ /** @@ -491,16 +350,17 @@ extern "C" { * * @param length * The new size to use. - * @param strings + * @param dynamics * The string array to resize. * * @return * F_none 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_dynamics_resize_ - extern f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *strings); + extern f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *dynamics); #endif // _di_f_string_dynamics_resize_ #ifdef __cplusplus diff --git a/level_0/f_string/c/string_map.c b/level_0/f_string/c/string_map.c index 0a551c2..d3a6cde 100644 --- a/level_0/f_string/c/string_map.c +++ b/level_0/f_string/c/string_map.c @@ -5,6 +5,99 @@ extern "C" { #endif +#ifndef _di_f_string_map_multis_adjust_ + f_status_t f_string_map_multis_adjust(const f_string_length_t length, f_string_map_multis_t *map_multis) { + #ifndef _di_level_0_parameter_checking_ + if (!map_multis) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_string_map_multis_adjust(length, map_multis); + } +#endif // _di_f_string_map_multis_adjust_ + +#ifndef _di_f_string_map_multis_decimate_by_ + f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!map_multis) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (map_multis->size - amount > 0) { + return private_f_string_map_multis_adjust(map_multis->size - amount, map_multis); + } + + return private_f_string_map_multis_adjust(0, map_multis); + } +#endif // _di_f_string_map_multis_decimate_by_ + +#ifndef _di_f_string_map_multis_decrease_by_ + f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!map_multis) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (map_multis->size - amount > 0) { + return private_f_string_map_multis_resize(map_multis->size - amount, map_multis); + } + + return private_f_string_map_multis_resize(0, map_multis); + } +#endif // _di_f_string_map_multis_decrease_by_ + +#ifndef _di_f_string_map_multis_increase_ + f_status_t f_string_map_multis_increase(f_string_map_multis_t *map_multis) { + #ifndef _di_level_0_parameter_checking_ + if (!map_multis) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (map_multis->used + 1 > map_multis->size) { + f_array_length_t size = map_multis->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (map_multis->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_string_map_multis_resize(size, map_multis); + } + + return F_data_not; + } +#endif // _di_f_string_map_multis_increase_ + +#ifndef _di_f_string_map_multis_increase_by_ + f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!map_multis) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (map_multis->used + amount > map_multis->size) { + if (map_multis->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_string_map_multis_resize(map_multis->used + amount, map_multis); + } + + return F_data_not; + } +#endif // _di_f_string_map_multis_increase_by_ + +#ifndef _di_f_string_map_multis_resize_ + f_status_t f_string_map_multis_resize(const f_string_length_t length, f_string_map_multis_t *map_multis) { + #ifndef _di_level_0_parameter_checking_ + if (!map_multis) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_string_map_multis_resize(length, map_multis); + } +#endif // _di_f_string_map_multis_resize_ + #ifndef _di_f_string_maps_adjust_ f_status_t f_string_maps_adjust(const f_string_length_t length, f_string_maps_t *maps) { #ifndef _di_level_0_parameter_checking_ @@ -26,7 +119,7 @@ extern "C" { return private_f_string_maps_adjust(maps->size - amount, maps); } - return private_f_string_maps_destroy(maps); + return private_f_string_maps_adjust(0, maps); } #endif // _di_f_string_maps_decimate_by_ @@ -41,30 +134,10 @@ extern "C" { return private_f_string_maps_resize(maps->size - amount, maps); } - return private_f_string_maps_delete(maps); + return private_f_string_maps_resize(0, maps); } #endif // _di_f_string_maps_decrease_by_ -#ifndef _di_f_string_maps_delete_ - f_status_t f_string_maps_delete(f_string_maps_t *maps) { - #ifndef _di_level_0_parameter_checking_ - if (!maps) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_maps_delete(maps); - } -#endif // _di_f_string_maps_delete_ - -#ifndef _di_f_string_maps_destroy_ - f_status_t f_string_maps_destroy(f_string_maps_t *maps) { - #ifndef _di_level_0_parameter_checking_ - if (!maps) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_maps_destroy(maps); - } -#endif // _di_f_string_maps_destroy_ - #ifndef _di_f_string_maps_increase_ f_status_t f_string_maps_increase(f_string_maps_t *maps) { #ifndef _di_level_0_parameter_checking_ @@ -85,7 +158,7 @@ extern "C" { return private_f_string_maps_resize(size, maps); } - return F_none; + return F_data_not; } #endif // _di_f_string_maps_increase_ @@ -104,7 +177,7 @@ extern "C" { return private_f_string_maps_resize(maps->used + amount, maps); } - return F_none; + return F_data_not; } #endif // _di_f_string_maps_increase_by_ diff --git a/level_0/f_string/c/string_map.h b/level_0/f_string/c/string_map.h index 84a08b6..af9f9c6 100644 --- a/level_0/f_string/c/string_map.h +++ b/level_0/f_string/c/string_map.h @@ -19,7 +19,7 @@ extern "C" { /** * A string map consisting of a name and value. * - * name: A string representing the map name. + * name: A string representing the map name. * value: A string representing the map value. */ #ifndef _di_f_string_map_t_ @@ -31,24 +31,8 @@ extern "C" { #define f_string_map_t_initialize { f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } #define f_macro_string_map_t_clear(map) \ - map.name.array = 0; \ - map.name.size = 0; \ - map.name.used = 0; \ - map.value.array = 0; \ - map.value.size = 0; \ - map.value.used = 0; - - #define f_macro_string_map_t_delete(status, map) \ - f_macro_string_dynamic_t_delete(status, map.name) \ - if (status == F_none) { \ - f_macro_string_dynamic_t_delete(status, map.value) \ - } - - #define f_macro_string_map_t_destroy(status, map) \ - f_macro_string_dynamic_t_destroy(status, map.name) \ - if (status == F_none) { \ - f_macro_string_dynamic_t_destroy(status, map.value) \ - } + f_macro_string_dynamic_t_clear(map.name) \ + f_macro_string_dynamic_t_clear(map.value) #define f_macro_string_map_t_delete_simple(map) \ f_macro_string_dynamic_t_delete_simple(map.name) \ @@ -63,8 +47,8 @@ extern "C" { * An array of string maps. * * array: the array of string maps. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_string_maps_t_ typedef struct { @@ -76,94 +60,24 @@ extern "C" { #define f_string_maps_t_initialize f_string_statics_t_initialize - #define f_macro_string_maps_t_clear(maps) \ - maps.array = 0; \ - maps.size = 0; \ - maps.used = 0; - - #define f_macro_string_maps_t_new(status, maps, length) \ - f_macro_string_maps_t_clear(maps) \ - status = f_memory_new((void **) & maps.array, sizeof(f_string_map_t), length); \ - if (status == F_none) { \ - maps.size = length; \ - maps.used = 0; \ - } - - #define f_macro_string_maps_t_resize(status, maps, length) \ - status = F_none; \ - if (length < maps.size) { \ - for (register f_array_length_t _macro__i = maps.size - length; _macro__i < maps.size; ++_macro__i) { \ - f_macro_string_map_t_delete(status, maps.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map_t), maps.size, length); \ - if (status == F_none) { \ - maps.size = length; \ - if (maps.used > maps.size) maps.used = length; \ - } - - #define f_macro_string_maps_t_adjust(status, maps, length) \ - status = F_none; \ - if (length < maps.size) { \ - for (register f_array_length_t _macro__i = maps.size - length; _macro__i < maps.size; ++_macro__i) { \ - f_macro_string_map_t_destroy(status, maps.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map_t), maps.size, length); \ - if (status == F_none) { \ - maps.size = length; \ - if (maps.used > maps.size) maps.used = length; \ - } - - #define f_macro_string_maps_t_delete(status, maps) \ - status = F_none; \ - maps.used = maps.size; \ - while (maps.used) { \ - maps.used--; \ - f_macro_string_map_t_delete(status, maps.array[maps.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_delete((void **) & maps.array, sizeof(f_string_map_t), maps.size); \ - if (status == F_none) maps.size = 0; - - #define f_macro_string_maps_t_destroy(status, maps) \ - status = F_none; \ - maps.used = maps.size; \ - while (maps.used) { \ - maps.used--; \ - f_macro_string_map_t_destroy(status, maps.array[maps.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_destroy((void **) & maps.array, sizeof(f_string_map_t), maps.size); \ - if (status == F_none) maps.size = 0; - - #define f_macro_string_maps_t_delete_simple(maps) \ - maps.used = maps.size; \ - while (maps.used) { \ - maps.used--; \ - f_macro_string_map_t_delete_simple(maps.array[maps.used]); \ - } \ - f_memory_delete((void **) & maps.array, sizeof(f_string_map_t), maps.size); \ - maps.size = 0; - - #define f_macro_string_maps_t_destroy_simple(maps) \ - maps.used = maps.size; \ - while (maps.used) { \ - maps.used--; \ - f_macro_string_map_t_destroy_simple(maps.array[maps.used]); \ - } \ - f_memory_destroy((void **) & maps.array, sizeof(f_string_map_t), maps.size); \ - maps.size = 0; -#endif // _di_f_string_maps_t_ + #define f_macro_string_maps_t_clear(maps) f_macro_memory_structure_clear(maps) + + #define f_macro_string_maps_t_resize(status, maps, length) status = f_string_maps_resize(length, &maps); + #define f_macro_string_maps_t_adjust(status, maps, length) status = f_string_maps_adjust(length, &maps); + + #define f_macro_string_maps_t_delete_simple(maps) f_string_maps_resize(0, &maps); + #define f_macro_string_maps_t_destroy_simple(maps) f_string_maps_adjust(0, &maps); -// @todo increase, decrease, decimate, increase_by, decrease_by, decimate_by + #define f_macro_string_maps_t_increase(status, maps) status = f_string_maps_increase(maps); + #define f_macro_string_maps_t_increase_by(status, maps, amount) status = f_string_maps_increase_by(amount, maps); + #define f_macro_string_maps_t_decrease_by(status, maps, amount) status = f_string_maps_decrease_by(amount, maps); + #define f_macro_string_maps_t_decimate_by(status, maps, amount) status = f_string_maps_decimate_by(amount, maps); +#endif // _di_f_string_maps_t_ /** * A string map consisting of a name and multiple values. * - * name: A string representing the map name. + * name: A string representing the map name. * value: An array of strings representing the map value. */ #ifndef _di_f_string_map_multi_t_ @@ -178,18 +92,6 @@ extern "C" { f_macro_string_dynamic_t_clear(map.name) \ f_macro_string_dynamics_t_clear(map.value) - #define f_macro_string_map_multi_t_delete(status, map) \ - f_macro_string_dynamic_t_delete(status, map.name) \ - if (status == F_none) { \ - f_macro_string_dynamics_t_delete(status, map.value) \ - } - - #define f_macro_string_map_multi_t_destroy(status, map) \ - f_macro_string_dynamic_t_destroy(status, map.name) \ - if (status == F_none) { \ - f_macro_string_dynamics_t_destroy(status, map.value) \ - } - #define f_macro_string_map_multi_t_delete_simple(map) \ f_macro_string_dynamic_t_delete_simple(map.name) \ f_macro_string_dynamics_t_delete_simple(map.value) @@ -203,8 +105,8 @@ extern "C" { * An array of string maps. * * array: the array of string maps. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_string_map_multis_t_ typedef struct { @@ -216,106 +118,40 @@ extern "C" { #define f_string_map_multis_t_initialize f_string_statics_t_initialize - #define f_macro_string_map_multis_t_clear(maps) f_macro_string_statics_t_clear(maps) - - #define f_macro_string_map_multis_t_new(status, maps, length) \ - f_macro_string_map_multis_t_clear(maps) \ - status = f_memory_new((void **) & maps.array, sizeof(f_string_map_multi_t), length); \ - if (status == F_none) { \ - maps.size = length; \ - maps.used = 0; \ - } - - #define f_macro_string_map_multis_t_resize(status, maps, length) \ - status = F_none; \ - if (length < maps.size) { \ - for (register f_array_length_t _macro__i = maps.size - length; _macro__i < maps.size; ++_macro__i) { \ - f_macro_string_map_multi_t_delete(status, maps.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size, length); \ - if (status == F_none) { \ - maps.size = length; \ - if (maps.used > maps.size) maps.used = length; \ - } - - #define f_macro_string_map_multis_t_adjust(status, maps, length) \ - status = F_none; \ - if (length < maps.size) { \ - for (register f_array_length_t _macro__i = maps.size - length; _macro__i < maps.size; ++_macro__i) { \ - f_macro_string_map_multi_t_destroy(status, maps.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size, length); \ - if (status == F_none) { \ - maps.size = length; \ - if (maps.used > maps.size) maps.used = length; \ - } - - #define f_macro_string_map_multis_t_delete(status, maps) \ - status = F_none; \ - maps.used = maps.size; \ - while (maps.used) { \ - maps.used--; \ - f_macro_string_map_multi_t_delete(status, maps.array[maps.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_delete((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size); \ - if (status == F_none) maps.size = 0; - - #define f_macro_string_map_multis_t_destroy(status, maps) \ - status = F_none; \ - maps.used = maps.size; \ - while (maps.used) { \ - maps.used--; \ - f_macro_string_map_multi_t_destroy(status, maps.array[maps.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_destroy((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size); \ - if (status == F_none) maps.size = 0; - - #define f_macro_string_map_multis_t_delete_simple(maps) \ - maps.used = maps.size; \ - while (maps.used) { \ - maps.used--; \ - f_macro_string_map_multi_t_delete_simple(maps.array[maps.used]); \ - } \ - f_memory_delete((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size); \ - maps.size = 0; - - #define f_macro_string_map_multis_t_destroy_simple(maps) \ - maps.used = maps.size; \ - while (maps.used) { \ - maps.used--; \ - f_macro_string_map_multi_t_destroy_simple(maps.array[maps.used]); \ - } \ - f_memory_destroy((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size); \ - maps.size = 0; -#endif // _di_f_string_map_multis_t_ + #define f_macro_string_map_multis_t_clear(map_multis) f_macro_memory_structure_clear(map_multis) -// @todo increase, decrease, decimate, increase_by, decrease_by, decimate_by + #define f_macro_string_map_multis_t_resize(status, map_multis, length) status = f_string_map_multis_resize(length, &map_multis); + #define f_macro_string_map_multis_t_adjust(status, map_multis, length) status = f_string_map_multis_adjust(length, &map_multis); + + #define f_macro_string_map_multis_t_delete_simple(map_multis) f_string_map_multis_resize(0, &map_multis); + #define f_macro_string_map_multis_t_destroy_simple(map_multis) f_string_map_multis_adjust(0, &map_multis); + + #define f_macro_string_map_multis_t_increase(status, map_multis) status = f_string_map_multis_increase(&map_multis); + #define f_macro_string_map_multis_t_increase_by(status, map_multis, amount) status = f_string_map_multis_increase_by(amount, &map_multis); + #define f_macro_string_map_multis_t_decrease_by(status, map_multis, amount) status = f_string_map_multis_decrease_by(amount, &map_multis); + #define f_macro_string_map_multis_t_decimate_by(status, map_multis, amount) status = f_string_map_multis_decimate_by(amount, &map_multis); +#endif // _di_f_string_map_multis_t_ /** - * Resize the string maps array. + * Resize the string map_multis array. * * @param length * The new size to use. - * @param maps - * The string maps array to resize. + * @param map_multis + * The string map_multis array to resize. * * @return * F_none 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_maps_adjust_ - extern f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t *maps); -#endif // _di_f_string_maps_adjust_ +#ifndef _di_f_string_map_multis_adjust_ + extern f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t *map_multis); +#endif // _di_f_string_map_multis_adjust_ /** - * Resize the string maps array to a smaller size. + * Resize the string map_multis 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. @@ -323,20 +159,21 @@ extern "C" { * * @param amount * A positive number representing how much to decimate the size by. - * @param maps - * The string maps array to resize. + * @param map_multis + * The string map_multis array to resize. * * @return * F_none 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_maps_decimate_by_ - extern f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t *maps); -#endif // _di_f_string_maps_decimate_by_ +#ifndef _di_f_string_map_multis_decimate_by_ + extern f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t *map_multis); +#endif // _di_f_string_map_multis_decimate_by_ /** - * Resize the string maps array to a smaller size. + * Resize the string map_multis 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. @@ -344,45 +181,143 @@ extern "C" { * * @param amount * A positive number representing how much to decrease the size by. + * @param map_multis + * The string map_multis array to resize. + * + * @return + * F_none 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_map_multis_decrease_by_ + extern f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t *map_multis); +#endif // _di_f_string_map_multis_decrease_by_ + +/** + * Increase the size of the string map_multis array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param map_multis + * The string map_multis array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_string_map_multis_increase_ + extern f_status_t f_string_map_multis_increase(f_string_map_multis_t *map_multis); +#endif // _di_f_string_map_multis_increase_ + +/** + * Resize the string map_multis array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 map_multis + * The string map_multis array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_string_map_multis_increase_by_ + extern f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t *map_multis); +#endif // _di_f_string_map_multis_increase_by_ + +/** + * Resize the string map_multis array. + * + * @param length + * The new size to use. + * @param map_multis + * The string map_multis array to adjust. + * + * @return + * F_none 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_map_multis_resize_ + extern f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t *map_multis); +#endif // _di_f_string_map_multis_resize_ + +/** + * Resize the string maps array. + * + * @param length + * The new size to use. * @param maps * The string maps array to resize. * * @return * F_none 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_maps_decrease_by_ - extern f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps); -#endif // _di_f_string_maps_decrease_by_ +#ifndef _di_f_string_maps_adjust_ + extern f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t *maps); +#endif // _di_f_string_maps_adjust_ /** - * Delete the array of string maps. + * Resize the string maps 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 maps - * The maps to delete. + * The string maps array to resize. * * @return * F_none 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_maps_delete_ - extern f_status_t f_string_maps_delete(f_string_maps_t *maps); -#endif // _di_f_string_maps_delete_ +#ifndef _di_f_string_maps_decimate_by_ + extern f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t *maps); +#endif // _di_f_string_maps_decimate_by_ /** - * Delete the array of string maps. + * Resize the string maps 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 decrease the size by. * @param maps - * The maps to destroy. + * The string maps array to resize. * * @return * F_none 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_maps_destroy_ - extern f_status_t f_string_maps_destroy(f_string_maps_t *maps); -#endif // _di_f_string_maps_destroy_ +#ifndef _di_f_string_maps_decrease_by_ + extern f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps); +#endif // _di_f_string_maps_decrease_by_ /** * Increase the size of the string maps array, but only if necessary. @@ -395,6 +330,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -417,6 +354,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -435,12 +374,13 @@ extern "C" { * * @return * F_none 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_maps_adjust_ - extern f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t *maps); -#endif // _di_f_string_maps_adjust_ +#ifndef _di_f_string_maps_resize_ + extern f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t *maps); +#endif // _di_f_string_maps_resize_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string_quantity.c b/level_0/f_string/c/string_quantity.c index 88dd7b2..88e83f9 100644 --- a/level_0/f_string/c/string_quantity.c +++ b/level_0/f_string/c/string_quantity.c @@ -26,7 +26,7 @@ extern "C" { return private_f_string_quantitys_adjust(quantitys->size - amount, quantitys); } - return private_f_string_quantitys_destroy(quantitys); + return private_f_string_quantitys_adjust(0, quantitys); } #endif // _di_f_string_quantitys_decimate_by_ @@ -41,30 +41,10 @@ extern "C" { return private_f_string_quantitys_resize(quantitys->size - amount, quantitys); } - return private_f_string_quantitys_delete(quantitys); + return private_f_string_quantitys_resize(0, quantitys); } #endif // _di_f_string_quantitys_decrease_by_ -#ifndef _di_f_string_quantitys_delete_ - f_status_t f_string_quantitys_delete(f_string_quantitys_t *quantitys) { - #ifndef _di_level_0_parameter_checking_ - if (!quantitys) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_quantitys_delete(quantitys); - } -#endif // _di_f_string_quantitys_delete_ - -#ifndef _di_f_string_quantitys_destroy_ - f_status_t f_string_quantitys_destroy(f_string_quantitys_t *quantitys) { - #ifndef _di_level_0_parameter_checking_ - if (!quantitys) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_quantitys_destroy(quantitys); - } -#endif // _di_f_string_quantitys_destroy_ - #ifndef _di_f_string_quantitys_increase_ f_status_t f_string_quantitys_increase(f_string_quantitys_t *quantitys) { #ifndef _di_level_0_parameter_checking_ @@ -85,7 +65,7 @@ extern "C" { return private_f_string_quantitys_resize(size, quantitys); } - return F_none; + return F_data_not; } #endif // _di_f_string_quantitys_increase_ @@ -104,7 +84,7 @@ extern "C" { return private_f_string_quantitys_resize(quantitys->used + amount, quantitys); } - return F_none; + return F_data_not; } #endif // _di_f_string_quantitys_increase_by_ @@ -118,6 +98,99 @@ extern "C" { } #endif // _di_f_string_quantitys_resize_ +#ifndef _di_f_string_quantityss_adjust_ + f_status_t f_string_quantityss_adjust(const f_string_length_t length, f_string_quantityss_t *quantityss) { + #ifndef _di_level_0_parameter_checking_ + if (!quantityss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_string_quantityss_adjust(length, quantityss); + } +#endif // _di_f_string_quantityss_adjust_ + +#ifndef _di_f_string_quantityss_decimate_by_ + f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!quantityss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (quantityss->size - amount > 0) { + return private_f_string_quantityss_adjust(quantityss->size - amount, quantityss); + } + + return private_f_string_quantityss_adjust(0, quantityss); + } +#endif // _di_f_string_quantityss_decimate_by_ + +#ifndef _di_f_string_quantityss_decrease_by_ + f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!quantityss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (quantityss->size - amount > 0) { + return private_f_string_quantityss_resize(quantityss->size - amount, quantityss); + } + + return private_f_string_quantityss_resize(0, quantityss); + } +#endif // _di_f_string_quantityss_decrease_by_ + +#ifndef _di_f_string_quantityss_increase_ + f_status_t f_string_quantityss_increase(f_string_quantityss_t *quantityss) { + #ifndef _di_level_0_parameter_checking_ + if (!quantityss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (quantityss->used + 1 > quantityss->size) { + f_array_length_t size = quantityss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (quantityss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_string_quantityss_resize(size, quantityss); + } + + return F_data_not; + } +#endif // _di_f_string_quantityss_increase_ + +#ifndef _di_f_string_quantityss_increase_by_ + f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!quantityss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (quantityss->used + amount > quantityss->size) { + if (quantityss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_string_quantityss_resize(quantityss->used + amount, quantityss); + } + + return F_data_not; + } +#endif // _di_f_string_quantityss_increase_by_ + +#ifndef _di_f_string_quantityss_resize_ + f_status_t f_string_quantityss_resize(const f_string_length_t length, f_string_quantityss_t *quantityss) { + #ifndef _di_level_0_parameter_checking_ + if (!quantityss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_string_quantityss_resize(length, quantityss); + } +#endif // _di_f_string_quantityss_resize_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string_quantity.h b/level_0/f_string/c/string_quantity.h index 34113f3..045cc22 100644 --- a/level_0/f_string/c/string_quantity.h +++ b/level_0/f_string/c/string_quantity.h @@ -38,11 +38,11 @@ extern "C" { #endif // _di_f_string_quantity_t_ /** - * An array of string quantities. + * An array of string quantitys. * - * array: the array of string quantities. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * array: the array of string quantitys. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_string_quantitys_t_ typedef struct { @@ -52,61 +52,51 @@ extern "C" { f_array_length_t used; } f_string_quantitys_t; - #define f_string_quantitys_t_initialize {0, 0, 0} + #define f_string_quantitys_t_initialize { 0, 0, 0 } - #define f_macro_string_quantitys_t_clear(quantitys) f_macro_memory_structure_clear(quantitys); + #define f_macro_string_quantitys_t_clear(quantitys) f_macro_memory_structure_clear(quantitys) - #define f_macro_string_quantitys_t_new(status, quantitys, length) f_macro_memory_structure_new(status, quantitys, f_string_quantity_t, length); + #define f_macro_string_quantitys_t_resize(status, quantitys, length) status = f_string_quantitys_resize(length, &quantitys); + #define f_macro_string_quantitys_t_adjust(status, quantitys, length) status = f_string_quantitys_adjust(length, &quantitys); - #define f_macro_string_quantitys_t_resize(status, quantitys, length) f_macro_memory_structure_resize(status, quantitys, f_string_quantity_t, length); - #define f_macro_string_quantitys_t_adjust(status, quantitys, length) f_macro_memory_structure_adjust(status, quantitys, f_string_quantity_t, length); + #define f_macro_string_quantitys_t_delete_simple(quantitys) f_string_quantitys_resize(0, &quantitys); + #define f_macro_string_quantitys_t_destroy_simple(quantitys) f_string_quantitys_adjust(0, &quantitys); - #define f_macro_string_quantitys_t_delete(status, quantitys) f_macro_memory_structure_delete(status, quantitys, f_string_quantity_t); - #define f_macro_string_quantitys_t_destroy(status, quantitys) f_macro_memory_structure_destroy(status, quantitys, f_string_quantity_t); - - #define f_macro_string_quantitys_t_delete_simple(quantitys) f_macro_memory_structure_delete_simple(quantitys, f_string_quantity_t); - #define f_macro_string_quantitys_t_destroy_simple(quantitys) f_macro_memory_structure_destroy_simple(quantitys, f_string_quantity_t); - - #define f_macro_string_quantitys_t_increase(status, quantitys) f_macro_memory_structure_increase(status, quantitys, f_string_quantity_t); - #define f_macro_string_quantitys_t_increase_by(status, quantitys, amount) f_macro_memory_structure_increase_by(status, quantitys, f_string_quantity_t, amount); - #define f_macro_string_quantitys_t_decrease_by(status, quantitys, amount) f_macro_memory_structure_decrease_by(status, quantitys, f_string_quantity_t, amount); - #define f_macro_string_quantitys_t_decimate_by(status, quantitys, amount) f_macro_memory_structure_decimate_by(status, quantitys, f_string_quantity_t, amount); + #define f_macro_string_quantitys_t_increase(status, quantitys) status = f_string_quantitys_increase(&quantitys); + #define f_macro_string_quantitys_t_increase_by(status, quantitys, amount) status = f_string_quantitys_increase_by(amount, &quantitys); + #define f_macro_string_quantitys_t_decrease_by(status, quantitys, amount) status = f_string_quantitys_decrease_by(amount, &quantitys); + #define f_macro_string_quantitys_t_decimate_by(status, quantitys, amount) status = f_string_quantitys_decimate_by(amount, &quantitys); #endif // _di_f_string_quantitys_t_ /** - * This holds an array of f_string_quantity_t. + * This holds an array of f_string_quantitys_t. * - * array: the array of quantitys arrays. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * array: The array of quantitys arrays. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. */ #ifndef _di_f_string_quantityss_t_ typedef struct { - f_string_quantity_t *array; + f_string_quantitys_t *array; f_array_length_t size; f_array_length_t used; } f_string_quantityss_t; - #define f_string_quantityss_t_initialize {0, 0, 0} + #define f_string_quantityss_t_initialize { 0, 0, 0 } #define f_macro_string_quantityss_t_clear(quantityss) f_macro_memory_structures_clear(quantityss) - #define f_macro_string_quantityss_t_new(status, quantityss, length) f_macro_memory_structures_new(status, quantityss, f_string_quantity_t, length); - - #define f_macro_string_quantityss_t_resize(status, quantityss, length) f_macro_memory_structures_resize(status, quantityss, f_string_quantity_t, f_string_quantitys_t, length, f_array_length_t); - #define f_macro_string_quantityss_t_adjust(status, quantityss, length) f_macro_memory_structures_adjust(status, quantityss, f_string_quantity_t, f_string_quantitys_t, length, f_array_length_t); + #define f_macro_string_quantityss_t_resize(status, quantityss, length) status = f_string_quantityss_resize(length, &quantityss); + #define f_macro_string_quantityss_t_adjust(status, quantityss, length) status = f_string_quantityss_adjust(length, &quantityss); - #define f_macro_string_quantityss_t_delete(status, quantityss) f_macro_memory_structures_delete(status, quantityss, f_string_quantity_t, f_string_quantitys_t); - #define f_macro_string_quantityss_t_destroy(status, quantityss) f_macro_memory_structures_destroy(status, quantityss, f_string_quantity_t, f_string_quantitys_t); + #define f_macro_string_quantityss_t_delete_simple(quantityss) f_string_quantityss_resize(0, &quantityss); + #define f_macro_string_quantityss_t_destroy_simple(quantityss) f_string_quantityss_adjust(0, &quantityss); - #define f_macro_string_quantityss_t_delete_simple(quantityss) f_macro_memory_structures_delete_simple(quantityss, f_string_quantity_t, f_string_quantitys_t); - #define f_macro_string_quantityss_t_destroy_simple(quantityss) f_macro_memory_structures_destroy_simple(quantityss, f_string_quantity_t, f_string_quantitys_t); - - #define f_macro_string_quantityss_t_increase(status, string_quantitys) f_macro_memory_structures_increase(status, string_quantitys, f_string_quantity_t, f_array_length_t); - #define f_macro_string_quantityss_t_increase_by(status, string_quantitys, amount) f_macro_memory_structures_increase_by(status, string_quantitys, f_string_quantity_t, f_array_length_t, amount); - #define f_macro_string_quantityss_t_decrease_by(status, string_quantitys, amount) f_macro_memory_structures_decrease_by(status, string_quantitys, f_string_quantity_t, f_string_quantitys_t, f_array_length_t, amount); - #define f_macro_string_quantityss_t_decimate_by(status, string_quantitys, amount) f_macro_memory_structures_decimate_by(status, string_quantitys, f_string_quantity_t, f_string_quantitys_t, f_array_length_t, amount); + #define f_macro_string_quantityss_t_increase(status, quantityss) status = f_string_quantityss_increase(&quantityss); + #define f_macro_string_quantityss_t_increase_by(status, quantityss, amount) status = f_string_quantityss_increase_by(amount, &quantityss); + #define f_macro_string_quantityss_t_decrease_by(status, quantityss, amount) status = f_string_quantityss_decrease_by(amount, &quantityss); + #define f_macro_string_quantityss_t_decimate_by(status, quantityss, amount) status = f_string_quantityss_decimate_by(amount, &quantityss); #endif // _di_f_string_quantityss_t_ /** @@ -119,6 +109,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -140,6 +131,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -161,6 +153,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -169,54 +162,151 @@ extern "C" { #endif // _di_f_string_quantitys_decrease_by_ /** - * Delete the array of string quantitys. + * Increase the size of the string quantitys array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. * * @param quantitys - * The quantitys to delete. + * The string quantitys array to resize. * * @return * F_none on success. + * F_array_too_large (with error bit) if the new array length is too large. + * + * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_f_string_quantitys_delete_ - extern f_status_t f_string_quantitys_delete(f_string_quantitys_t *quantitys); -#endif // _di_f_string_quantitys_delete_ +#ifndef _di_f_string_quantitys_increase_ + extern f_status_t f_string_quantitys_increase(f_string_quantitys_t *quantitys); +#endif // _di_f_string_quantitys_increase_ /** - * Delete the array of string quantitys. + * Resize the string quantitys array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 quantitys - * The quantitys to destroy. + * The string quantitys array to resize. * * @return * F_none on success. + * + * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. */ -#ifndef _di_f_string_quantitys_destroy_ - extern f_status_t f_string_quantitys_destroy(f_string_quantitys_t *quantitys); -#endif // _di_f_string_quantitys_destroy_ +#ifndef _di_f_string_quantitys_increase_by_ + extern f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t *quantitys); +#endif // _di_f_string_quantitys_increase_by_ /** - * Increase the size of the string quantitys array, but only if necessary. + * Resize the string quantitys array. + * + * @param length + * The new size to use. + * @param quantitys + * The string quantitys array to adjust. + * + * @return + * F_none 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_quantitys_resize_ + extern f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t *quantitys); +#endif // _di_f_string_quantitys_resize_ + +/** + * Resize the string quantityss array. + * + * @param length + * The new size to use. + * @param quantityss + * The string quantityss array to resize. + * + * @return + * F_none 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_quantityss_adjust_ + extern f_status_t f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t *quantityss); +#endif // _di_f_string_quantityss_adjust_ + +/** + * Resize the string quantityss 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 quantityss + * The string quantityss array to resize. + * + * @return + * F_none 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_quantityss_decimate_by_ + extern f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t *quantityss); +#endif // _di_f_string_quantityss_decimate_by_ + +/** + * Resize the string quantityss 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 decrease the size by. + * @param quantityss + * The string quantityss array to resize. + * + * @return + * F_none 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_quantityss_decrease_by_ + extern f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t *quantityss); +#endif // _di_f_string_quantityss_decrease_by_ + +/** + * Increase the size of the string quantityss array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). * If already set to the maximum buffer size, then the resize will fail. * - * @param quantitys - * The string quantitys array to resize. + * @param quantityss + * The string quantityss array to resize. * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_f_string_quantitys_increase_ - extern f_status_t f_string_quantitys_increase(f_string_quantitys_t *quantitys); -#endif // _di_f_string_quantitys_increase_ +#ifndef _di_f_string_quantityss_increase_ + extern f_status_t f_string_quantityss_increase(f_string_quantityss_t *quantityss); +#endif // _di_f_string_quantityss_increase_ /** - * Resize the string quantitys array to a larger size. + * Resize the string quantityss array to a larger size. * * This will resize making the string larger based on the given length. * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -224,35 +314,38 @@ extern "C" { * * @param amount * A positive number representing how much to increase the size by. - * @param quantitys - * The string quantitys array to resize. + * @param quantityss + * The string quantityss array to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. */ -#ifndef _di_f_string_quantitys_increase_by_ - extern f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t *quantitys); -#endif // _di_f_string_quantitys_increase_by_ +#ifndef _di_f_string_quantityss_increase_by_ + extern f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t *quantityss); +#endif // _di_f_string_quantityss_increase_by_ /** - * Resize the string quantitys array. + * Resize the string quantityss array. * * @param length * The new size to use. - * @param quantitys - * The string quantitys array to adjust. + * @param quantityss + * The string quantityss array to adjust. * * @return * F_none 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_quantitys_adjust_ - extern f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t *quantitys); -#endif // _di_f_string_quantitys_adjust_ +#ifndef _di_f_string_quantityss_resize_ + extern f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t *quantityss); +#endif // _di_f_string_quantityss_resize_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string_range.c b/level_0/f_string/c/string_range.c index 1950c7d..8cc3b20 100644 --- a/level_0/f_string/c/string_range.c +++ b/level_0/f_string/c/string_range.c @@ -26,7 +26,7 @@ extern "C" { return private_f_string_ranges_adjust(ranges->size - amount, ranges); } - return private_f_string_ranges_destroy(ranges); + return private_f_string_ranges_adjust(0, ranges); } #endif // _di_f_string_ranges_decimate_by_ @@ -41,30 +41,10 @@ extern "C" { return private_f_string_ranges_resize(ranges->size - amount, ranges); } - return private_f_string_ranges_delete(ranges); + return private_f_string_ranges_resize(0, ranges); } #endif // _di_f_string_ranges_decrease_by_ -#ifndef _di_f_string_ranges_delete_ - f_status_t f_string_ranges_delete(f_string_ranges_t *ranges) { - #ifndef _di_level_0_parameter_checking_ - if (!ranges) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_ranges_delete(ranges); - } -#endif // _di_f_string_ranges_delete_ - -#ifndef _di_f_string_ranges_destroy_ - f_status_t f_string_ranges_destroy(f_string_ranges_t *ranges) { - #ifndef _di_level_0_parameter_checking_ - if (!ranges) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_ranges_destroy(ranges); - } -#endif // _di_f_string_ranges_destroy_ - #ifndef _di_f_string_ranges_increase_ f_status_t f_string_ranges_increase(f_string_ranges_t *ranges) { #ifndef _di_level_0_parameter_checking_ @@ -85,7 +65,7 @@ extern "C" { return private_f_string_ranges_resize(size, ranges); } - return F_none; + return F_data_not; } #endif // _di_f_string_ranges_increase_ @@ -104,7 +84,7 @@ extern "C" { return private_f_string_ranges_resize(ranges->used + amount, ranges); } - return F_none; + return F_data_not; } #endif // _di_f_string_ranges_increase_by_ @@ -118,6 +98,99 @@ extern "C" { } #endif // _di_f_string_ranges_resize_ +#ifndef _di_f_string_rangess_adjust_ + f_status_t f_string_rangess_adjust(const f_string_length_t length, f_string_rangess_t *rangess) { + #ifndef _di_level_0_parameter_checking_ + if (!rangess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_string_rangess_adjust(length, rangess); + } +#endif // _di_f_string_rangess_adjust_ + +#ifndef _di_f_string_rangess_decimate_by_ + f_status_t f_string_rangess_decimate_by(const f_array_length_t amount, f_string_rangess_t *rangess) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!rangess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (rangess->size - amount > 0) { + return private_f_string_rangess_adjust(rangess->size - amount, rangess); + } + + return private_f_string_rangess_adjust(0, rangess); + } +#endif // _di_f_string_rangess_decimate_by_ + +#ifndef _di_f_string_rangess_decrease_by_ + f_status_t f_string_rangess_decrease_by(const f_array_length_t amount, f_string_rangess_t *rangess) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!rangess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (rangess->size - amount > 0) { + return private_f_string_rangess_resize(rangess->size - amount, rangess); + } + + return private_f_string_rangess_resize(0, rangess); + } +#endif // _di_f_string_rangess_decrease_by_ + +#ifndef _di_f_string_rangess_increase_ + f_status_t f_string_rangess_increase(f_string_rangess_t *rangess) { + #ifndef _di_level_0_parameter_checking_ + if (!rangess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (rangess->used + 1 > rangess->size) { + f_array_length_t size = rangess->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (rangess->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_string_rangess_resize(size, rangess); + } + + return F_data_not; + } +#endif // _di_f_string_rangess_increase_ + +#ifndef _di_f_string_rangess_increase_by_ + f_status_t f_string_rangess_increase_by(const f_array_length_t amount, f_string_rangess_t *rangess) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!rangess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (rangess->used + amount > rangess->size) { + if (rangess->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_string_rangess_resize(rangess->used + amount, rangess); + } + + return F_data_not; + } +#endif // _di_f_string_rangess_increase_by_ + +#ifndef _di_f_string_rangess_resize_ + f_status_t f_string_rangess_resize(const f_string_length_t length, f_string_rangess_t *rangess) { + #ifndef _di_level_0_parameter_checking_ + if (!rangess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_string_rangess_resize(length, rangess); + } +#endif // _di_f_string_rangess_resize_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string_range.h b/level_0/f_string/c/string_range.h index bd482fa..1d62878 100644 --- a/level_0/f_string/c/string_range.h +++ b/level_0/f_string/c/string_range.h @@ -26,7 +26,7 @@ extern "C" { * A special f_macro_string_range_t_initialize() is provided for the special purpose of easily initialize a static string range. * * start: the start position. - * stop: the stop position. + * stop: the stop position. */ #ifndef _di_f_string_range_t_ typedef struct { @@ -47,8 +47,8 @@ extern "C" { * An array of string ranges. * * array: the array of string ranges. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_string_ranges_t_ typedef struct { @@ -58,25 +58,20 @@ extern "C" { f_array_length_t used; } f_string_ranges_t; - #define f_string_ranges_t_initialize {0, 0, 0} + #define f_string_ranges_t_initialize { 0, 0, 0 } - #define f_macro_string_ranges_t_clear(ranges) f_macro_memory_structure_clear(ranges); + #define f_macro_string_ranges_t_clear(ranges) f_macro_memory_structure_clear(ranges) - #define f_macro_string_ranges_t_new(status, ranges, length) f_macro_memory_structure_new(status, ranges, f_string_range_t, length); + #define f_macro_string_ranges_t_resize(status, ranges, length) status = f_string_ranges_resize(length, &ranges); + #define f_macro_string_ranges_t_adjust(status, ranges, length) status = f_string_ranges_adjust(length, &ranges); - #define f_macro_string_ranges_t_resize(status, ranges, length) f_macro_memory_structure_resize(status, ranges, f_string_range_t, length); - #define f_macro_string_ranges_t_adjust(status, ranges, length) f_macro_memory_structure_adjust(status, ranges, f_string_range_t, length); + #define f_macro_string_ranges_t_delete_simple(ranges) f_string_ranges_resize(0, &ranges); + #define f_macro_string_ranges_t_destroy_simple(ranges) f_string_ranges_adjust(0, &ranges); - #define f_macro_string_ranges_t_delete(status, ranges) f_macro_memory_structure_delete(status, ranges, f_string_range_t); - #define f_macro_string_ranges_t_destroy(status, ranges) f_macro_memory_structure_destroy(status, ranges, f_string_range_t); - - #define f_macro_string_ranges_t_delete_simple(ranges) f_macro_memory_structure_delete_simple(ranges, f_string_range_t); - #define f_macro_string_ranges_t_destroy_simple(ranges) f_macro_memory_structure_destroy_simple(ranges, f_string_range_t); - - #define f_macro_string_ranges_t_increase(status, ranges) f_macro_memory_structure_increase(status, ranges, f_string_range_t); - #define f_macro_string_ranges_t_increase_by(status, ranges, amount) f_macro_memory_structure_increase_by(status, ranges, f_string_range_t, amount); - #define f_macro_string_ranges_t_decrease_by(status, ranges, amount) f_macro_memory_structure_decrease_by(status, ranges, f_string_range_t, amount); - #define f_macro_string_ranges_t_decimate_by(status, ranges, amount) f_macro_memory_structure_decimate_by(status, ranges, f_string_range_t, amount); + #define f_macro_string_ranges_t_increase(status, ranges) status = f_string_ranges_increase(&ranges); + #define f_macro_string_ranges_t_increase_by(status, ranges, amount) status = f_string_ranges_increase_by(amount, &ranges); + #define f_macro_string_ranges_t_decrease_by(status, ranges, amount) status = f_string_ranges_decrease_by(amount, &ranges); + #define f_macro_string_ranges_t_decimate_by(status, ranges, amount) status = f_string_ranges_decimate_by(amount, &ranges); #endif // _di_f_string_ranges_t_ /** @@ -96,23 +91,18 @@ extern "C" { #define f_string_rangess_t_initialize { 0, 0, 0 } - #define f_macro_string_rangess_t_clear(rangess) f_macro_memory_structures_clear(rangess); - - #define f_macro_string_rangess_t_new(status, rangess, length) f_macro_memory_structures_new(status, rangess, f_string_ranges_t, length); - - #define f_macro_string_rangess_t_resize(status, rangess, length) f_macro_memory_structures_resize(status, rangess, f_string_range_t, f_string_ranges_t, length, f_array_length_t); - #define f_macro_string_rangess_t_adjust(status, rangess, length) f_macro_memory_structures_adjust(status, rangess, f_string_range_t, f_string_ranges_t, length, f_array_length_t); + #define f_macro_string_rangess_t_clear(rangess) f_macro_memory_structures_clear(rangess) - #define f_macro_string_rangess_t_delete(status, rangess) f_macro_memory_structures_delete(status, rangess, f_string_range_t, f_string_ranges_t); - #define f_macro_string_rangess_t_destroy(status, rangess) f_macro_memory_structures_destroy(status, rangess, f_string_range_t, f_string_ranges_t); + #define f_macro_string_rangess_t_resize(status, rangess, length) status = f_string_rangess_resize(length, &rangess); + #define f_macro_string_rangess_t_adjust(status, rangess, length) status = f_string_rangess_adjust(length, &rangess); - #define f_macro_string_rangess_t_delete_simple(rangess) f_macro_memory_structures_delete_simple(rangess, f_string_range_t, f_string_ranges_t); - #define f_macro_string_rangess_t_destroy_simple(rangess) f_macro_memory_structures_destroy_simple(rangess, f_string_range_t, f_string_ranges_t); + #define f_macro_string_rangess_t_delete_simple(rangess) f_string_rangess_resize(0, &rangess); + #define f_macro_string_rangess_t_destroy_simple(rangess) f_string_rangess_adjust(0, &rangess); - #define f_macro_string_rangess_t_increase(status, string_ranges) f_macro_memory_structures_increase(status, string_ranges, f_string_range_t, f_array_length_t); - #define f_macro_string_rangess_t_increase_by(status, string_ranges, amount) f_macro_memory_structures_increase_by(status, string_ranges, f_string_range_t, f_array_length_t, amount); - #define f_macro_string_rangess_t_decrease_by(status, string_ranges, amount) f_macro_memory_structures_decrease_by(status, string_ranges, f_string_range_t, f_string_ranges_t, f_array_length_t, amount); - #define f_macro_string_rangess_t_decimate_by(status, string_ranges, amount) f_macro_memory_structures_decimate_by(status, string_ranges, f_string_range_t, f_string_ranges_t, f_array_length_t, amount); + #define f_macro_string_rangess_t_increase(status, rangess) status = f_string_rangess_increase(&rangess); + #define f_macro_string_rangess_t_increase_by(status, rangess, amount) status = f_string_rangess_increase_by(amount, &rangess); + #define f_macro_string_rangess_t_decrease_by(status, rangess, amount) status = f_string_rangess_decrease_by(amount, &rangess); + #define f_macro_string_rangess_t_decimate_by(status, rangess, amount) status = f_string_rangess_decimate_by(amount, &rangess); #endif // _di_f_string_rangess_t_ /** @@ -125,6 +115,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -146,6 +137,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -167,6 +159,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -175,54 +168,153 @@ extern "C" { #endif // _di_f_string_ranges_decrease_by_ /** - * Delete the array of string ranges. + * Increase the size of the string ranges array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param ranges + * The string ranges array to resize. + * F_data_not on success, but there is no reason to increase size (used + 1 <= size). + * + * @return + * F_none on success. + * F_array_too_large (with error bit) if the new array length is too large. + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_string_ranges_increase_ + extern f_status_t f_string_ranges_increase(f_string_ranges_t *ranges); +#endif // _di_f_string_ranges_increase_ + +/** + * Resize the string ranges array to a larger size. * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 ranges - * The ranges to delete. + * The string ranges array to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. */ -#ifndef _di_f_string_ranges_delete_ - extern f_status_t f_string_ranges_delete(f_string_ranges_t *ranges); -#endif // _di_f_string_ranges_delete_ +#ifndef _di_f_string_ranges_increase_by_ + extern f_status_t f_string_ranges_increase_by(const f_array_length_t amount, f_string_ranges_t *ranges); +#endif // _di_f_string_ranges_increase_by_ /** - * Delete the array of string ranges. + * Resize the string ranges array. * + * @param length + * The new size to use. * @param ranges - * The ranges to destroy. + * The string ranges array to adjust. * * @return * F_none 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_ranges_destroy_ - extern f_status_t f_string_ranges_destroy(f_string_ranges_t *ranges); -#endif // _di_f_string_ranges_destroy_ +#ifndef _di_f_string_ranges_resize_ + extern f_status_t f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t *ranges); +#endif // _di_f_string_ranges_resize_ /** - * Increase the size of the string ranges array, but only if necessary. + * Resize the string rangess array. + * + * @param length + * The new size to use. + * @param rangess + * The string rangess array to resize. + * + * @return + * F_none 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_rangess_adjust_ + extern f_status_t f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t *rangess); +#endif // _di_f_string_rangess_adjust_ + +/** + * Resize the string rangess 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 rangess + * The string rangess array to resize. + * + * @return + * F_none 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_rangess_decimate_by_ + extern f_status_t f_string_rangess_decimate_by(const f_array_length_t amount, f_string_rangess_t *rangess); +#endif // _di_f_string_rangess_decimate_by_ + +/** + * Resize the string rangess 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 decrease the size by. + * @param rangess + * The string rangess array to resize. + * + * @return + * F_none 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_rangess_decrease_by_ + extern f_status_t f_string_rangess_decrease_by(const f_array_length_t amount, f_string_rangess_t *rangess); +#endif // _di_f_string_rangess_decrease_by_ + +/** + * Increase the size of the string rangess array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). * If already set to the maximum buffer size, then the resize will fail. * - * @param ranges - * The string ranges array to resize. + * @param rangess + * The string rangess array to resize. * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_f_string_ranges_increase_ - extern f_status_t f_string_ranges_increase(f_string_ranges_t *ranges); -#endif // _di_f_string_ranges_increase_ +#ifndef _di_f_string_rangess_increase_ + extern f_status_t f_string_rangess_increase(f_string_rangess_t *rangess); +#endif // _di_f_string_rangess_increase_ /** - * Resize the string ranges array to a larger size. + * Resize the string rangess array to a larger size. * * This will resize making the string larger based on the given length. * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -230,35 +322,38 @@ extern "C" { * * @param amount * A positive number representing how much to increase the size by. - * @param ranges - * The string ranges array to resize. + * @param rangess + * The string rangess array to resize. * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. */ -#ifndef _di_f_string_ranges_increase_by_ - extern f_status_t f_string_ranges_increase_by(const f_array_length_t amount, f_string_ranges_t *ranges); -#endif // _di_f_string_ranges_increase_by_ +#ifndef _di_f_string_rangess_increase_by_ + extern f_status_t f_string_rangess_increase_by(const f_array_length_t amount, f_string_rangess_t *rangess); +#endif // _di_f_string_rangess_increase_by_ /** - * Resize the string ranges array. + * Resize the string rangess array. * * @param length * The new size to use. - * @param ranges - * The string ranges array to adjust. + * @param rangess + * The string rangess array to adjust. * * @return * F_none 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_ranges_adjust_ - extern f_status_t f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t *ranges); -#endif // _di_f_string_ranges_adjust_ +#ifndef _di_f_string_rangess_resize_ + extern f_status_t f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t *rangess); +#endif // _di_f_string_rangess_resize_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string_triple.c b/level_0/f_string/c/string_triple.c index 3a3e15f..650168c 100644 --- a/level_0/f_string/c/string_triple.c +++ b/level_0/f_string/c/string_triple.c @@ -26,7 +26,7 @@ extern "C" { return private_f_string_triples_adjust(triples->size - amount, triples); } - return private_f_string_triples_destroy(triples); + return private_f_string_triples_adjust(0, triples); } #endif // _di_f_string_triples_decimate_by_ @@ -41,30 +41,10 @@ extern "C" { return private_f_string_triples_resize(triples->size - amount, triples); } - return private_f_string_triples_delete(triples); + return private_f_string_triples_resize(0, triples); } #endif // _di_f_string_triples_decrease_by_ -#ifndef _di_f_string_triples_delete_ - f_status_t f_string_triples_delete(f_string_triples_t *triples) { - #ifndef _di_level_0_parameter_checking_ - if (!triples) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_triples_delete(triples); - } -#endif // _di_f_string_triples_delete_ - -#ifndef _di_f_string_triples_destroy_ - f_status_t f_string_triples_destroy(f_string_triples_t *triples) { - #ifndef _di_level_0_parameter_checking_ - if (!triples) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_string_triples_destroy(triples); - } -#endif // _di_f_string_triples_destroy_ - #ifndef _di_f_string_triples_increase_ f_status_t f_string_triples_increase(f_string_triples_t *triples) { #ifndef _di_level_0_parameter_checking_ @@ -85,7 +65,7 @@ extern "C" { return private_f_string_triples_resize(size, triples); } - return F_none; + return F_data_not; } #endif // _di_f_string_triples_increase_ @@ -104,7 +84,7 @@ extern "C" { return private_f_string_triples_resize(triples->used + amount, triples); } - return F_none; + return F_data_not; } #endif // _di_f_string_triples_increase_by_ diff --git a/level_0/f_string/c/string_triple.h b/level_0/f_string/c/string_triple.h index b040061..6f12295 100644 --- a/level_0/f_string/c/string_triple.h +++ b/level_0/f_string/c/string_triple.h @@ -43,24 +43,6 @@ extern "C" { triple.three.size = 0; \ triple.three.used = 0; - #define f_macro_string_triple_t_delete(status, triple) \ - f_macro_string_dynamic_t_delete(status, triple.one) \ - if (status == F_none) { \ - f_macro_string_dynamic_t_delete(status, triple.two) \ - } \ - if (status == F_none) { \ - f_macro_string_dynamic_t_delete(status, triple.three) \ - } - - #define f_macro_string_triple_t_destroy(status, triple) \ - f_macro_string_dynamic_t_destroy(status, triple.one) \ - if (status == F_none) { \ - f_macro_string_dynamic_t_destroy(status, triple.two) \ - } \ - if (status == F_none) { \ - f_macro_string_dynamic_t_destroy(status, triple.three) \ - } - #define f_macro_string_triple_t_delete_simple(triple) \ f_macro_string_dynamic_t_delete_simple(triple.one) \ f_macro_string_dynamic_t_delete_simple(triple.two) \ @@ -76,8 +58,8 @@ extern "C" { * An array of string triples. * * array: the array of string triples. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_string_triples_t_ typedef struct { @@ -89,90 +71,20 @@ extern "C" { #define f_string_triples_t_initialize f_string_statics_t_initialize - #define f_macro_string_triples_t_clear(triples) \ - triples.array = 0; \ - triples.size = 0; \ - triples.used = 0; - - #define f_macro_string_triples_t_new(status, triples, length) \ - f_macro_string_triples_t_clear(triples) \ - status = f_memory_new((void **) & triples.array, sizeof(f_string_triple_t), length); \ - if (status == F_none) { \ - triples.size = length; \ - triples.used = 0; \ - } - - #define f_macro_string_triples_t_resize(status, triples, length) \ - status = F_none; \ - if (length < triples.size) { \ - for (register f_array_length_t _macro__i = triples.size - length; _macro__i < triples.size; ++_macro__i) { \ - f_macro_string_triple_t_delete(status, triples.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_resize((void **) & triples.array, sizeof(f_string_triple_t), triples.size, length); \ - if (status == F_none) { \ - triples.size = length; \ - if (triples.used > triples.size) triples.used = length; \ - } - - #define f_macro_string_triples_t_adjust(status, triples, length) \ - status = F_none; \ - if (length < triples.size) { \ - for (register f_array_length_t _macro__i = triples.size - length; _macro__i < triples.size; ++_macro__i) { \ - f_macro_string_triple_t_destroy(status, triples.array[_macro__i]); \ - if (status != F_none) break; \ - } \ - } \ - if (status == F_none) status = f_memory_adjust((void **) & triples.array, sizeof(f_string_triple_t), triples.size, length); \ - if (status == F_none) { \ - triples.size = length; \ - if (triples.used > triples.size) triples.used = length; \ - } + #define f_macro_string_triples_t_clear(triples) f_macro_memory_structure_clear(triples) - #define f_macro_string_triples_t_delete(status, triples) \ - status = F_none; \ - triples.used = triples.size; \ - while (triples.used) { \ - triples.used--; \ - f_macro_string_triple_t_delete(status, triples.array[triples.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_delete((void **) & triples.array, sizeof(f_string_triple_t), triples.size); \ - if (status == F_none) triples.size = 0; + #define f_macro_string_triples_t_resize(status, triples, length) status = f_string_triples_resize(length, &triples); + #define f_macro_string_triples_t_adjust(status, triples, length) status = f_string_triples_adjust(length, &triples); - #define f_macro_string_triples_t_destroy(status, triples) \ - status = F_none; \ - triples.used = triples.size; \ - while (triples.used) { \ - triples.used--; \ - f_macro_string_triple_t_destroy(status, triples.array[triples.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) status = f_memory_destroy((void **) & triples.array, sizeof(f_string_triple_t), triples.size); \ - if (status == F_none) triples.size = 0; + #define f_macro_string_triples_t_delete_simple(triples) f_string_triples_resize(0, &triples); + #define f_macro_string_triples_t_destroy_simple(triples) f_string_triples_adjust(0, &triples); - #define f_macro_string_triples_t_delete_simple(triples) \ - triples.used = triples.size; \ - while (triples.used) { \ - triples.used--; \ - f_macro_string_triple_t_delete_simple(triples.array[triples.used]); \ - } \ - f_memory_delete((void **) & triples.array, sizeof(f_string_triple_t), triples.size); \ - triples.size = 0; - - #define f_macro_string_triples_t_destroy_simple(triples) \ - triples.used = triples.size; \ - while (triples.used) { \ - triples.used--; \ - f_macro_string_triple_t_destroy_simple(triples.array[triples.used]); \ - } \ - f_memory_destroy((void **) & triples.array, sizeof(f_string_triple_t), triples.size); \ - triples.size = 0; + #define f_macro_string_triples_t_increase(status, triples) status = f_string_triples_increase(triples); + #define f_macro_string_triples_t_increase_by(status, triples, amount) status = f_string_triples_increase_by(amount, triples); + #define f_macro_string_triples_t_decrease_by(status, triples, amount) status = f_string_triples_decrease_by(amount, triples); + #define f_macro_string_triples_t_decimate_by(status, triples, amount) status = f_string_triples_decimate_by(amount, triples); #endif // _di_f_string_triples_t_ -// @todo increase, decrease, decimate, increase_by, decrease_by, decimate_by - /** * Resize the string triples array. * @@ -183,6 +95,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -204,6 +117,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -225,6 +139,7 @@ extern "C" { * * @return * F_none on success. + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ @@ -233,34 +148,6 @@ extern "C" { #endif // _di_f_string_triples_decrease_by_ /** - * Delete the array of string triples. - * - * @param triples - * The triples to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_string_triples_delete_ - extern f_status_t f_string_triples_delete(f_string_triples_t *triples); -#endif // _di_f_string_triples_delete_ - -/** - * Delete the array of string triples. - * - * @param triples - * The triples to destroy. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_string_triples_destroy_ - extern f_status_t f_string_triples_destroy(f_string_triples_t *triples); -#endif // _di_f_string_triples_destroy_ - -/** * Increase the size of the string triples array, but only if necessary. * * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). @@ -271,6 +158,8 @@ extern "C" { * * @return * F_none 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_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. @@ -293,6 +182,8 @@ extern "C" { * * @return * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * F_array_too_large (with error bit) if the new array length is too large. @@ -311,12 +202,13 @@ extern "C" { * * @return * F_none 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_triples_adjust_ - extern f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t *triples); -#endif // _di_f_string_triples_adjust_ +#ifndef _di_f_string_triples_resize_ + extern f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t *triples); +#endif // _di_f_string_triples_resize_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_thread/c/thread-common.h b/level_0/f_thread/c/thread-common.h index 5064ef6..339e0a9 100644 --- a/level_0/f_thread/c/thread-common.h +++ b/level_0/f_thread/c/thread-common.h @@ -25,7 +25,7 @@ extern "C" { #define f_thread_attribute_t_initialize { 0 } // This does not clear the thread.attributes.__size array (may need to memset() against a sizeof(pthread_attr_t)). - #define f_macro_thread_attribute_t_clear(attribute) attribute.__align = 0; + #define f_macro_thread_attribute_t_clear(attribute) attribute.__align = 0 #endif // _di_f_thread_attribute_t_ /** @@ -45,21 +45,19 @@ extern "C" { #define f_thread_attributes_t_initialize { 0, 0, 0 } - #define f_macro_thread_attributes_t_new(status, attributes, length) f_macro_memory_structure_new(status, attributes, f_thread_attribute_t, length); + #define f_macro_thread_attributes_t_resize(status, attributes, length) f_macro_memory_structure_resize(status, attributes, f_thread_attribute_t, length) + #define f_macro_thread_attributes_t_adjust(status, attributes, length) f_macro_memory_structure_adjust(status, attributes, f_thread_attribute_t, length) - #define f_macro_thread_attributes_t_resize(status, attributes, length) f_macro_memory_structure_resize(status, attributes, f_thread_attribute_t, length); - #define f_macro_thread_attributes_t_adjust(status, attributes, length) f_macro_memory_structure_adjust(status, attributes, f_thread_attribute_t, length); + #define f_macro_thread_attributes_t_delete(status, attributes) f_macro_memory_structure_delete(status, attributes, f_thread_attribute_t) + #define f_macro_thread_attributes_t_destroy(status, attributes) f_macro_memory_structure_destroy(status, attributes, f_thread_attribute_t) - #define f_macro_thread_attributes_t_delete(status, attributes) f_macro_memory_structure_delete(status, attributes, f_thread_attribute_t); - #define f_macro_thread_attributes_t_destroy(status, attributes) f_macro_memory_structure_destroy(status, attributes, f_thread_attribute_t); + #define f_macro_thread_attributes_t_delete_simple(attributes) f_macro_memory_structure_delete_simple(attributes, f_thread_attribute_t) + #define f_macro_thread_attributes_t_destroy_simple(attributes) f_macro_memory_structure_destroy_simple(attributes, f_thread_attribute_t) - #define f_macro_thread_attributes_t_delete_simple(attributes) f_macro_memory_structure_delete_simple(attributes, f_thread_attribute_t); - #define f_macro_thread_attributes_t_destroy_simple(attributes) f_macro_memory_structure_destroy_simple(attributes, f_thread_attribute_t); - - #define f_macro_thread_attributes_t_increase(status, attributes) f_macro_memory_structure_increase(status, attributes, f_thread_attribute_t); - #define f_macro_thread_attributes_t_increase_by(status, attributes, amount) f_macro_memory_structure_increase_by(status, attributes, f_thread_attribute_t, amount); - #define f_macro_thread_attributes_t_decrease_by(status, attributes, amount) f_macro_memory_structure_decrease_by(status, attributes, f_thread_attribute_t, amount); - #define f_macro_thread_attributes_t_decimate_by(status, attributes, amount) f_macro_memory_structure_decimate_by(status, attributes, f_thread_attribute_t, amount); + #define f_macro_thread_attributes_t_increase(status, attributes) f_macro_memory_structure_increase(status, attributes, f_thread_attribute_t) + #define f_macro_thread_attributes_t_increase_by(status, attributes, amount) f_macro_memory_structure_increase_by(status, attributes, f_thread_attribute_t, amount) + #define f_macro_thread_attributes_t_decrease_by(status, attributes, amount) f_macro_memory_structure_decrease_by(status, attributes, f_thread_attribute_t, amount) + #define f_macro_thread_attributes_t_decimate_by(status, attributes, amount) f_macro_memory_structure_decimate_by(status, attributes, f_thread_attribute_t, amount) #endif // _di_f_thread_attributes_t_ /** @@ -70,7 +68,7 @@ extern "C" { #define f_thread_condition_t_initialize 0 - #define f_macro_thread_condition_t_clear(condition) condition = 0; + #define f_macro_thread_condition_t_clear(condition) condition = 0 #endif // _di_f_thread_condition_t_ /** @@ -90,21 +88,19 @@ extern "C" { #define f_thread_conditions_t_initialize { 0, 0, 0 } - #define f_macro_thread_conditions_t_new(status, conditions, length) f_macro_memory_structure_new(status, conditions, f_thread_condition_t, length); - - #define f_macro_thread_conditions_t_resize(status, conditions, length) f_macro_memory_structure_resize(status, conditions, f_thread_condition_t, length); - #define f_macro_thread_conditions_t_adjust(status, conditions, length) f_macro_memory_structure_adjust(status, conditions, f_thread_condition_t, length); + #define f_macro_thread_conditions_t_resize(status, conditions, length) f_macro_memory_structure_resize(status, conditions, f_thread_condition_t, length) + #define f_macro_thread_conditions_t_adjust(status, conditions, length) f_macro_memory_structure_adjust(status, conditions, f_thread_condition_t, length) - #define f_macro_thread_conditions_t_delete(status, conditions) f_macro_memory_structure_delete(status, conditions, f_thread_condition_t); - #define f_macro_thread_conditions_t_destroy(status, conditions) f_macro_memory_structure_destroy(status, conditions, f_thread_condition_t); + #define f_macro_thread_conditions_t_delete(status, conditions) f_macro_memory_structure_delete(status, conditions, f_thread_condition_t) + #define f_macro_thread_conditions_t_destroy(status, conditions) f_macro_memory_structure_destroy(status, conditions, f_thread_condition_t) - #define f_macro_thread_conditions_t_delete_simple(conditions) f_macro_memory_structure_delete_simple(conditions, f_thread_condition_t); - #define f_macro_thread_conditions_t_destroy_simple(conditions) f_macro_memory_structure_destroy_simple(conditions, f_thread_condition_t); + #define f_macro_thread_conditions_t_delete_simple(conditions) f_macro_memory_structure_delete_simple(conditions, f_thread_condition_t) + #define f_macro_thread_conditions_t_destroy_simple(conditions) f_macro_memory_structure_destroy_simple(conditions, f_thread_condition_t) - #define f_macro_thread_conditions_t_increase(status, conditions) f_macro_memory_structure_increase(status, conditions, f_thread_condition_t); - #define f_macro_thread_conditions_t_increase_by(status, conditions, amount) f_macro_memory_structure_increase_by(status, conditions, f_thread_condition_t, amount); - #define f_macro_thread_conditions_t_decrease_by(status, conditions, amount) f_macro_memory_structure_decrease_by(status, conditions, f_thread_condition_t, amount); - #define f_macro_thread_conditions_t_decimate_by(status, conditions, amount) f_macro_memory_structure_decimate_by(status, conditions, f_thread_condition_t, amount); + #define f_macro_thread_conditions_t_increase(status, conditions) f_macro_memory_structure_increase(status, conditions, f_thread_condition_t) + #define f_macro_thread_conditions_t_increase_by(status, conditions, amount) f_macro_memory_structure_increase_by(status, conditions, f_thread_condition_t, amount) + #define f_macro_thread_conditions_t_decrease_by(status, conditions, amount) f_macro_memory_structure_decrease_by(status, conditions, f_thread_condition_t, amount) + #define f_macro_thread_conditions_t_decimate_by(status, conditions, amount) f_macro_memory_structure_decimate_by(status, conditions, f_thread_condition_t, amount) #endif // _di_f_thread_conditions_t_ /** @@ -115,7 +111,7 @@ extern "C" { #define f_thread_id_t_initialize 0 - #define f_macro_thread_id_t_clear(id) id = 0; + #define f_macro_thread_id_t_clear(id) id = 0 #endif // _di_f_thread_id_t_ /** @@ -135,21 +131,19 @@ extern "C" { #define f_thread_ids_t_initialize { 0, 0, 0 } - #define f_macro_thread_ids_t_new(status, ids, length) f_macro_memory_structure_new(status, ids, f_thread_id_t, length); - - #define f_macro_thread_ids_t_resize(status, ids, length) f_macro_memory_structure_resize(status, ids, f_thread_id_t, length); - #define f_macro_thread_ids_t_adjust(status, ids, length) f_macro_memory_structure_adjust(status, ids, f_thread_id_t, length); + #define f_macro_thread_ids_t_resize(status, ids, length) f_macro_memory_structure_resize(status, ids, f_thread_id_t, length) + #define f_macro_thread_ids_t_adjust(status, ids, length) f_macro_memory_structure_adjust(status, ids, f_thread_id_t, length) - #define f_macro_thread_ids_t_delete(status, ids) f_macro_memory_structure_delete(status, ids, f_thread_id_t); - #define f_macro_thread_ids_t_destroy(status, ids) f_macro_memory_structure_destroy(status, ids, f_thread_id_t); + #define f_macro_thread_ids_t_delete(status, ids) f_macro_memory_structure_delete(status, ids, f_thread_id_t) + #define f_macro_thread_ids_t_destroy(status, ids) f_macro_memory_structure_destroy(status, ids, f_thread_id_t) - #define f_macro_thread_ids_t_delete_simple(ids) f_macro_memory_structure_delete_simple(ids, f_thread_id_t); - #define f_macro_thread_ids_t_destroy_simple(ids) f_macro_memory_structure_destroy_simple(ids, f_thread_id_t); + #define f_macro_thread_ids_t_delete_simple(ids) f_macro_memory_structure_delete_simple(ids, f_thread_id_t) + #define f_macro_thread_ids_t_destroy_simple(ids) f_macro_memory_structure_destroy_simple(ids, f_thread_id_t) - #define f_macro_thread_ids_t_increase(status, ids) f_macro_memory_structure_increase(status, ids, f_thread_id_t); - #define f_macro_thread_ids_t_increase_by(status, ids, amount) f_macro_memory_structure_increase_by(status, ids, f_thread_id_t, amount); - #define f_macro_thread_ids_t_decrease_by(status, ids, amount) f_macro_memory_structure_decrease_by(status, ids, f_thread_id_t, amount); - #define f_macro_thread_ids_t_decimate_by(status, ids, amount) f_macro_memory_structure_decimate_by(status, ids, f_thread_id_t, amount); + #define f_macro_thread_ids_t_increase(status, ids) f_macro_memory_structure_increase(status, ids, f_thread_id_t) + #define f_macro_thread_ids_t_increase_by(status, ids, amount) f_macro_memory_structure_increase_by(status, ids, f_thread_id_t, amount) + #define f_macro_thread_ids_t_decrease_by(status, ids, amount) f_macro_memory_structure_decrease_by(status, ids, f_thread_id_t, amount) + #define f_macro_thread_ids_t_decimate_by(status, ids, amount) f_macro_memory_structure_decimate_by(status, ids, f_thread_id_t, amount) #endif // _di_f_thread_ids_t_ /** @@ -160,7 +154,7 @@ extern "C" { #define f_thread_key_t_initialize 0 - #define f_macro_thread_key_t_clear(key) key = 0; + #define f_macro_thread_key_t_clear(key) key = 0 #endif // _di_f_thread_key_t_ /** @@ -180,21 +174,19 @@ extern "C" { #define f_thread_keys_t_initialize { 0, 0, 0 } - #define f_macro_thread_keys_t_new(status, keys, length) f_macro_memory_structure_new(status, keys, f_thread_key_t, length); + #define f_macro_thread_keys_t_resize(status, keys, length) f_macro_memory_structure_resize(status, keys, f_thread_key_t, length) + #define f_macro_thread_keys_t_adjust(status, keys, length) f_macro_memory_structure_adjust(status, keys, f_thread_key_t, length) - #define f_macro_thread_keys_t_resize(status, keys, length) f_macro_memory_structure_resize(status, keys, f_thread_key_t, length); - #define f_macro_thread_keys_t_adjust(status, keys, length) f_macro_memory_structure_adjust(status, keys, f_thread_key_t, length); + #define f_macro_thread_keys_t_delete(status, keys) f_macro_memory_structure_delete(status, keys, f_thread_key_t) + #define f_macro_thread_keys_t_destroy(status, keys) f_macro_memory_structure_destroy(status, keys, f_thread_key_t) - #define f_macro_thread_keys_t_delete(status, keys) f_macro_memory_structure_delete(status, keys, f_thread_key_t); - #define f_macro_thread_keys_t_destroy(status, keys) f_macro_memory_structure_destroy(status, keys, f_thread_key_t); + #define f_macro_thread_keys_t_delete_simple(keys) f_macro_memory_structure_delete_simple(keys, f_thread_key_t) + #define f_macro_thread_keys_t_destroy_simple(keys) f_macro_memory_structure_destroy_simple(keys, f_thread_key_t) - #define f_macro_thread_keys_t_delete_simple(keys) f_macro_memory_structure_delete_simple(keys, f_thread_key_t); - #define f_macro_thread_keys_t_destroy_simple(keys) f_macro_memory_structure_destroy_simple(keys, f_thread_key_t); - - #define f_macro_thread_keys_t_increase(status, keys) f_macro_memory_structure_increase(status, keys, f_thread_key_t); - #define f_macro_thread_keys_t_increase_by(status, keys, amount) f_macro_memory_structure_increase_by(status, keys, f_thread_key_t, amount); - #define f_macro_thread_keys_t_decrease_by(status, keys, amount) f_macro_memory_structure_decrease_by(status, keys, f_thread_key_t, amount); - #define f_macro_thread_keys_t_decimate_by(status, keys, amount) f_macro_memory_structure_decimate_by(status, keys, f_thread_key_t, amount); + #define f_macro_thread_keys_t_increase(status, keys) f_macro_memory_structure_increase(status, keys, f_thread_key_t) + #define f_macro_thread_keys_t_increase_by(status, keys, amount) f_macro_memory_structure_increase_by(status, keys, f_thread_key_t, amount) + #define f_macro_thread_keys_t_decrease_by(status, keys, amount) f_macro_memory_structure_decrease_by(status, keys, f_thread_key_t, amount) + #define f_macro_thread_keys_t_decimate_by(status, keys, amount) f_macro_memory_structure_decimate_by(status, keys, f_thread_key_t, amount) #endif // _di_f_thread_keys_t_ /** @@ -205,7 +197,7 @@ extern "C" { #define f_thread_lock_t_initialize 0 - #define f_macro_thread_lock_t_clear(lock) lock = 0; + #define f_macro_thread_lock_t_clear(lock) lock = 0 #endif // _di_f_thread_lock_t_ /** @@ -225,21 +217,19 @@ extern "C" { #define f_thread_locks_t_initialize { 0, 0, 0 } - #define f_macro_thread_locks_t_new(status, locks, length) f_macro_memory_structure_new(status, locks, f_thread_lock_t, length); - - #define f_macro_thread_locks_t_resize(status, locks, length) f_macro_memory_structure_resize(status, locks, f_thread_lock_t, length); - #define f_macro_thread_locks_t_adjust(status, locks, length) f_macro_memory_structure_adjust(status, locks, f_thread_lock_t, length); + #define f_macro_thread_locks_t_resize(status, locks, length) f_macro_memory_structure_resize(status, locks, f_thread_lock_t, length) + #define f_macro_thread_locks_t_adjust(status, locks, length) f_macro_memory_structure_adjust(status, locks, f_thread_lock_t, length) - #define f_macro_thread_locks_t_delete(status, locks) f_macro_memory_structure_delete(status, locks, f_thread_lock_t); - #define f_macro_thread_locks_t_destroy(status, locks) f_macro_memory_structure_destroy(status, locks, f_thread_lock_t); + #define f_macro_thread_locks_t_delete(status, locks) f_macro_memory_structure_delete(status, locks, f_thread_lock_t) + #define f_macro_thread_locks_t_destroy(status, locks) f_macro_memory_structure_destroy(status, locks, f_thread_lock_t) - #define f_macro_thread_locks_t_delete_simple(locks) f_macro_memory_structure_delete_simple(locks, f_thread_lock_t); - #define f_macro_thread_locks_t_destroy_simple(locks) f_macro_memory_structure_destroy_simple(locks, f_thread_lock_t); + #define f_macro_thread_locks_t_delete_simple(locks) f_macro_memory_structure_delete_simple(locks, f_thread_lock_t) + #define f_macro_thread_locks_t_destroy_simple(locks) f_macro_memory_structure_destroy_simple(locks, f_thread_lock_t) - #define f_macro_thread_locks_t_increase(status, locks) f_macro_memory_structure_increase(status, locks, f_thread_lock_t); - #define f_macro_thread_locks_t_increase_by(status, locks, amount) f_macro_memory_structure_increase_by(status, locks, f_thread_lock_t, amount); - #define f_macro_thread_locks_t_decrease_by(status, locks, amount) f_macro_memory_structure_decrease_by(status, locks, f_thread_lock_t, amount); - #define f_macro_thread_locks_t_decimate_by(status, locks, amount) f_macro_memory_structure_decimate_by(status, locks, f_thread_lock_t, amount); + #define f_macro_thread_locks_t_increase(status, locks) f_macro_memory_structure_increase(status, locks, f_thread_lock_t) + #define f_macro_thread_locks_t_increase_by(status, locks, amount) f_macro_memory_structure_increase_by(status, locks, f_thread_lock_t, amount) + #define f_macro_thread_locks_t_decrease_by(status, locks, amount) f_macro_memory_structure_decrease_by(status, locks, f_thread_lock_t, amount) + #define f_macro_thread_locks_t_decimate_by(status, locks, amount) f_macro_memory_structure_decimate_by(status, locks, f_thread_lock_t, amount) #endif // _di_f_thread_locks_t_ /** @@ -250,7 +240,7 @@ extern "C" { #define f_thread_mutex_t_initialize 0 - #define f_macro_thread_mutex_t_clear(mutex) mutex = 0; + #define f_macro_thread_mutex_t_clear(mutex) mutex = 0 #endif // _di_f_thread_mutex_t_ /** @@ -270,21 +260,19 @@ extern "C" { #define f_thread_mutexs_t_initialize { 0, 0, 0 } - #define f_macro_thread_mutexs_t_new(status, mutexs, length) f_macro_memory_structure_new(status, mutexs, f_thread_mutex_t, length); + #define f_macro_thread_mutexs_t_resize(status, mutexs, length) f_macro_memory_structure_resize(status, mutexs, f_thread_mutex_t, length) + #define f_macro_thread_mutexs_t_adjust(status, mutexs, length) f_macro_memory_structure_adjust(status, mutexs, f_thread_mutex_t, length) - #define f_macro_thread_mutexs_t_resize(status, mutexs, length) f_macro_memory_structure_resize(status, mutexs, f_thread_mutex_t, length); - #define f_macro_thread_mutexs_t_adjust(status, mutexs, length) f_macro_memory_structure_adjust(status, mutexs, f_thread_mutex_t, length); + #define f_macro_thread_mutexs_t_delete(status, mutexs) f_macro_memory_structure_delete(status, mutexs, f_thread_mutex_t) + #define f_macro_thread_mutexs_t_destroy(status, mutexs) f_macro_memory_structure_destroy(status, mutexs, f_thread_mutex_t) - #define f_macro_thread_mutexs_t_delete(status, mutexs) f_macro_memory_structure_delete(status, mutexs, f_thread_mutex_t); - #define f_macro_thread_mutexs_t_destroy(status, mutexs) f_macro_memory_structure_destroy(status, mutexs, f_thread_mutex_t); + #define f_macro_thread_mutexs_t_delete_simple(mutexs) f_macro_memory_structure_delete_simple(mutexs, f_thread_mutex_t) + #define f_macro_thread_mutexs_t_destroy_simple(mutexs) f_macro_memory_structure_destroy_simple(mutexs, f_thread_mutex_t) - #define f_macro_thread_mutexs_t_delete_simple(mutexs) f_macro_memory_structure_delete_simple(mutexs, f_thread_mutex_t); - #define f_macro_thread_mutexs_t_destroy_simple(mutexs) f_macro_memory_structure_destroy_simple(mutexs, f_thread_mutex_t); - - #define f_macro_thread_mutexs_t_increase(status, mutexs) f_macro_memory_structure_increase(status, mutexs, f_thread_mutex_t); - #define f_macro_thread_mutexs_t_increase_by(status, mutexs, amount) f_macro_memory_structure_increase_by(status, mutexs, f_thread_mutex_t, amount); - #define f_macro_thread_mutexs_t_decrease_by(status, mutexs, amount) f_macro_memory_structure_decrease_by(status, mutexs, f_thread_mutex_t, amount); - #define f_macro_thread_mutexs_t_decimate_by(status, mutexs, amount) f_macro_memory_structure_decimate_by(status, mutexs, f_thread_mutex_t, amount); + #define f_macro_thread_mutexs_t_increase(status, mutexs) f_macro_memory_structure_increase(status, mutexs, f_thread_mutex_t) + #define f_macro_thread_mutexs_t_increase_by(status, mutexs, amount) f_macro_memory_structure_increase_by(status, mutexs, f_thread_mutex_t, amount) + #define f_macro_thread_mutexs_t_decrease_by(status, mutexs, amount) f_macro_memory_structure_decrease_by(status, mutexs, f_thread_mutex_t, amount) + #define f_macro_thread_mutexs_t_decimate_by(status, mutexs, amount) f_macro_memory_structure_decimate_by(status, mutexs, f_thread_mutex_t, amount) #endif // _di_f_thread_mutexs_t_ /** @@ -295,7 +283,7 @@ extern "C" { #define f_thread_mutex_attribute_t_initialize 0 - #define f_macro_thread_mutex_attribute_t_clear(mutex_attribute) mutex_attribute = 0; + #define f_macro_thread_mutex_attribute_t_clear(mutex_attribute) mutex_attribute = 0 #endif // _di_f_thread_mutex_attribute_t_ /** @@ -315,21 +303,19 @@ extern "C" { #define f_thread_mutex_attributes_t_initialize { 0, 0, 0 } - #define f_macro_thread_mutex_attributes_t_new(status, mutex_attributes, length) f_macro_memory_structure_new(status, mutex_attributes, f_thread_mutex_attribute_t, length); - - #define f_macro_thread_mutex_attributes_t_resize(status, mutex_attributes, length) f_macro_memory_structure_resize(status, mutex_attributes, f_thread_mutex_attribute_t, length); - #define f_macro_thread_mutex_attributes_t_adjust(status, mutex_attributes, length) f_macro_memory_structure_adjust(status, mutex_attributes, f_thread_mutex_attribute_t, length); + #define f_macro_thread_mutex_attributes_t_resize(status, mutex_attributes, length) f_macro_memory_structure_resize(status, mutex_attributes, f_thread_mutex_attribute_t, length) + #define f_macro_thread_mutex_attributes_t_adjust(status, mutex_attributes, length) f_macro_memory_structure_adjust(status, mutex_attributes, f_thread_mutex_attribute_t, length) - #define f_macro_thread_mutex_attributes_t_delete(status, mutex_attributes) f_macro_memory_structure_delete(status, mutex_attributes, f_thread_mutex_attribute_t); - #define f_macro_thread_mutex_attributes_t_destroy(status, mutex_attributes) f_macro_memory_structure_destroy(status, mutex_attributes, f_thread_mutex_attribute_t); + #define f_macro_thread_mutex_attributes_t_delete(status, mutex_attributes) f_macro_memory_structure_delete(status, mutex_attributes, f_thread_mutex_attribute_t) + #define f_macro_thread_mutex_attributes_t_destroy(status, mutex_attributes) f_macro_memory_structure_destroy(status, mutex_attributes, f_thread_mutex_attribute_t) - #define f_macro_thread_mutex_attributes_t_delete_simple(mutex_attributes) f_macro_memory_structure_delete_simple(mutex_attributes, f_thread_mutex_attribute_t); - #define f_macro_thread_mutex_attributes_t_destroy_simple(mutex_attributes) f_macro_memory_structure_destroy_simple(mutex_attributes, f_thread_mutex_attribute_t); + #define f_macro_thread_mutex_attributes_t_delete_simple(mutex_attributes) f_macro_memory_structure_delete_simple(mutex_attributes, f_thread_mutex_attribute_t) + #define f_macro_thread_mutex_attributes_t_destroy_simple(mutex_attributes) f_macro_memory_structure_destroy_simple(mutex_attributes, f_thread_mutex_attribute_t) - #define f_macro_thread_mutex_attributes_t_increase(status, mutex_attributes) f_macro_memory_structure_increase(status, mutex_attributes, f_thread_mutex_attribute_t); - #define f_macro_thread_mutex_attributes_t_increase_by(status, mutex_attributes, amount) f_macro_memory_structure_increase_by(status, mutex_attributes, f_thread_mutex_attribute_t, amount); - #define f_macro_thread_mutex_attributes_t_decrease_by(status, mutex_attributes, amount) f_macro_memory_structure_decrease_by(status, mutex_attributes, f_thread_mutex_attribute_t, amount); - #define f_macro_thread_mutex_attributes_t_decimate_by(status, mutex_attributes, amount) f_macro_memory_structure_decimate_by(status, mutex_attributes, f_thread_mutex_attribute_t, amount); + #define f_macro_thread_mutex_attributes_t_increase(status, mutex_attributes) f_macro_memory_structure_increase(status, mutex_attributes, f_thread_mutex_attribute_t) + #define f_macro_thread_mutex_attributes_t_increase_by(status, mutex_attributes, amount) f_macro_memory_structure_increase_by(status, mutex_attributes, f_thread_mutex_attribute_t, amount) + #define f_macro_thread_mutex_attributes_t_decrease_by(status, mutex_attributes, amount) f_macro_memory_structure_decrease_by(status, mutex_attributes, f_thread_mutex_attribute_t, amount) + #define f_macro_thread_mutex_attributes_t_decimate_by(status, mutex_attributes, amount) f_macro_memory_structure_decimate_by(status, mutex_attributes, f_thread_mutex_attribute_t, amount) #endif // _di_f_thread_mutex_attributes_t_ /** @@ -340,7 +326,7 @@ extern "C" { #define f_thread_once_t_initialize 0 - #define f_macro_thread_once_t_clear(once) once = 0; + #define f_macro_thread_once_t_clear(once) once = 0 #endif // _di_f_thread_once_t_ /** @@ -360,21 +346,19 @@ extern "C" { #define f_thread_onces_t_initialize { 0, 0, 0 } - #define f_macro_thread_onces_t_new(status, onces, length) f_macro_memory_structure_new(status, onces, f_thread_once_t, length); + #define f_macro_thread_onces_t_resize(status, onces, length) f_macro_memory_structure_resize(status, onces, f_thread_once_t, length) + #define f_macro_thread_onces_t_adjust(status, onces, length) f_macro_memory_structure_adjust(status, onces, f_thread_once_t, length) - #define f_macro_thread_onces_t_resize(status, onces, length) f_macro_memory_structure_resize(status, onces, f_thread_once_t, length); - #define f_macro_thread_onces_t_adjust(status, onces, length) f_macro_memory_structure_adjust(status, onces, f_thread_once_t, length); + #define f_macro_thread_onces_t_delete(status, onces) f_macro_memory_structure_delete(status, onces, f_thread_once_t) + #define f_macro_thread_onces_t_destroy(status, onces) f_macro_memory_structure_destroy(status, onces, f_thread_once_t) - #define f_macro_thread_onces_t_delete(status, onces) f_macro_memory_structure_delete(status, onces, f_thread_once_t); - #define f_macro_thread_onces_t_destroy(status, onces) f_macro_memory_structure_destroy(status, onces, f_thread_once_t); + #define f_macro_thread_onces_t_delete_simple(onces) f_macro_memory_structure_delete_simple(onces, f_thread_once_t) + #define f_macro_thread_onces_t_destroy_simple(onces) f_macro_memory_structure_destroy_simple(onces, f_thread_once_t) - #define f_macro_thread_onces_t_delete_simple(onces) f_macro_memory_structure_delete_simple(onces, f_thread_once_t); - #define f_macro_thread_onces_t_destroy_simple(onces) f_macro_memory_structure_destroy_simple(onces, f_thread_once_t); - - #define f_macro_thread_onces_t_increase(status, onces) f_macro_memory_structure_increase(status, onces, f_thread_once_t); - #define f_macro_thread_onces_t_increase_by(status, onces, amount) f_macro_memory_structure_increase_by(status, onces, f_thread_once_t, amount); - #define f_macro_thread_onces_t_decrease_by(status, onces, amount) f_macro_memory_structure_decrease_by(status, onces, f_thread_once_t, amount); - #define f_macro_thread_onces_t_decimate_by(status, onces, amount) f_macro_memory_structure_decimate_by(status, onces, f_thread_once_t, amount); + #define f_macro_thread_onces_t_increase(status, onces) f_macro_memory_structure_increase(status, onces, f_thread_once_t) + #define f_macro_thread_onces_t_increase_by(status, onces, amount) f_macro_memory_structure_increase_by(status, onces, f_thread_once_t, amount) + #define f_macro_thread_onces_t_decrease_by(status, onces, amount) f_macro_memory_structure_decrease_by(status, onces, f_thread_once_t, amount) + #define f_macro_thread_onces_t_decimate_by(status, onces, amount) f_macro_memory_structure_decimate_by(status, onces, f_thread_once_t, amount) #endif // _di_f_thread_onces_t_ /** @@ -415,21 +399,19 @@ extern "C" { #define f_thread_sets_t_initialize { 0, 0, 0 } - #define f_macro_thread_sets_t_new(status, sets, length) f_macro_memory_structure_new(status, sets, f_thread_set_t, length); - - #define f_macro_thread_sets_t_resize(status, sets, length) f_macro_memory_structure_resize(status, sets, f_thread_set_t, length); - #define f_macro_thread_sets_t_adjust(status, sets, length) f_macro_memory_structure_adjust(status, sets, f_thread_set_t, length); + #define f_macro_thread_sets_t_resize(status, sets, length) f_macro_memory_structure_resize(status, sets, f_thread_set_t, length) + #define f_macro_thread_sets_t_adjust(status, sets, length) f_macro_memory_structure_adjust(status, sets, f_thread_set_t, length) - #define f_macro_thread_sets_t_delete(status, sets) f_macro_memory_structure_delete(status, sets, f_thread_set_t); - #define f_macro_thread_sets_t_destroy(status, sets) f_macro_memory_structure_destroy(status, sets, f_thread_set_t); + #define f_macro_thread_sets_t_delete(status, sets) f_macro_memory_structure_delete(status, sets, f_thread_set_t) + #define f_macro_thread_sets_t_destroy(status, sets) f_macro_memory_structure_destroy(status, sets, f_thread_set_t) - #define f_macro_thread_sets_t_delete_simple(sets) f_macro_memory_structure_delete_simple(sets, f_thread_set_t); - #define f_macro_thread_sets_t_destroy_simple(sets) f_macro_memory_structure_destroy_simple(sets, f_thread_set_t); + #define f_macro_thread_sets_t_delete_simple(sets) f_macro_memory_structure_delete_simple(sets, f_thread_set_t) + #define f_macro_thread_sets_t_destroy_simple(sets) f_macro_memory_structure_destroy_simple(sets, f_thread_set_t) - #define f_macro_thread_sets_t_increase(status, sets) f_macro_memory_structure_increase(status, sets, f_thread_set_t); - #define f_macro_thread_sets_t_increase_by(status, sets, amount) f_macro_memory_structure_increase_by(status, sets, f_thread_set_t, amount); - #define f_macro_thread_sets_t_decrease_by(status, sets, amount) f_macro_memory_structure_decrease_by(status, sets, f_thread_set_t, amount); - #define f_macro_thread_sets_t_decimate_by(status, sets, amount) f_macro_memory_structure_decimate_by(status, sets, f_thread_set_t, amount); + #define f_macro_thread_sets_t_increase(status, sets) f_macro_memory_structure_increase(status, sets, f_thread_set_t) + #define f_macro_thread_sets_t_increase_by(status, sets, amount) f_macro_memory_structure_increase_by(status, sets, f_thread_set_t, amount) + #define f_macro_thread_sets_t_decrease_by(status, sets, amount) f_macro_memory_structure_decrease_by(status, sets, f_thread_set_t, amount) + #define f_macro_thread_sets_t_decimate_by(status, sets, amount) f_macro_memory_structure_decimate_by(status, sets, f_thread_set_t, amount) #endif // _di_f_thread_sets_t_ #ifdef __cplusplus diff --git a/level_0/f_type/c/type.h b/level_0/f_type/c/type.h index a9cfab3..bdd5791 100644 --- a/level_0/f_type/c/type.h +++ b/level_0/f_type/c/type.h @@ -368,6 +368,513 @@ extern "C" { date.time = 0; #endif // _di_f_date_t_ +/** + * An array of array lengths. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of array lengths. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_f_array_lengths_t_ + typedef struct { + f_array_length_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_array_lengths_t; + + #define f_array_lengths_t_initialize { 0, 0, 0 } +#endif // _di_f_array_lengths_t_ + +/** + * An array of an array of array lengths. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array lengths. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_f_array_lengthss_t_ + typedef struct { + f_array_lengths_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_array_lengthss_t; + + #define f_array_lengthss_t_initialize { 0, 0, 0 } +#endif // _di_f_array_lengthss_t_ + +/** + * An array of f_cell_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of f_cell_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_f_cells_t_ + typedef struct { + f_cell_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_cells_t; + + #define f_cells_t_initialize { 0, 0, 0 } +#endif // _di_f_cells_t_ + +/** + * This holds an array of f_cells_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: The array of f_cell_t arrays. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_f_cellss_t_ + typedef struct { + f_cells_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_cellss_t; + + #define f_cellss_t_initialize { 0, 0, 0 } +#endif // _di_f_cellss_t_ + +/** + * An array of array int8_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of int8_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_f_array_t_int8_t_ + typedef struct { + int8_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int8s_t; + + #define f_int8s_t_initialize { 0, 0, 0 } +#endif // _di_int8s_t_ + +/** + * An array of an array of array int8_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array int8_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_int8ss_t_ + typedef struct { + f_int8s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int8ss_t; + + #define f_int8ss_t_initialize { 0, 0, 0 } +#endif // _di_int8ss_t_ + +/** + * An array of array uint8_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of uint8_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_uint8s_t_ + typedef struct { + uint8_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint8s_t; + + #define f_uint8s_t_initialize { 0, 0, 0 } +#endif // _di_uint8s_t_ + +/** + * An array of an array of array uint8_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array uint8_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_uint8ss_t_ + typedef struct { + f_uint8s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint8ss_t; + + #define f_uint8ss_t_initialize { 0, 0, 0 } +#endif // _di_uint8ss_t_ + +/** + * An array of array int16_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of int16_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_int16s_t_ + typedef struct { + int16_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int16s_t; + + #define f_int16s_t_initialize { 0, 0, 0 } +#endif // _di_int16s_t_ + +/** + * An array of an array of array int16_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array int16_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_int16ss_t_ + typedef struct { + f_int16s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int16ss_t; + + #define f_int16ss_t_initialize { 0, 0, 0 } +#endif // _di_int16ss_t_ + +/** + * An array of array uint16_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of uint16_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_uint16s_t_ + typedef struct { + uint16_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint16s_t; + + #define f_uint16s_t_initialize { 0, 0, 0 } +#endif // _di_uint16s_t_ + +/** + * An array of an array of array uint16_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array uint16_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_uint16ss_t_ + typedef struct { + f_uint16s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint16ss_t; + + #define f_uint16ss_t_initialize { 0, 0, 0 } +#endif // _di_uint16ss_t_ + +/** + * An array of array int32_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of int32_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_int32s_t_ + typedef struct { + int32_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int32s_t; + + #define f_int32s_t_initialize { 0, 0, 0 } +#endif // _di_int32s_t_ + +/** + * An array of an array of array int32_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array int32_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_int32ss_t_ + typedef struct { + f_int32s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int32ss_t; + + #define f_int32ss_t_initialize { 0, 0, 0 } +#endif // _di_int32ss_t_ + +/** + * An array of array uint32_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of uint32_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_uint32s_t_ + typedef struct { + uint32_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint32s_t; + + #define f_uint32s_t_initialize { 0, 0, 0 } +#endif // _di_uint32s_t_ + +/** + * An array of an array of array uint32_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array uint32_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_uint32ss_t_ + typedef struct { + f_uint32s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint32ss_t; + + #define f_uint32ss_t_initialize { 0, 0, 0 } +#endif // _di_uint32ss_t_ + +/** + * An array of array int64_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of int64_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_int64s_t_ + typedef struct { + int64_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int64s_t; + + #define f_int64s_t_initialize { 0, 0, 0 } +#endif // _di_int64s_t_ + +/** + * An array of an array of array int64_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array int64_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_int64ss_t_ + typedef struct { + f_int64s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int64ss_t; + + #define f_int64ss_t_initialize { 0, 0, 0 } +#endif // _di_int64ss_t_ + +/** + * An array of array uint64_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: An array of uint64_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_uint64s_t_ + typedef struct { + uint64_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint64s_t; + + #define f_uint64s_t_initialize { 0, 0, 0 } +#endif // _di_uint64s_t_ + +/** + * An array of an array of array uint64_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of an array of array uint64_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_uint64ss_t_ + typedef struct { + f_uint64s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint64ss_t; + + #define f_uint64ss_t_initialize { 0, 0, 0 } +#endif // _di_uint64ss_t_ + +/** + * Provide a 128-bit type wrapper, which could be either 64-bit or 128-bit depending on support. + * + * This is __int128_t when 128-bit is supported and int64_t when not supported. + */ +#ifndef __SIZEOF_INT128__ + + #ifndef _di_int128_t_ + typedef __int128_t f_int128_t; + #endif // _di_int128_t_ + + #ifndef _di_uint128_t_ + typedef __uint128_t f_uint128_t; + #endif // _di_uint128_t_ + +#else // __SIZEOF_INT128__ + + #ifndef _di_int128_t_ + typedef int64_t f_int128_t; + #endif // _di_int128_t_ + + #ifndef _di_uint128_t_ + typedef uint64_t f_uint128_t; + #endif // _di_uint128_t_ + +#endif // __SIZEOF_INT128__ + +/** + * An array of f_int128_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of f_int128_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_int128s_t_ + typedef struct { + f_int128_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int128s_t; + + #define f_int128s_t_initialize { 0, 0, 0 } +#endif // _di_int128s_t_ + +/** + * An array of and array of f_int128_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of and array of f_int128_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_int128ss_t_ + typedef struct { + f_int128s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_int128ss_t; + + #define f_int128ss_t_initialize { 0, 0, 0 } +#endif // _di_int128ss_t_ + +/** + * An array of f_uint128_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of f_uint128_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_uint128s_t_ + typedef struct { + f_uint128_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint128s_t; + + #define f_uint128s_t_initialize { 0, 0, 0 } +#endif // _di_uint128s_t_ + +/** + * An array of and array of f_uint128_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: the array of and array of f_uint128_t. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_uint128ss_t_ + typedef struct { + f_uint128s_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_uint128ss_t; + + #define f_uint128ss_t_initialize { 0, 0, 0 } +#endif // _di_uint128ss_t_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_type/c/type_array.h b/level_0/f_type/c/type_array.h deleted file mode 100644 index 00f6a55..0000000 --- a/level_0/f_type/c/type_array.h +++ /dev/null @@ -1,970 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: Type - * API Version: 0.5 - * Licenses: lgplv2.1 - * - * Provides datatypes that require memory operations. - * - * Because memory requires status.h, this is moved to a separate file to prevent circular dependency issues. - */ -#ifndef _F_type_array_h -#define _F_type_array_h - -// fll-0 includes -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * An array of array lengths. - * - * array: An array of array lengths. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_f_array_lengths_t_ - typedef struct { - f_array_length_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_array_lengths_t; - - #define f_array_lengths_t_initialize { 0, 0, 0 } - - #define f_macro_array_lengths_t_clear(lengths) f_macro_memory_structure_clear(lengths); - - #define f_macro_array_lengths_t_new(status, lengths, length) f_macro_memory_structure_new(status, lengths, f_array_length_t, length); - - #define f_macro_array_lengths_t_resize(status, lengths, length) f_macro_memory_structure_resize(status, lengths, f_array_length_t, length); - #define f_macro_array_lengths_t_adjust(status, lengths, length) f_macro_memory_structure_adjust(status, lengths, f_array_length_t, length); - - #define f_macro_array_lengths_t_increase(status, lengths) f_macro_memory_structure_increase(status, lengths, f_array_length_t); - #define f_macro_array_lengths_t_increase_by(status, lengths, amount) f_macro_memory_structure_increase_by(status, lengths, f_array_length_t, amount); - #define f_macro_array_lengths_t_decrease_by(status, lengths, amount) f_macro_memory_structure_decrease_by(status, lengths, f_array_length_t, amount); - #define f_macro_array_lengths_t_decimate_by(status, lengths, amount) f_macro_memory_structure_decimate_by(status, lengths, f_array_length_t, amount); - - #define f_macro_array_lengths_t_delete(status, lengths) f_macro_memory_structure_delete(status, lengths, f_array_length_t); - #define f_macro_array_lengths_t_destroy(status, lengths) f_macro_memory_structure_destroy(status, lengths, f_array_length_t); - - #define f_macro_array_lengths_t_delete_simple(lengths) f_macro_memory_structure_delete_simple(lengths, f_array_length_t); - #define f_macro_array_lengths_t_destroy_simple(lengths) f_macro_memory_structure_destroy_simple(lengths, f_array_length_t); -#endif // _di_f_array_lengths_t_ - -/** - * An array of an array of array lengths. - * - * array: the array of an array of array lengths. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_f_array_lengthss_t_ - typedef struct { - f_array_lengths_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_array_lengthss_t; - - #define f_array_lengthss_t_initialize { 0, 0, 0 } - - #define f_macro_array_lengthss_t_clear(lengths) f_macro_memory_structures_clear(lengths); - - #define f_macro_array_lengthss_t_new(status, lengths, length) f_macro_memory_structures_new(status, lengths, f_array_length_t, length); - - #define f_macro_array_lengthss_t_delete(status, lengths) f_macro_memory_structures_delete(status, lengths, f_array_length_t, f_array_lengths_t); - #define f_macro_array_lengthss_t_destroy(status, lengths) f_macro_memory_structures_destroy(status, lengths, f_array_length_t, f_array_lengths_t); - - #define f_macro_array_lengthss_t_delete_simple(lengths) f_macro_memory_structures_delete_simple(lengths, f_array_length_t, f_array_lengths_t); - #define f_macro_array_lengthss_t_destroy_simple(lengths) f_macro_memory_structures_destroy_simple(lengths, f_array_length_t, f_array_lengths_t); - - #define f_macro_array_lengthss_t_resize(status, lengths, length) f_macro_memory_structures_resize(status, lengths, f_array_length_t, f_array_lengths_t, length, f_array_length_t); - #define f_macro_array_lengthss_t_adjust(status, lengths, length) f_macro_memory_structures_adjust(status, lengths, f_array_length_t, f_array_lengths_t, length, f_array_length_t); -#endif // _di_f_array_lengthss_t_ - -/** - * An array of f_cell_t. - * - * array: the array of f_cell_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_f_cells_t_ - typedef struct { - f_cell_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_cells_t; - - #define f_cells_t_initialize {0, 0, 0} - - #define f_macro_cells_t_clear(cells) f_macro_memory_structure_clear(cells); - - #define f_macro_cells_t_new(status, cells, length) f_macro_memory_structure_new(status, cells, f_cell_t, length); - - #define f_macro_cells_t_resize(status, cells, length) f_macro_memory_structure_resize(status, cells, f_cell_t, length); - #define f_macro_cells_t_adjust(status, cells, length) f_macro_memory_structure_adjust(status, cells, f_cell_t, length); - - #define f_macro_cells_t_increase(status, cells) f_macro_memory_structure_increase(status, cells, f_cell_t); - #define f_macro_cells_t_increase_by(status, cells, amount) f_macro_memory_structure_increase_by(status, cells, f_cell_t, amount); - #define f_macro_cells_t_decrease_by(status, cells, amount) f_macro_memory_structure_decrease_by(status, cells, f_cell_t, amount); - #define f_macro_cells_t_decimate_by(status, cells, amount) f_macro_memory_structure_decimate_by(status, cells, f_cell_t, amount); - - #define f_macro_cells_t_delete(status, cells) f_macro_memory_structure_delete(status, cells, f_cell_t); - #define f_macro_cells_t_destroy(status, cells) f_macro_memory_structure_destroy(status, cells, f_cell_t); - - #define f_macro_cells_t_delete_simple(cells) f_macro_memory_structure_delete_simple(cells, f_cell_t); - #define f_macro_cells_t_destroy_simple(cells) f_macro_memory_structure_destroy_simple(cells, f_cell_t); - - -#endif // _di_f_cells_t_ - -/** - * This holds an array of f_cells_t. - * - * array: The array of f_cell_t arrays. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_f_cellss_t_ - typedef struct { - f_cells_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_cellss_t; - - #define f_cellss_t_initialize { 0, 0, 0 } - - #define f_macro_cellss_t_clear(rangess) f_macro_memory_structures_clear(rangess); - - #define f_macro_cellss_t_new(status, rangess, length) f_macro_memory_structures_new(status, rangess, f_cells_t, length); - - #define f_macro_cellss_t_delete(status, rangess) f_macro_memory_structures_delete(status, rangess, f_cell_t, f_cells_t); - #define f_macro_cellss_t_destroy(status, rangess) f_macro_memory_structures_destroy(status, rangess, f_cell_t, f_cells_t); - - #define f_macro_cellss_t_delete_simple(rangess) f_macro_memory_structures_delete_simple(rangess, f_cell_t, f_cells_t); - #define f_macro_cellss_t_destroy_simple(rangess) f_macro_memory_structures_destroy_simple(rangess, f_cell_t, f_cells_t); - - #define f_macro_cellss_t_resize(status, rangess, length) f_macro_memory_structures_resize(status, rangess, f_cell_t, f_cells_t, length, f_array_length_t); - #define f_macro_cellss_t_adjust(status, rangess, length) f_macro_memory_structures_adjust(status, rangess, f_cell_t, f_cells_t, length, f_array_length_t); -#endif // _di_f_cellss_t_ - -/** - * An array of array int8_t. - * - * array: An array of int8_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_f_array_t_int8_t_ - typedef struct { - int8_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int8s_t; - - #define f_int8s_t_initialize { 0, 0, 0 } - - #define f_macro_int8s_t_clear(int8s) f_macro_memory_structure_clear(int8s); - - #define f_macro_int8s_t_new(status, int8s, length) f_macro_memory_structure_new(status, int8s, int8_t, length); - - #define f_macro_int8s_t_resize(status, int8s, length) f_macro_memory_structure_resize(status, int8s, int8_t, length); - #define f_macro_int8s_t_adjust(status, int8s, length) f_macro_memory_structure_adjust(status, int8s, int8_t, length); - - #define f_macro_int8s_t_delete(status, int8s) f_macro_memory_structure_delete(status, int8s, int8_t); - #define f_macro_int8s_t_destroy(status, int8s) f_macro_memory_structure_destroy(status, int8s, int8_t); - - #define f_macro_int8s_t_delete_simple(int8s) f_macro_memory_structure_delete_simple(int8s, int8_t); - #define f_macro_int8s_t_destroy_simple(int8s) f_macro_memory_structure_destroy_simple(int8s, int8_t); - - #define f_macro_int8s_t_increase(status, int8s) f_macro_memory_structure_increase(status, int8s, int8_t); - #define f_macro_int8s_t_increase_by(status, int8s, amount) f_macro_memory_structure_increase_by(status, int8s, int8_t, amount); - #define f_macro_int8s_t_decrease_by(status, int8s, amount) f_macro_memory_structure_decrease_by(status, int8s, int8_t, amount); - #define f_macro_int8s_t_decimate_by(status, int8s, amount) f_macro_memory_structure_decimate_by(status, int8s, int8_t, amount); -#endif // _di_int8s_t_ - -/** - * An array of an array of array int8_t. - * - * array: the array of an array of array int8_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_int8ss_t_ - typedef struct { - f_int8s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int8ss_t; - - #define f_int8ss_t_initialize { 0, 0, 0 } - - #define f_macro_int8ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_int8ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int8_t, length); - - #define f_macro_int8ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int8_t, f_int8s_t); - #define f_macro_int8ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int8_t, f_int8s_t); - - #define f_macro_int8ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int8_t, f_int8s_t); - #define f_macro_int8ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int8_t, f_int8s_t); - - #define f_macro_int8ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, int8_t, f_int8s_t, length, f_array_length_t); - #define f_macro_int8ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, int8_t, f_int8s_t, length, f_array_length_t); -#endif // _di_int8ss_t_ - -/** - * An array of array uint8_t. - * - * array: An array of uint8_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_uint8s_t_ - typedef struct { - uint8_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint8s_t; - - #define f_uint8s_t_initialize { 0, 0, 0 } - - #define f_macro_uint8s_t_clear(uint8s) f_macro_memory_structure_clear(uint8s); - - #define f_macro_uint8s_t_new(status, uint8s, length) f_macro_memory_structure_new(status, uint8s, uint8_t, length); - - #define f_macro_uint8s_t_adjust(status, uint8s, length) f_macro_memory_structure_adjust(status, uint8s, uint8_t, length); - #define f_macro_uint8s_t_resize(status, uint8s, length) f_macro_memory_structure_resize(status, uint8s, uint8_t, length); - - #define f_macro_uint8s_t_increase(status, uint8s) f_macro_memory_structure_increase(status, uint8s, uint8_t); - #define f_macro_uint8s_t_increase_by(status, uint8s, amount) f_macro_memory_structure_increase_by(status, uint8s, uint8_t, amount); - #define f_macro_uint8s_t_decrease_by(status, uint8s, amount) f_macro_memory_structure_decrease_by(status, uint8s, uint8_t, amount); - #define f_macro_uint8s_t_decimate_by(status, uint8s, amount) f_macro_memory_structure_decimate_by(status, uint8s, uint8_t, amount); - - #define f_macro_uint8s_t_delete(status, uint8s) f_macro_memory_structure_delete(status, uint8s, uint8_t); - #define f_macro_uint8s_t_destroy(status, uint8s) f_macro_memory_structure_destroy(status, uint8s, uint8_t); - - #define f_macro_uint8s_t_delete_simple(uint8s) f_macro_memory_structure_delete_simple(uint8s, uint8_t); - #define f_macro_uint8s_t_destroy_simple(uint8s) f_macro_memory_structure_destroy_simple(uint8s, uint8_t); -#endif // _di_uint8s_t_ - -/** - * An array of an array of array uint8_t. - * - * array: the array of an array of array uint8_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_uint8ss_t_ - typedef struct { - f_uint8s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint8ss_t; - - #define f_uint8ss_t_initialize { 0, 0, 0 } - - #define f_macro_uint8ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_uint8ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint8_t, length); - - #define f_macro_uint8ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint8_t, f_uint8s_t); - #define f_macro_uint8ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint8_t, f_uint8s_t); - #define f_macro_uint8ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint8_t, f_uint8s_t); - - #define f_macro_uint8ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint8_t, f_uint8s_t); - #define f_macro_uint8ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint8_t, f_uint8s_t); - - #define f_macro_uint8ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, uint8_t, f_uint8s_t, length, f_array_length_t); - #define f_macro_uint8ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, uint8_t, f_uint8s_t, length, f_array_length_t); -#endif // _di_uint8ss_t_ - -/** - * An array of array int16_t. - * - * array: An array of int16_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_int16s_t_ - typedef struct { - int16_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int16s_t; - - #define f_int16s_t_initialize { 0, 0, 0 } - - #define f_macro_int16s_t_clear(int16s) f_macro_memory_structure_clear(int16s); - - #define f_macro_int16s_t_new(status, int16s, length) f_macro_memory_structure_new(status, int16s, int16_t, length); - - #define f_macro_int16s_t_adjust(status, int16s, length) f_macro_memory_structure_adjust(status, int16s, int16_t, length); - #define f_macro_int16s_t_resize(status, int16s, length) f_macro_memory_structure_resize(status, int16s, int16_t, length); - - #define f_macro_int16s_t_increase(status, int16s) f_macro_memory_structure_increase(status, int16s, int16_t); - #define f_macro_int16s_t_increase_by(status, int16s, amount) f_macro_memory_structure_increase_by(status, int16s, int16_t, amount); - #define f_macro_int16s_t_decrease_by(status, int16s, amount) f_macro_memory_structure_decrease_by(status, int16s, int16_t, amount); - #define f_macro_int16s_t_decimate_by(status, int16s, amount) f_macro_memory_structure_decimate_by(status, int16s, int16_t, amount); - - #define f_macro_int16s_t_delete(status, int16s) f_macro_memory_structure_delete(status, int16s, int16_t); - #define f_macro_int16s_t_destroy(status, int16s) f_macro_memory_structure_destroy(status, int16s, int16_t); - - #define f_macro_int16s_t_delete_simple(int16s) f_macro_memory_structure_delete_simple(int16s, int16_t); - #define f_macro_int16s_t_destroy_simple(int16s) f_macro_memory_structure_destroy_simple(int16s, int16_t); -#endif // _di_int16s_t_ - -/** - * An array of an array of array int16_t. - * - * array: the array of an array of array int16_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_int16ss_t_ - typedef struct { - f_int16s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int16ss_t; - - #define f_int16ss_t_initialize { 0, 0, 0 } - - #define f_macro_int16ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_int16ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int16_t, length); - - #define f_macro_int16ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int16_t, f_int16s_t); - #define f_macro_int16ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int16_t, f_int16s_t); - - #define f_macro_int16ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int16_t, f_int16s_t); - #define f_macro_int16ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int16_t, f_int16s_t); - - #define f_macro_int16ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, int16_t, f_int16s_t, length, f_array_length_t); - #define f_macro_int16ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, int16_t, f_int16s_t, length, f_array_length_t); -#endif // _di_int16ss_t_ - -/** - * An array of array uint16_t. - * - * array: An array of uint16_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_uint16s_t_ - typedef struct { - uint16_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint16s_t; - - #define f_uint16s_t_initialize { 0, 0, 0 } - - #define f_macro_uint16s_t_clear(uint16s) f_macro_memory_structure_clear(uint16s); - - #define f_macro_uint16s_t_new(status, uint16s, length) f_macro_memory_structure_new(status, uint16s, uint16_t, length); - - #define f_macro_uint16s_t_adjust(status, uint16s, length) f_macro_memory_structure_adjust(status, uint16s, uint16_t, length); - #define f_macro_uint16s_t_resize(status, uint16s, length) f_macro_memory_structure_resize(status, uint16s, uint16_t, length); - - #define f_macro_uint16s_t_increase(status, uint16s) f_macro_memory_structure_increase(status, uint16s, uint16_t); - #define f_macro_uint16s_t_increase_by(status, uint16s, amount) f_macro_memory_structure_increase_by(status, uint16s, uint16_t, amount); - #define f_macro_uint16s_t_decrease_by(status, uint16s, amount) f_macro_memory_structure_decrease_by(status, uint16s, uint16_t, amount); - #define f_macro_uint16s_t_decimate_by(status, uint16s, amount) f_macro_memory_structure_decimate_by(status, uint16s, uint16_t, amount); - - #define f_macro_uint16s_t_delete(status, uint16s) f_macro_memory_structure_delete(status, uint16s, uint16_t); - #define f_macro_uint16s_t_destroy(status, uint16s) f_macro_memory_structure_destroy(status, uint16s, uint16_t); - - #define f_macro_uint16s_t_delete_simple(uint16s) f_macro_memory_structure_delete_simple(uint16s, uint16_t); - #define f_macro_uint16s_t_destroy_simple(uint16s) f_macro_memory_structure_destroy_simple(uint16s, uint16_t); -#endif // _di_uint16s_t_ - -/** - * An array of an array of array uint16_t. - * - * array: the array of an array of array uint16_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_uint16ss_t_ - typedef struct { - f_uint16s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint16ss_t; - - #define f_uint16ss_t_initialize { 0, 0, 0 } - - #define f_macro_uint16ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_uint16ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint16_t, length); - - #define f_macro_uint16ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint16_t, f_uint16s_t); - #define f_macro_uint16ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint16_t, f_uint16s_t); - - #define f_macro_uint16ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint16_t, f_uint16s_t); - #define f_macro_uint16ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint16_t, f_uint16s_t); - - #define f_macro_uint16ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, uint16_t, f_uint16s_t, length, f_array_length_t); - #define f_macro_uint16ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, uint16_t, f_uint16s_t, length, f_array_length_t); -#endif // _di_uint16ss_t_ - -/** - * An array of array int32_t. - * - * array: An array of int32_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_int32s_t_ - typedef struct { - int32_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int32s_t; - - #define f_int32s_t_initialize { 0, 0, 0 } - - #define f_macro_int32s_t_clear(int32s) f_macro_memory_structure_clear(int32s); - - #define f_macro_int32s_t_new(status, int32s, length) f_macro_memory_structure_new(status, int32s, int32_t, length); - - #define f_macro_int32s_t_adjust(status, int32s, length) f_macro_memory_structure_adjust(status, int32s, int32_t, length); - #define f_macro_int32s_t_resize(status, int32s, length) f_macro_memory_structure_resize(status, int32s, int32_t, length); - - #define f_macro_int32s_t_increase(status, int32s) f_macro_memory_structure_increase(status, int32s, int32_t); - #define f_macro_int32s_t_increase_by(status, int32s, amount) f_macro_memory_structure_increase_by(status, int32s, int32_t, amount); - #define f_macro_int32s_t_decrease_by(status, int32s, amount) f_macro_memory_structure_decrease_by(status, int32s, int32_t, amount); - #define f_macro_int32s_t_decimate_by(status, int32s, amount) f_macro_memory_structure_decimate_by(status, int32s, int32_t, amount); - - #define f_macro_int32s_t_delete(status, int32s) f_macro_memory_structure_delete(status, int32s, int32_t); - #define f_macro_int32s_t_destroy(status, int32s) f_macro_memory_structure_destroy(status, int32s, int32_t); - - #define f_macro_int32s_t_delete_simple(int32s) f_macro_memory_structure_delete_simple(int32s, int32_t); - #define f_macro_int32s_t_destroy_simple(int32s) f_macro_memory_structure_destroy_simple(int32s, int32_t); -#endif // _di_int32s_t_ - -/** - * An array of an array of array int32_t. - * - * array: the array of an array of array int32_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_int32ss_t_ - typedef struct { - f_int32s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int32ss_t; - - #define f_int32ss_t_initialize { 0, 0, 0 } - - #define f_macro_int32ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_int32ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int32_t, length); - - #define f_macro_int32ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int32_t, f_int32s_t); - #define f_macro_int32ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int32_t, f_int32s_t); - - #define f_macro_int32ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int32_t, f_int32s_t); - #define f_macro_int32ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int32_t, f_int32s_t); - - #define f_macro_int32ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, int32_t, f_int32s_t, length, f_array_length_t); - #define f_macro_int32ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, int32_t, f_int32s_t, length, f_array_length_t); -#endif // _di_int32ss_t_ - -/** - * An array of array uint32_t. - * - * array: An array of uint32_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_uint32s_t_ - typedef struct { - uint32_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint32s_t; - - #define f_uint32s_t_initialize { 0, 0, 0 } - - #define f_macro_uint32s_t_clear(uint32s) f_macro_memory_structure_clear(uint32s); - - #define f_macro_uint32s_t_new(status, uint32s, length) f_macro_memory_structure_new(status, uint32s, uint32_t, length); - - #define f_macro_uint32s_t_adjust(status, uint32s, length) f_macro_memory_structure_adjust(status, uint32s, uint32_t, length); - #define f_macro_uint32s_t_resize(status, uint32s, length) f_macro_memory_structure_resize(status, uint32s, uint32_t, length); - - #define f_macro_uint32s_t_increase(status, uint32s) f_macro_memory_structure_increase(status, uint32s, uint32_t); - #define f_macro_uint32s_t_increase_by(status, uint32s, amount) f_macro_memory_structure_increase_by(status, uint32s, uint32_t, amount); - #define f_macro_uint32s_t_decrease_by(status, uint32s, amount) f_macro_memory_structure_decrease_by(status, uint32s, uint32_t, amount); - #define f_macro_uint32s_t_decimate_by(status, uint32s, amount) f_macro_memory_structure_decimate_by(status, uint32s, uint32_t, amount); - - #define f_macro_uint32s_t_delete(status, uint32s) f_macro_memory_structure_delete(status, uint32s, uint32_t); - #define f_macro_uint32s_t_destroy(status, uint32s) f_macro_memory_structure_destroy(status, uint32s, uint32_t); - - #define f_macro_uint32s_t_delete_simple(uint32s) f_macro_memory_structure_delete_simple(uint32s, uint32_t); - #define f_macro_uint32s_t_destroy_simple(uint32s) f_macro_memory_structure_destroy_simple(uint32s, uint32_t); -#endif // _di_uint32s_t_ - -/** - * An array of an array of array uint32_t. - * - * array: the array of an array of array uint32_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_uint32ss_t_ - typedef struct { - f_uint32s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint32ss_t; - - #define f_uint32ss_t_initialize { 0, 0, 0 } - - #define f_macro_uint32ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_uint32ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint32_t, length); - - #define f_macro_uint32ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint32_t, f_uint32s_t); - #define f_macro_uint32ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint32_t, f_uint32s_t); - - #define f_macro_uint32ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint32_t, f_uint32s_t); - #define f_macro_uint32ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint32_t, f_uint32s_t); - - #define f_macro_uint32ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, uint32_t, f_uint32s_t, length, f_array_length_t); - #define f_macro_uint32ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, uint32_t, f_uint32s_t, length, f_array_length_t); -#endif // _di_uint32ss_t_ - -/** - * An array of array int64_t. - * - * array: An array of int64_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_int64s_t_ - typedef struct { - int64_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int64s_t; - - #define f_int64s_t_initialize { 0, 0, 0 } - - #define f_macro_int64s_t_clear(int64s) f_macro_memory_structure_clear(int64s); - - #define f_macro_int64s_t_new(status, int64s, length) f_macro_memory_structure_new(status, int64s, int64_t, length); - - #define f_macro_int64s_t_adjust(status, int64s, length) f_macro_memory_structure_adjust(status, int64s, int64_t, length); - #define f_macro_int64s_t_resize(status, int64s, length) f_macro_memory_structure_resize(status, int64s, int64_t, length); - - #define f_macro_int64s_t_increase(status, int64s) f_macro_memory_structure_increase(status, int64s, int64_t); - #define f_macro_int64s_t_increase_by(status, int64s, amount) f_macro_memory_structure_increase_by(status, int64s, int64_t, amount); - #define f_macro_int64s_t_decrease_by(status, int64s, amount) f_macro_memory_structure_decrease_by(status, int64s, int64_t, amount); - #define f_macro_int64s_t_decimate_by(status, int64s, amount) f_macro_memory_structure_decimate_by(status, int64s, int64_t, amount); - - #define f_macro_int64s_t_delete(status, int64s) f_macro_memory_structure_delete(status, int64s, int64_t); - #define f_macro_int64s_t_destroy(status, int64s) f_macro_memory_structure_destroy(status, int64s, int64_t); - - #define f_macro_int64s_t_delete_simple(int64s) f_macro_memory_structure_delete_simple(int64s, int64_t); - #define f_macro_int64s_t_destroy_simple(int64s) f_macro_memory_structure_destroy_simple(int64s, int64_t); -#endif // _di_int64s_t_ - -/** - * An array of an array of array int64_t. - * - * array: the array of an array of array int64_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_int64ss_t_ - typedef struct { - f_int64s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int64ss_t; - - #define f_int64ss_t_initialize { 0, 0, 0 } - - #define f_macro_int64ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_int64ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int64_t, length); - - #define f_macro_int64ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int64_t, f_int64s_t); - #define f_macro_int64ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int64_t, f_int64s_t); - - #define f_macro_int64ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int64_t, f_int64s_t); - #define f_macro_int64ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int64_t, f_int64s_t); - - #define f_macro_int64ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, int64_t, f_int64s_t, length, f_array_length_t); - #define f_macro_int64ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, int64_t, f_int64s_t, length, f_array_length_t); -#endif // _di_int64ss_t_ - -/** - * An array of array uint64_t. - * - * array: An array of uint64_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_uint64s_t_ - typedef struct { - uint64_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint64s_t; - - #define f_uint64s_t_initialize { 0, 0, 0 } - - #define f_macro_uint64s_t_clear(uint64s) f_macro_memory_structure_clear(uint64s); - - #define f_macro_uint64s_t_new(status, uint64s, length) f_macro_memory_structure_new(status, uint64s, uint64_t, length); - - #define f_macro_uint64s_t_adjust(status, uint64s, length) f_macro_memory_structure_adjust(status, uint64s, uint64_t, length); - #define f_macro_uint64s_t_resize(status, uint64s, length) f_macro_memory_structure_resize(status, uint64s, uint64_t, length); - - #define f_macro_uint64s_t_increase(status, uint64s) f_macro_memory_structure_increase(status, uint64s, uint64_t); - #define f_macro_uint64s_t_increase_by(status, uint64s, amount) f_macro_memory_structure_increase_by(status, uint64s, uint64_t, amount); - #define f_macro_uint64s_t_decrease_by(status, uint64s, amount) f_macro_memory_structure_decrease_by(status, uint64s, uint64_t, amount); - #define f_macro_uint64s_t_decimate_by(status, uint64s, amount) f_macro_memory_structure_decimate_by(status, uint64s, uint64_t, amount); - - #define f_macro_uint64s_t_delete(status, uint64s) f_macro_memory_structure_delete(status, uint64s, uint64_t); - #define f_macro_uint64s_t_destroy(status, uint64s) f_macro_memory_structure_destroy(status, uint64s, uint64_t); - - #define f_macro_uint64s_t_delete_simple(uint64s) f_macro_memory_structure_delete_simple(uint64s, uint64_t); - #define f_macro_uint64s_t_destroy_simple(uint64s) f_macro_memory_structure_destroy_simple(uint64s, uint64_t); -#endif // _di_uint64s_t_ - -/** - * An array of an array of array uint64_t. - * - * array: the array of an array of array uint64_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_uint64ss_t_ - typedef struct { - f_uint64s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint64ss_t; - - #define f_uint64ss_t_initialize { 0, 0, 0 } - - #define f_macro_uint64ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_uint64ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint64_t, length); - - #define f_macro_uint64ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint64_t, f_uint64s_t); - #define f_macro_uint64ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint64_t, f_uint64s_t); - - #define f_macro_uint64ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint64_t, f_uint64s_t); - #define f_macro_uint64ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint64_t, f_uint64s_t); - - #define f_macro_uint64ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, uint64_t, f_uint64s_t, length, f_array_length_t); - #define f_macro_uint64ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, uint64_t, f_uint64s_t, length, f_array_length_t); -#endif // _di_uint64ss_t_ - -#ifndef __SIZEOF_INT128__ - /** - * An array of array __int128_t. - * - * array: An array of __int128_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ - #ifndef _di_int128s_t_ - typedef struct { - __int128_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int128s_t; - - #define f_int128s_t_initialize { 0, 0, 0 } - - #define f_macro_int128s_t_clear(int128s) f_macro_memory_structure_clear(int128s); - - #define f_macro_int128s_t_new(status, int128s, length) f_macro_memory_structure_new(status, int128s, __int128_t, length); - - #define f_macro_int128s_t_adjust(status, int128s, length) f_macro_memory_structure_adjust(status, int128s, __int128_t, length); - #define f_macro_int128s_t_resize(status, int128s, length) f_macro_memory_structure_resize(status, int128s, __int128_t, length); - - #define f_macro_int128s_t_increase(status, int128s) f_macro_memory_structure_increase(status, int128s, __int128_t); - #define f_macro_int128s_t_increase_by(status, int128s, amount) f_macro_memory_structure_increase_by(status, int128s, __int128_t, amount); - #define f_macro_int128s_t_decrease_by(status, int128s, amount) f_macro_memory_structure_decrease_by(status, int128s, __int128_t, amount); - #define f_macro_int128s_t_decimate_by(status, int128s, amount) f_macro_memory_structure_decimate_by(status, int128s, __int128_t, amount); - - #define f_macro_int128s_t_delete(status, int128s) f_macro_memory_structure_delete(status, int128s, __int128_t); - #define f_macro_int128s_t_destroy(status, int128s) f_macro_memory_structure_destroy(status, int128s, __int128_t); - - #define f_macro_int128s_t_delete_simple(int128s) f_macro_memory_structure_delete_simple(int128s, __int128_t); - #define f_macro_int128s_t_destroy_simple(int128s) f_macro_memory_structure_destroy_simple(int128s, __int128_t); - #endif // _di_int128s_t_ - - /** - * An array of an array of array __int128_t. - * - * array: the array of an array of array __int128_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ - #ifndef _di_int128ss_t_ - typedef struct { - f_int128s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int128ss_t; - - #define f_int128ss_t_initialize { 0, 0, 0 } - - #define f_macro_int128ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_int128ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, __int128_t, length); - - #define f_macro_int128ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, __int128_t, f_int128s_t); - #define f_macro_int128ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, __int128_t, f_int128s_t); - - #define f_macro_int128ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, __int128_t, f_int128s_t); - #define f_macro_int128ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, __int128_t, f_int128s_t); - - #define f_macro_int128ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, __int128_t, f_int128s_t, length, f_array_length_t); - #define f_macro_int128ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, __int128_t, f_int128s_t, length, f_array_length_t); - #endif // _di_int128ss_t_ - - /** - * An array of array __uint128_t. - * - * array: An array of __uint128_t. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ - #ifndef _di_uint128s_t_ - typedef struct { - __uint128_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint128s_t; - - #define f_uint128s_t_initialize { 0, 0, 0 } - - #define f_macro_uint128s_t_clear(uint128s) f_macro_memory_structure_clear(uint128s); - - #define f_macro_uint128s_t_new(status, uint128s, length) f_macro_memory_structure_new(status, uint128s, __uint128_t, length); - - #define f_macro_uint128s_t_adjust(status, uint128s, length) f_macro_memory_structure_adjust(status, uint128s, __uint128_t, length); - #define f_macro_uint128s_t_resize(status, uint128s, length) f_macro_memory_structure_resize(status, uint128s, __uint128_t, length); - - #define f_macro_uint128s_t_increase(status, uint128s) f_macro_memory_structure_increase(status, uint128s, __uint128_t); - #define f_macro_uint128s_t_increase_by(status, uint128s, amount) f_macro_memory_structure_increase_by(status, uint128s, __uint128_t, amount); - #define f_macro_uint128s_t_decrease_by(status, uint128s, amount) f_macro_memory_structure_decrease_by(status, uint128s, __uint128_t, amount); - #define f_macro_uint128s_t_decimate_by(status, uint128s, amount) f_macro_memory_structure_decimate_by(status, uint128s, __uint128_t, amount); - - #define f_macro_uint128s_t_delete(status, uint128s) f_macro_memory_structure_delete(status, uint128s, __uint128_t); - #define f_macro_uint128s_t_destroy(status, uint128s) f_macro_memory_structure_destroy(status, uint128s, __uint128_t); - - #define f_macro_uint128s_t_delete_simple(uint128s) f_macro_memory_structure_delete_simple(uint128s, __uint128_t); - #define f_macro_uint128s_t_destroy_simple(uint128s) f_macro_memory_structure_destroy_simple(uint128s, __uint128_t); - #endif // _di_uint128s_t_ - - /** - * An array of an array of array __uint128_t. - * - * array: the array of an array of array __uint128_t. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ - #ifndef _di_uint128ss_t_ - typedef struct { - f_uint128s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint128ss_t; - - #define f_uint128ss_t_initialize { 0, 0, 0 } - - #define f_macro_uint128ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_uint128ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, __uint128_t, length); - - #define f_macro_uint128ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, __uint128_t, f_uint128s_t); - #define f_macro_uint128ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, __uint128_t, f_uint128s_t); - - #define f_macro_uint128ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, __uint128_t, f_uint128s_t); - #define f_macro_uint128ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, __uint128_t, f_uint128s_t); - - #define f_macro_uint128ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, __uint128_t, f_uint128s_t, length, f_array_length_t); - #define f_macro_uint128ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, __uint128_t, f_uint128s_t, length, f_array_length_t); - #endif // _di_uint128ss_t_ -#else - /** - * An array of array int64_t acting in place of __int128_t when 128 is not supported. - * - * array: An array of int64_t acting in place of __int128_t when 128 is not supported. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ - #ifndef _di_int128s_t_ - typedef struct { - int64_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int128s_t; - - #define f_int128s_t_initialize { 0, 0, 0 } - - #define f_macro_int128s_t_clear(int128s) f_macro_memory_structure_clear(int128s); - - #define f_macro_int128s_t_new(status, int128s, length) f_macro_memory_structure_new(status, int128s, int64_t, length); - - #define f_macro_int128s_t_adjust(status, int128s, length) f_macro_memory_structure_adjust(status, int128s, int64_t, length); - #define f_macro_int128s_t_resize(status, int128s, length) f_macro_memory_structure_resize(status, int128s, int64_t, length); - - #define f_macro_int128s_t_increase(status, int128s) f_macro_memory_structure_increase(status, int128s, int64_t); - #define f_macro_int128s_t_increase_by(status, int128s, amount) f_macro_memory_structure_increase_by(status, int128s, int64_t, amount); - #define f_macro_int128s_t_decrease_by(status, int128s, amount) f_macro_memory_structure_decrease_by(status, int128s, int64_t, amount); - #define f_macro_int128s_t_decimate_by(status, int128s, amount) f_macro_memory_structure_decimate_by(status, int128s, int64_t, amount); - - #define f_macro_int128s_t_delete(status, int128s) f_macro_memory_structure_delete(status, int128s, int64_t); - #define f_macro_int128s_t_destroy(status, int128s) f_macro_memory_structure_destroy(status, int128s, int64_t); - - #define f_macro_int128s_t_delete_simple(int128s) f_macro_memory_structure_delete_simple(int128s, int64_t); - #define f_macro_int128s_t_destroy_simple(int128s) f_macro_memory_structure_destroy_simple(int128s, int64_t); - #endif // _di_int128s_t_ - - /** - * An array of an array of array int64_t acting in place of __int128_t when 128 is not supported. - * - * array: the array of an array of array int64_t acting in place of __int128_t when 128 is not supported. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ - #ifndef _di_int128ss_t_ - typedef struct { - f_int128s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_int128ss_t; - - #define f_int128ss_t_initialize { 0, 0, 0 } - - #define f_macro_int128ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_int128ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int64_t, length); - - #define f_macro_int128ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int64_t, f_int128s_t); - #define f_macro_int128ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int64_t, f_int128s_t); - - #define f_macro_int128ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int64_t, f_int128s_t); - #define f_macro_int128ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int64_t, f_int128s_t); - - #define f_macro_int128ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, int64_t, f_int128s_t, length, f_array_length_t); - #define f_macro_int128ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, int64_t, f_int128s_t, length, f_array_length_t); - #endif // _di_int128ss_t_ - - /** - * An array of array uint64_t acting in place of __uint128_t when 128 is not supported. - * - * array: An array of uint64_t acting in place of __uint128_t when 128 is not supported. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ - #ifndef _di_uint128s_t_ - typedef struct { - uint64_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint128s_t; - - #define f_uint128s_t_initialize { 0, 0, 0 } - - #define f_macro_uint128s_t_clear(uint128s) f_macro_memory_structure_clear(uint128s); - - #define f_macro_uint128s_t_new(status, uint128s, length) f_macro_memory_structure_new(status, uint128s, uint64_t, length); - - #define f_macro_uint128s_t_adjust(status, uint128s, length) f_macro_memory_structure_adjust(status, uint128s, uint64_t, length); - #define f_macro_uint128s_t_resize(status, uint128s, length) f_macro_memory_structure_resize(status, uint128s, uint64_t, length); - - #define f_macro_uint128s_t_increase(status, uint128s) f_macro_memory_structure_increase(status, uint128s, uint64_t); - #define f_macro_uint128s_t_increase_by(status, uint128s, amount) f_macro_memory_structure_increase_by(status, uint128s, uint64_t, amount); - #define f_macro_uint128s_t_decrease_by(status, uint128s, amount) f_macro_memory_structure_decrease_by(status, uint128s, uint64_t, amount); - #define f_macro_uint128s_t_decimate_by(status, uint128s, amount) f_macro_memory_structure_decimate_by(status, uint128s, uint64_t, amount); - - #define f_macro_uint128s_t_delete(status, uint128s) f_macro_memory_structure_delete(status, uint128s, uint64_t); - #define f_macro_uint128s_t_destroy(status, uint128s) f_macro_memory_structure_destroy(status, uint128s, uint64_t); - - #define f_macro_uint128s_t_delete_simple(uint128s) f_macro_memory_structure_delete_simple(uint128s, uint64_t); - #define f_macro_uint128s_t_destroy_simple(uint128s) f_macro_memory_structure_destroy_simple(uint128s, uint64_t); - #endif // _di_uint128s_t_ - - /** - * An array of an array of array uint64_t acting in place of __uint128_t when 128 is not supported. - * - * array: the array of an array of array uint64_t acting in place of __uint128_t when 128 is not supported. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ - #ifndef _di_uint128ss_t_ - typedef struct { - f_uint128s_t *array; - - f_array_length_t size; - f_array_length_t used; - } f_uint128ss_t; - - #define f_uint128ss_t_initialize { 0, 0, 0 } - - #define f_macro_uint128ss_t_clear(numbers) f_macro_memory_structures_clear(numbers); - - #define f_macro_uint128ss_t_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint64_t, length); - - #define f_macro_uint128ss_t_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint64_t, f_uint128s_t); - #define f_macro_uint128ss_t_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint64_t, f_uint128s_t); - - #define f_macro_uint128ss_t_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint64_t, f_uint128s_t); - #define f_macro_uint128ss_t_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint64_t, f_uint128s_t); - - #define f_macro_uint128ss_t_resize(status, numbers, length) f_macro_memory_structures_resize(status, numbers, uint64_t, f_uint128s_t, length, f_array_length_t); - #define f_macro_uint128ss_t_adjust(status, numbers, length) f_macro_memory_structures_adjust(status, numbers, uint64_t, f_uint128s_t, length, f_array_length_t); - #endif // _di_uint128ss_t_ -#endif // __SIZEOF_INT128__ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _F_type_array_h diff --git a/level_0/f_type/data/build/settings b/level_0/f_type/data/build/settings index 84dc3e5..5f1232c 100644 --- a/level_0/f_type/data/build/settings +++ b/level_0/f_type/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual build_sources_library build_sources_program -build_sources_headers type.h type_array.h +build_sources_headers type.h build_sources_script build_sources_setting build_script yes diff --git a/level_0/f_type_array/c/private-type_array.c b/level_0/f_type_array/c/private-type_array.c new file mode 100644 index 0000000..bcb8884 --- /dev/null +++ b/level_0/f_type_array/c/private-type_array.c @@ -0,0 +1,250 @@ +#include "type_array.h" +#include "private-type_array.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_f_type_cellss_adjust_) || !defined(_di_f_type_cellss_decimate_by_) + f_status_t private_f_type_cellss_adjust(const f_array_length_t length, f_cellss_t *cellss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*cellss), f_cell_t, f_cells_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_cellss_adjust_) || !defined(_di_f_type_cellss_decimate_by_) + +#if !defined(_di_f_type_cellss_decrease_by_) || !defined(_di_f_type_cellss_increase_) || !defined(_di_f_type_cellss_increase_by_) + f_status_t private_f_type_cellss_resize(const f_array_length_t length, f_cellss_t *cellss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*cellss), f_cell_t, f_cells_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_cellss_decrease_by_) || !defined(_di_f_type_cellss_increase_) || !defined(_di_f_type_cellss_increase_by_) + +#if !defined(_di_f_type_array_lengthss_adjust_) || !defined(_di_f_type_array_lengthss_decimate_by_) + f_status_t private_f_type_array_lengthss_adjust(const f_array_length_t length, f_array_lengthss_t *array_lengthss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*array_lengthss), f_array_length_t, f_array_lengths_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_array_lengthss_adjust_) || !defined(_di_f_type_array_lengthss_decimate_by_) + +#if !defined(_di_f_type_array_lengthss_decrease_by_) || !defined(_di_f_type_array_lengthss_increase_) || !defined(_di_f_type_array_lengthss_increase_by_) + f_status_t private_f_type_array_lengthss_resize(const f_array_length_t length, f_array_lengthss_t *array_lengthss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*array_lengthss), f_array_length_t, f_array_lengths_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_array_lengthss_decrease_by_) || !defined(_di_f_type_array_lengthss_increase_) || !defined(_di_f_type_array_lengthss_increase_by_) + +#if !defined(_di_f_type_int8ss_adjust_) || !defined(_di_f_type_int8ss_decimate_by_) + f_status_t private_f_type_int8ss_adjust(const f_array_length_t length, f_int8ss_t *int8ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*int8ss), int8_t, f_int8s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int8ss_adjust_) || !defined(_di_f_type_int8ss_decimate_by_) + +#if !defined(_di_f_type_int8ss_decrease_by_) || !defined(_di_f_type_int8ss_increase_) || !defined(_di_f_type_int8ss_increase_by_) + f_status_t private_f_type_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*int8ss), int8_t, f_int8s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int8ss_decrease_by_) || !defined(_di_f_type_int8ss_increase_) || !defined(_di_f_type_int8ss_increase_by_) + +#if !defined(_di_f_type_uint8ss_adjust_) || !defined(_di_f_type_uint8ss_decimate_by_) + f_status_t private_f_type_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*uint8ss), uint8_t, f_uint8s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint8ss_adjust_) || !defined(_di_f_type_uint8ss_decimate_by_) + +#if !defined(_di_f_type_uint8ss_decrease_by_) || !defined(_di_f_type_uint8ss_increase_) || !defined(_di_f_type_uint8ss_increase_by_) + f_status_t private_f_type_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*uint8ss), uint8_t, f_uint8s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint8ss_decrease_by_) || !defined(_di_f_type_uint8ss_increase_) || !defined(_di_f_type_uint8ss_increase_by_) + +#if !defined(_di_f_type_int16ss_adjust_) || !defined(_di_f_type_int16ss_decimate_by_) + f_status_t private_f_type_int16ss_adjust(const f_array_length_t length, f_int16ss_t *int16ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*int16ss), int16_t, f_int16s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int16ss_adjust_) || !defined(_di_f_type_int16ss_decimate_by_) + +#if !defined(_di_f_type_int16ss_decrease_by_) || !defined(_di_f_type_int16ss_increase_) || !defined(_di_f_type_int16ss_increase_by_) + f_status_t private_f_type_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*int16ss), int16_t, f_int16s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int16ss_decrease_by_) || !defined(_di_f_type_int16ss_increase_) || !defined(_di_f_type_int16ss_increase_by_) + +#if !defined(_di_f_type_uint16ss_adjust_) || !defined(_di_f_type_uint16ss_decimate_by_) + f_status_t private_f_type_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*uint16ss), uint16_t, f_uint16s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint16ss_adjust_) || !defined(_di_f_type_uint16ss_decimate_by_) + +#if !defined(_di_f_type_uint16ss_decrease_by_) || !defined(_di_f_type_uint16ss_increase_) || !defined(_di_f_type_uint16ss_increase_by_) + f_status_t private_f_type_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*uint16ss), uint16_t, f_uint16s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint16ss_decrease_by_) || !defined(_di_f_type_uint16ss_increase_) || !defined(_di_f_type_uint16ss_increase_by_) + +#if !defined(_di_f_type_int32ss_adjust_) || !defined(_di_f_type_int32ss_decimate_by_) + f_status_t private_f_type_int32ss_adjust(const f_array_length_t length, f_int32ss_t *int32ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*int32ss), int32_t, f_int32s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int32ss_adjust_) || !defined(_di_f_type_int32ss_decimate_by_) + +#if !defined(_di_f_type_int32ss_decrease_by_) || !defined(_di_f_type_int32ss_increase_) || !defined(_di_f_type_int32ss_increase_by_) + f_status_t private_f_type_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*int32ss), int32_t, f_int32s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int32ss_decrease_by_) || !defined(_di_f_type_int32ss_increase_) || !defined(_di_f_type_int32ss_increase_by_) + +#if !defined(_di_f_type_uint32ss_adjust_) || !defined(_di_f_type_uint32ss_decimate_by_) + f_status_t private_f_type_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*uint32ss), uint32_t, f_uint32s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint32ss_adjust_) || !defined(_di_f_type_uint32ss_decimate_by_) + +#if !defined(_di_f_type_uint32ss_decrease_by_) || !defined(_di_f_type_uint32ss_increase_) || !defined(_di_f_type_uint32ss_increase_by_) + f_status_t private_f_type_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*uint32ss), uint32_t, f_uint32s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint32ss_decrease_by_) || !defined(_di_f_type_uint32ss_increase_) || !defined(_di_f_type_uint32ss_increase_by_) + +#if !defined(_di_f_type_int64ss_adjust_) || !defined(_di_f_type_int64ss_decimate_by_) + f_status_t private_f_type_int64ss_adjust(const f_array_length_t length, f_int64ss_t *int64ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*int64ss), int64_t, f_int64s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int64ss_adjust_) || !defined(_di_f_type_int64ss_decimate_by_) + +#if !defined(_di_f_type_int64ss_decrease_by_) || !defined(_di_f_type_int64ss_increase_) || !defined(_di_f_type_int64ss_increase_by_) + f_status_t private_f_type_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*int64ss), int64_t, f_int64s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int64ss_decrease_by_) || !defined(_di_f_type_int64ss_increase_) || !defined(_di_f_type_int64ss_increase_by_) + +#if !defined(_di_f_type_uint64ss_adjust_) || !defined(_di_f_type_uint64ss_decimate_by_) + f_status_t private_f_type_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*uint64ss), uint64_t, f_uint64s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint64ss_adjust_) || !defined(_di_f_type_uint64ss_decimate_by_) + +#if !defined(_di_f_type_uint64ss_decrease_by_) || !defined(_di_f_type_uint64ss_increase_) || !defined(_di_f_type_uint64ss_increase_by_) + f_status_t private_f_type_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*uint64ss), uint64_t, f_uint64s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint64ss_decrease_by_) || !defined(_di_f_type_uint64ss_increase_) || !defined(_di_f_type_uint64ss_increase_by_) + +#if !defined(_di_f_type_int128ss_adjust_) || !defined(_di_f_type_int128ss_decimate_by_) + f_status_t private_f_type_int128ss_adjust(const f_array_length_t length, f_int128ss_t *int128ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*int128ss), f_int128_t, f_int128s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int128ss_adjust_) || !defined(_di_f_type_int128ss_decimate_by_) + +#if !defined(_di_f_type_int128ss_decrease_by_) || !defined(_di_f_type_int128ss_increase_) || !defined(_di_f_type_int128ss_increase_by_) + f_status_t private_f_type_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*int128ss), f_int128_t, f_int128s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_int128ss_decrease_by_) || !defined(_di_f_type_int128ss_increase_) || !defined(_di_f_type_int128ss_increase_by_) + +#if !defined(_di_f_type_uint128ss_adjust_) || !defined(_di_f_type_uint128ss_decimate_by_) + f_status_t private_f_type_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) { + f_status_t status = F_none; + + f_macro_memory_structures_adjust(status, (*uint128ss), f_uint128_t, f_uint128s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint128ss_adjust_) || !defined(_di_f_type_uint128ss_decimate_by_) + +#if !defined(_di_f_type_uint128ss_decrease_by_) || !defined(_di_f_type_uint128ss_increase_) || !defined(_di_f_type_uint128ss_increase_by_) + f_status_t private_f_type_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) { + f_status_t status = F_none; + + f_macro_memory_structures_resize(status, (*uint128ss), f_uint128_t, f_uint128s_t, length, f_array_length_t) + + return status; + } +#endif // !defined(_di_f_type_uint128ss_decrease_by_) || !defined(_di_f_type_uint128ss_increase_) || !defined(_di_f_type_uint128ss_increase_by_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_type_array/c/private-type_array.h b/level_0/f_type_array/c/private-type_array.h new file mode 100644 index 0000000..f5daa7b --- /dev/null +++ b/level_0/f_type_array/c/private-type_array.h @@ -0,0 +1,646 @@ +/** + * FLL - Level 0 + * + * Project: Type + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * These are provided for internal reduction in redundant code. + * These should not be exposed/used outside of this project. + */ +#ifndef _PRIVATE_F_type_array_h +#define _PRIVATE_F_type_array_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Private implementation for resizing the cellss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param cellss + * The cellss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_cellss_adjust() + * @see f_type_cellss_decimate_by() + */ +#if !defined(_di_f_type_cellss_adjust_) || !defined(_di_f_type_cellss_decimate_by_) + extern f_status_t private_f_type_cellss_adjust(const f_array_length_t length, f_cellss_t *cellss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_cellss_adjust_) || !defined(_di_f_type_cellss_decimate_by_) + +/** + * Private implementation for resizing the cellss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param cellss + * The cellss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_cellss_decrease_by() + * @see f_type_cellss_increase() + * @see f_type_cellss_increase_by() + * @see f_type_cellss_resize() + */ +#if !defined(_di_f_type_cellss_decrease_by_) || !defined(_di_f_type_cellss_increase_) || !defined(_di_f_type_cellss_increase_by_) || !defined(_di_f_type_cellss_resize_) + extern f_status_t private_f_type_cellss_resize(const f_array_length_t length, f_cellss_t *cellss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_cellss_decrease_by_) || !defined(_di_f_type_cellss_increase_) || !defined(_di_f_type_cellss_increase_by_) || !defined(_di_f_type_cellss_resize_) + +/** + * Private implementation for resizing the lengthss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param lengthss + * The lengthss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_array_lengthss_adjust() + * @see f_type_array_lengthss_decimate_by() + */ +#if !defined(_di_f_type_array_lengthss_adjust_) || !defined(_di_f_type_array_lengthss_decimate_by_) + extern f_status_t private_f_type_array_lengthss_adjust(const f_array_length_t length, f_array_lengthss_t *lengthss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_array_lengthss_adjust_) || !defined(_di_f_type_array_lengthss_decimate_by_) + +/** + * Private implementation for resizing the lengthss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param lengthss + * The lengthss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_array_lengthss_decrease_by() + * @see f_type_array_lengthss_increase() + * @see f_type_array_lengthss_increase_by() + * @see f_type_array_lengthss_resize() + */ +#if !defined(_di_f_type_array_lengthss_decrease_by_) || !defined(_di_f_type_array_lengthss_increase_) || !defined(_di_f_type_array_lengthss_increase_by_) || !defined(_di_f_type_array_lengthss_resize_) + extern f_status_t private_f_type_array_lengthss_resize(const f_array_length_t length, f_array_lengthss_t *lengthss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_array_lengthss_decrease_by_) || !defined(_di_f_type_array_lengthss_increase_) || !defined(_di_f_type_array_lengthss_increase_by_) || !defined(_di_f_type_array_lengthss_resize_) + +/** + * Private implementation for resizing the int8ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param int8ss + * The int8ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int8ss_adjust() + * @see f_type_int8ss_decimate_by() + */ +#if !defined(_di_f_type_int8ss_adjust_) || !defined(_di_f_type_int8ss_decimate_by_) + extern f_status_t private_f_type_int8ss_adjust(const f_array_length_t length, f_int8ss_t *int8ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int8ss_adjust_) || !defined(_di_f_type_int8ss_decimate_by_) + +/** + * Private implementation for resizing the int8ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param int8ss + * The int8ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int8ss_decrease_by() + * @see f_type_int8ss_increase() + * @see f_type_int8ss_increase_by() + * @see f_type_int8ss_resize() + */ +#if !defined(_di_f_type_int8ss_decrease_by_) || !defined(_di_f_type_int8ss_increase_) || !defined(_di_f_type_int8ss_increase_by_) || !defined(_di_f_type_int8ss_resize_) + extern f_status_t private_f_type_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int8ss_decrease_by_) || !defined(_di_f_type_int8ss_increase_) || !defined(_di_f_type_int8ss_increase_by_) || !defined(_di_f_type_int8ss_resize_) + +/** + * Private implementation for resizing the uint8ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param uint8ss + * The uint8ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint8ss_adjust() + * @see f_type_uint8ss_decimate_by() + */ +#if !defined(_di_f_type_int16ss_adjust_) || !defined(_di_f_type_int16ss_decimate_by_) + extern f_status_t private_f_type_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int16ss_adjust_) || !defined(_di_f_type_int16ss_decimate_by_) + +/** + * Private implementation for resizing the uint8ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param uint8ss + * The uint8ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint8ss_decrease_by() + * @see f_type_uint8ss_increase() + * @see f_type_uint8ss_increase_by() + * @see f_type_uint8ss_resize() + */ +#if !defined(_di_f_type_uint8ss_decrease_by_) || !defined(_di_f_type_uint8ss_increase_) || !defined(_di_f_type_uint8ss_increase_by_) || !defined(_di_f_type_uint8ss_resize_) + extern f_status_t private_f_type_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint8ss_decrease_by_) || !defined(_di_f_type_uint8ss_increase_) || !defined(_di_f_type_uint8ss_increase_by_) || !defined(_di_f_type_uint8ss_resize_) + +/** + * Private implementation for resizing the int16ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param int16ss + * The int16ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int16ss_adjust() + * @see f_type_int16ss_decimate_by() + */ +#if !defined(_di_f_type_int16ss_adjust_) || !defined(_di_f_type_int16ss_decimate_by_) + extern f_status_t private_f_type_int16ss_adjust(const f_array_length_t length, f_int16ss_t *int16ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int16ss_adjust_) || !defined(_di_f_type_int16ss_decimate_by_) + +/** + * Private implementation for resizing the int16ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param int16ss + * The int16ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int16ss_decrease_by() + * @see f_type_int16ss_increase() + * @see f_type_int16ss_increase_by() + * @see f_type_int16ss_resize() + */ +#if !defined(_di_f_type_int16ss_decrease_by_) || !defined(_di_f_type_int16ss_increase_) || !defined(_di_f_type_int16ss_increase_by_) || !defined(_di_f_type_int16ss_resize_) + extern f_status_t private_f_type_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int16ss_decrease_by_) || !defined(_di_f_type_int16ss_increase_) || !defined(_di_f_type_int16ss_increase_by_) || !defined(_di_f_type_int16ss_resize_) + +/** + * Private implementation for resizing the uint16ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param uint16ss + * The uint16ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint16ss_adjust() + * @see f_type_uint16ss_decimate_by() + */ +#if !defined(_di_f_type_uint16ss_adjust_) || !defined(_di_f_type_uint16ss_decimate_by_) + extern f_status_t private_f_type_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint16ss_adjust_) || !defined(_di_f_type_uint16ss_decimate_by_) + +/** + * Private implementation for resizing the uint16ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param uint16ss + * The uint16ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint16ss_decrease_by() + * @see f_type_uint16ss_increase() + * @see f_type_uint16ss_increase_by() + * @see f_type_uint16ss_resize() + */ +#if !defined(_di_f_type_uint16ss_decrease_by_) || !defined(_di_f_type_uint16ss_increase_) || !defined(_di_f_type_uint16ss_increase_by_) || !defined(_di_f_type_uint16ss_resize_) + extern f_status_t private_f_type_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint16ss_decrease_by_) || !defined(_di_f_type_uint16ss_increase_) || !defined(_di_f_type_uint16ss_increase_by_) || !defined(_di_f_type_uint16ss_resize_) + +/** + * Private implementation for resizing the int32ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param int32ss + * The int32ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int32ss_adjust() + * @see f_type_int32ss_decimate_by() + */ +#if !defined(_di_f_type_int32ss_adjust_) || !defined(_di_f_type_int32ss_decimate_by_) + extern f_status_t private_f_type_int32ss_adjust(const f_array_length_t length, f_int32ss_t *int32ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int32ss_adjust_) || !defined(_di_f_type_int32ss_decimate_by_) + +/** + * Private implementation for resizing the int32ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param int32ss + * The int32ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int32ss_decrease_by() + * @see f_type_int32ss_increase() + * @see f_type_int32ss_increase_by() + * @see f_type_int32ss_resize() + */ +#if !defined(_di_f_type_int32ss_decrease_by_) || !defined(_di_f_type_int32ss_increase_) || !defined(_di_f_type_int32ss_increase_by_) || !defined(_di_f_type_int32ss_resize_) + extern f_status_t private_f_type_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int32ss_decrease_by_) || !defined(_di_f_type_int32ss_increase_) || !defined(_di_f_type_int32ss_increase_by_) || !defined(_di_f_type_int32ss_resize_) + +/** + * Private implementation for resizing the uint32ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param uint32ss + * The uint32ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint32ss_adjust() + * @see f_type_uint32ss_decimate_by() + */ +#if !defined(_di_f_type_uint32ss_adjust_) || !defined(_di_f_type_uint32ss_decimate_by_) + extern f_status_t private_f_type_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint32ss_adjust_) || !defined(_di_f_type_uint32ss_decimate_by_) + +/** + * Private implementation for resizing the uint32ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param uint32ss + * The uint32ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint32ss_decrease_by() + * @see f_type_uint32ss_increase() + * @see f_type_uint32ss_increase_by() + * @see f_type_uint32ss_resize() + */ +#if !defined(_di_f_type_uint32ss_decrease_by_) || !defined(_di_f_type_uint32ss_increase_) || !defined(_di_f_type_uint32ss_increase_by_) || !defined(_di_f_type_uint32ss_resize_) + extern f_status_t private_f_type_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint32ss_decrease_by_) || !defined(_di_f_type_uint32ss_increase_) || !defined(_di_f_type_uint32ss_increase_by_) || !defined(_di_f_type_uint32ss_resize_) + +/** + * Private implementation for resizing the int64ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param int64ss + * The int64ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int64ss_adjust() + * @see f_type_int64ss_decimate_by() + */ +#if !defined(_di_f_type_int64ss_adjust_) || !defined(_di_f_type_int64ss_decimate_by_) + extern f_status_t private_f_type_int64ss_adjust(const f_array_length_t length, f_int64ss_t *int64ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int64ss_adjust_) || !defined(_di_f_type_int64ss_decimate_by_) + +/** + * Private implementation for resizing the int64ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param int64ss + * The int64ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int64ss_decrease_by() + * @see f_type_int64ss_increase() + * @see f_type_int64ss_increase_by() + * @see f_type_int64ss_resize() + */ +#if !defined(_di_f_type_int64ss_decrease_by_) || !defined(_di_f_type_int64ss_increase_) || !defined(_di_f_type_int64ss_increase_by_) || !defined(_di_f_type_int64ss_resize_) + extern f_status_t private_f_type_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int64ss_decrease_by_) || !defined(_di_f_type_int64ss_increase_) || !defined(_di_f_type_int64ss_increase_by_) || !defined(_di_f_type_int64ss_resize_) + +/** + * Private implementation for resizing the uint64ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param uint64ss + * The uint64ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint64ss_adjust() + * @see f_type_uint64ss_decimate_by() + */ +#if !defined(_di_f_type_uint64ss_adjust_) || !defined(_di_f_type_uint64ss_decimate_by_) + extern f_status_t private_f_type_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint64ss_adjust_) || !defined(_di_f_type_uint64ss_decimate_by_) + +/** + * Private implementation for resizing the uint64ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param uint64ss + * The uint64ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint64ss_decrease_by() + * @see f_type_uint64ss_increase() + * @see f_type_uint64ss_increase_by() + * @see f_type_uint64ss_resize() + */ +#if !defined(_di_f_type_uint64ss_decrease_by_) || !defined(_di_f_type_uint64ss_increase_) || !defined(_di_f_type_uint64ss_increase_by_) || !defined(_di_f_type_uint64ss_resize_) + extern f_status_t private_f_type_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint64ss_decrease_by_) || !defined(_di_f_type_uint64ss_increase_) || !defined(_di_f_type_uint64ss_increase_by_) || !defined(_di_f_type_uint64ss_resize_) + +/** + * Private implementation for resizing the int128ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param int128ss + * The int128ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int128ss_adjust() + * @see f_type_int128ss_resize() + */ +#if !defined(_di_f_type_int128ss_adjust_) || !defined(_di_f_type_int128ss_decimate_by_) + extern f_status_t private_f_type_int128ss_adjust(const f_array_length_t length, f_int128ss_t *int128ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int128ss_adjust_) || !defined(_di_f_type_int128ss_decimate_by_) + +/** + * Private implementation for resizing the int128ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param int128ss + * The int128ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_int128ss_decrease_by() + * @see f_type_int128ss_increase() + * @see f_type_int128ss_increase_by() + * @see f_type_int128ss_resize() + */ +#if !defined(_di_f_type_int128ss_decrease_by_) || !defined(_di_f_type_int128ss_increase_) || !defined(_di_f_type_int128ss_increase_by_) || !defined(_di_f_type_int128ss_resize_) + extern f_status_t private_f_type_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_int128ss_decrease_by_) || !defined(_di_f_type_int128ss_increase_) || !defined(_di_f_type_int128ss_increase_by_) || !defined(_di_f_type_int128ss_resize_) + +/** + * Private implementation for resizing the uint128ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param uint128ss + * The uint128ss array to adjust. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint128ss_adjust() + * @see f_type_uint128ss_decimate_by() + */ +#if !defined(_di_f_type_uint128ss_adjust_) || !defined(_di_f_type_uint128ss_decimate_by_) + extern f_status_t private_f_type_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint128ss_adjust_) || !defined(_di_f_type_uint128ss_decimate_by_) + +/** + * Private implementation for resizing the uint128ss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param uint128ss + * The uint128ss array to resize. + * + * @return + * F_none 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 new length is larger than max array length. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * + * @see f_type_uint128ss_decrease_by() + * @see f_type_uint128ss_increase() + * @see f_type_uint128ss_increase_by() + * @see f_type_uint128ss_resize() + */ +#if !defined(_di_f_type_uint128ss_decrease_by_) || !defined(_di_f_type_uint128ss_increase_) || !defined(_di_f_type_uint128ss_increase_by_) || !defined(_di_f_type_uint128ss_resize_) + extern f_status_t private_f_type_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_type_uint128ss_decrease_by_) || !defined(_di_f_type_uint128ss_increase_) || !defined(_di_f_type_uint128ss_increase_by_) || !defined(_di_f_type_uint128ss_resize_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_F_type_array_h diff --git a/level_0/f_type_array/c/type_array-common.h b/level_0/f_type_array/c/type_array-common.h new file mode 100644 index 0000000..6c44edf --- /dev/null +++ b/level_0/f_type_array/c/type_array-common.h @@ -0,0 +1,455 @@ +/** + * FLL - Level 0 + * + * Project: Type + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * Defines common data to be used for/by type (array) related functionality. + * + * This is auto-included by type_array.h and should not need to be explicitly included. + */ +#ifndef _F_type_array_common_h +#define _F_type_array_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_f_array_lengths_t_ + #define f_macro_array_lengths_t_clear(lengths) f_macro_memory_structure_clear(lengths) + + #define f_macro_array_lengths_t_resize(status, lengths, length) f_macro_memory_structure_resize(status, lengths, f_array_length_t, length) + #define f_macro_array_lengths_t_adjust(status, lengths, length) f_macro_memory_structure_adjust(status, lengths, f_array_length_t, length) + + #define f_macro_array_lengths_t_delete_simple(lengths) f_macro_memory_structure_delete_simple(lengths, f_array_length_t) + #define f_macro_array_lengths_t_destroy_simple(lengths) f_macro_memory_structure_destroy_simple(lengths, f_array_length_t) + + #define f_macro_array_lengths_t_increase(status, lengths) f_macro_memory_structure_increase(status, lengths, f_array_length_t) + #define f_macro_array_lengths_t_increase_by(status, lengths, amount) f_macro_memory_structure_increase_by(status, lengths, f_array_length_t, amount) + #define f_macro_array_lengths_t_decrease_by(status, lengths, amount) f_macro_memory_structure_decrease_by(status, lengths, f_array_length_t, amount) + #define f_macro_array_lengths_t_decimate_by(status, lengths, amount) f_macro_memory_structure_decimate_by(status, lengths, f_array_length_t, amount) +#endif // _di_f_array_lengths_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_f_array_lengthss_t_ + #define f_macro_array_lengthss_t_clear(lengths) f_macro_memory_structures_clear(lengths) + + #define f_macro_array_lengthss_t_resize(status, lengths, length) status = f_type_array_lengthss_resize(length, &lengths); + #define f_macro_array_lengthss_t_adjust(status, lengths, length) status = f_type_array_lengthss_adjust(length, &lengths); + + #define f_macro_array_lengthss_t_delete_simple(lengths) f_type_array_lengthss_resize(0, &lengths); + #define f_macro_array_lengthss_t_destroy_simple(lengths) f_type_array_lengthss_adjust(0, &lengths); + + #define f_macro_array_lengthss_t_increase(status, lengths) status = f_type_array_lengthss_increase(&lengths); + #define f_macro_array_lengthss_t_increase_by(status, lengths, amount) status = f_type_array_lengthss_increase(amount, &lengths); + #define f_macro_array_lengthss_t_decrease_by(status, lengths, amount) status = f_type_array_lengthss_decrease_by(amount, &lengths); + #define f_macro_array_lengthss_t_decimate_by(status, lengths, amount) status = f_type_array_lengthss_decimate_by(amount, &lengths); +#endif // _di_f_array_lengthss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_f_cells_t_ + #define f_macro_cells_t_clear(cells) f_macro_memory_structure_clear(cells) + + #define f_macro_cells_t_resize(status, cells, length) f_macro_memory_structure_resize(status, cells, f_cell_t, length) + #define f_macro_cells_t_adjust(status, cells, length) f_macro_memory_structure_adjust(status, cells, f_cell_t, length) + + #define f_macro_cells_t_delete_simple(cells) f_macro_memory_structure_delete_simple(cells, f_cell_t) + #define f_macro_cells_t_destroy_simple(cells) f_macro_memory_structure_destroy_simple(cells, f_cell_t) + + #define f_macro_cells_t_increase(status, cells) f_macro_memory_structure_increase(status, cells, f_cell_t) + #define f_macro_cells_t_increase_by(status, cells, amount) f_macro_memory_structure_increase_by(status, cells, f_cell_t, amount) + #define f_macro_cells_t_decrease_by(status, cells, amount) f_macro_memory_structure_decrease_by(status, cells, f_cell_t, amount) + #define f_macro_cells_t_decimate_by(status, cells, amount) f_macro_memory_structure_decimate_by(status, cells, f_cell_t, amount) +#endif // _di_f_cells_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_f_cellss_t_ + #define f_macro_cellss_t_clear(rangess) f_macro_memory_structures_clear(rangess) + + #define f_macro_cellss_t_resize(status, cellss, length) status = f_type_cellss_resize(length, &cellss); + #define f_macro_cellss_t_adjust(status, cellss, length) status = f_type_cellss_adjust(length, &cellss); + + #define f_macro_cellss_t_delete_simple(cellss) f_type_cellss_resize(0, &cellss); + #define f_macro_cellss_t_destroy_simple(cellss) f_type_cellss_adjust(0, &cellss); + + #define f_macro_cellss_t_increase(status, cellss) status = f_type_cellss_increase(&cellss); + #define f_macro_cellss_t_increase_by(status, cellss, amount) status = f_type_cellss_increase(amount, &cellss); + #define f_macro_cellss_t_decrease_by(status, cellss, amount) status = f_type_cellss_decrease_by(amount, &cellss); + #define f_macro_cellss_t_decimate_by(status, cellss, amount) status = f_type_cellss_decimate_by(amount, &cellss); +#endif // _di_f_cellss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_f_array_t_int8_t_ + #define f_macro_int8s_t_clear(int8s) f_macro_memory_structure_clear(int8s) + + #define f_macro_int8s_t_resize(status, int8s, length) f_macro_memory_structure_resize(status, int8s, int8_t, length) + #define f_macro_int8s_t_adjust(status, int8s, length) f_macro_memory_structure_adjust(status, int8s, int8_t, length) + + #define f_macro_int8s_t_delete_simple(int8s) f_macro_memory_structure_delete_simple(int8s, int8_t) + #define f_macro_int8s_t_destroy_simple(int8s) f_macro_memory_structure_destroy_simple(int8s, int8_t) + + #define f_macro_int8s_t_increase(status, int8s) f_macro_memory_structure_increase(status, int8s, int8_t) + #define f_macro_int8s_t_increase_by(status, int8s, amount) f_macro_memory_structure_increase_by(status, int8s, int8_t, amount) + #define f_macro_int8s_t_decrease_by(status, int8s, amount) f_macro_memory_structure_decrease_by(status, int8s, int8_t, amount) + #define f_macro_int8s_t_decimate_by(status, int8s, amount) f_macro_memory_structure_decimate_by(status, int8s, int8_t, amount) +#endif // _di_int8s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int8ss_t_ + #define f_macro_int8ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_int8ss_t_resize(status, int8ss, length) status = f_type_int8ss_resize(length, &int8ss); + #define f_macro_int8ss_t_adjust(status, int8ss, length) status = f_type_int8ss_adjust(length, &int8ss); + + #define f_macro_int8ss_t_increase(status, int8ss) status = f_type_int8ss_increase(&int8ss); + #define f_macro_int8ss_t_increase_by(status, int8ss, amount) status = f_type_int8ss_increase(amount, &int8ss); + #define f_macro_int8ss_t_decrease_by(status, int8ss, amount) status = f_type_int8ss_decrease_by(amount, &int8ss); + #define f_macro_int8ss_t_decimate_by(status, int8ss, amount) status = f_type_int8ss_decimate_by(amount, &int8ss); + + #define f_macro_int8ss_t_delete_simple(int8ss) f_type_int8ss_resize(0, &int8ss); + #define f_macro_int8ss_t_destroy_simple(int8ss) f_type_int8ss_adjust(0, &int8ss); +#endif // _di_int8ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint8s_t_ + #define f_macro_uint8s_t_clear(uint8s) f_macro_memory_structure_clear(uint8s) + + #define f_macro_uint8s_t_resize(status, uint8s, length) f_macro_memory_structure_resize(status, uint8s, uint8_t, length) + #define f_macro_uint8s_t_adjust(status, uint8s, length) f_macro_memory_structure_adjust(status, uint8s, uint8_t, length) + + #define f_macro_uint8s_t_increase(status, uint8s) f_macro_memory_structure_increase(status, uint8s, uint8_t) + #define f_macro_uint8s_t_increase_by(status, uint8s, amount) f_macro_memory_structure_increase_by(status, uint8s, uint8_t, amount) + #define f_macro_uint8s_t_decrease_by(status, uint8s, amount) f_macro_memory_structure_decrease_by(status, uint8s, uint8_t, amount) + #define f_macro_uint8s_t_decimate_by(status, uint8s, amount) f_macro_memory_structure_decimate_by(status, uint8s, uint8_t, amount) + + #define f_macro_uint8s_t_delete_simple(uint8s) f_macro_memory_structure_delete_simple(uint8s, uint8_t) + #define f_macro_uint8s_t_destroy_simple(uint8s) f_macro_memory_structure_destroy_simple(uint8s, uint8_t) +#endif // _di_uint8s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint8ss_t_ + #define f_macro_uint8ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_uint8ss_t_resize(status, uint8ss, length) status = f_type_uint8ss_resize(length, &uint8ss); + #define f_macro_uint8ss_t_adjust(status, uint8ss, length) status = f_type_uint8ss_adjust(length, &uint8ss); + + #define f_macro_uint8ss_t_delete_simple(uint8ss) f_type_uint8ss_resize(0, &uint8ss); + #define f_macro_uint8ss_t_destroy_simple(uint8ss) f_type_uint8ss_adjust(0, &uint8ss); + + #define f_macro_uint8ss_t_increase(status, uint8ss) status = f_type_uint8ss_increase(&uint8ss); + #define f_macro_uint8ss_t_increase_by(status, uint8ss, amount) status = f_type_uint8ss_increase(amount, &uint8ss); + #define f_macro_uint8ss_t_decrease_by(status, uint8ss, amount) status = f_type_uint8ss_decrease_by(amount, &uint8ss); + #define f_macro_uint8ss_t_decimate_by(status, uint8ss, amount) status = f_type_uint8ss_decimate_by(amount, &uint8ss); +#endif // _di_uint8ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int16s_t_ + #define f_macro_int16s_t_clear(int16s) f_macro_memory_structure_clear(int16s) + + #define f_macro_int16s_t_resize(status, int16s, length) f_macro_memory_structure_resize(status, int16s, int16_t, length) + #define f_macro_int16s_t_adjust(status, int16s, length) f_macro_memory_structure_adjust(status, int16s, int16_t, length) + + #define f_macro_int16s_t_delete_simple(int16s) f_macro_memory_structure_delete_simple(int16s, int16_t) + #define f_macro_int16s_t_destroy_simple(int16s) f_macro_memory_structure_destroy_simple(int16s, int16_t) + + #define f_macro_int16s_t_increase(status, int16s) f_macro_memory_structure_increase(status, int16s, int16_t) + #define f_macro_int16s_t_increase_by(status, int16s, amount) f_macro_memory_structure_increase_by(status, int16s, int16_t, amount) + #define f_macro_int16s_t_decrease_by(status, int16s, amount) f_macro_memory_structure_decrease_by(status, int16s, int16_t, amount) + #define f_macro_int16s_t_decimate_by(status, int16s, amount) f_macro_memory_structure_decimate_by(status, int16s, int16_t, amount) +#endif // _di_int16s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int16ss_t_ + #define f_macro_int16ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_int16ss_t_resize(status, int16ss, length) status = f_type_int16ss_resize(length, &int16ss); + #define f_macro_int16ss_t_adjust(status, int16ss, length) status = f_type_int16ss_adjust(length, &int16ss); + + #define f_macro_int16ss_t_increase(status, int16ss) status = f_type_int16ss_increase(&int16ss); + #define f_macro_int16ss_t_increase_by(status, int16ss, amount) status = f_type_int16ss_increase(amount, &int16ss); + #define f_macro_int16ss_t_decrease_by(status, int16ss, amount) status = f_type_int16ss_decrease_by(amount, &int16ss); + #define f_macro_int16ss_t_decimate_by(status, int16ss, amount) status = f_type_int16ss_decimate_by(amount, &int16ss); + + #define f_macro_int16ss_t_delete_simple(int16ss) f_type_int16ss_resize(0, &int16ss); + #define f_macro_int16ss_t_destroy_simple(int16ss) f_type_int16ss_adjust(0, &int16ss); +#endif // _di_int16ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint16s_t_ + #define f_macro_uint16s_t_clear(uint16s) f_macro_memory_structure_clear(uint16s) + + #define f_macro_uint16s_t_resize(status, uint16s, length) f_macro_memory_structure_resize(status, uint16s, uint16_t, length) + #define f_macro_uint16s_t_adjust(status, uint16s, length) f_macro_memory_structure_adjust(status, uint16s, uint16_t, length) + + #define f_macro_uint16s_t_delete_simple(uint16s) f_macro_memory_structure_delete_simple(uint16s, uint16_t) + #define f_macro_uint16s_t_destroy_simple(uint16s) f_macro_memory_structure_destroy_simple(uint16s, uint16_t) + + #define f_macro_uint16s_t_increase(status, uint16s) f_macro_memory_structure_increase(status, uint16s, uint16_t) + #define f_macro_uint16s_t_increase_by(status, uint16s, amount) f_macro_memory_structure_increase_by(status, uint16s, uint16_t, amount) + #define f_macro_uint16s_t_decrease_by(status, uint16s, amount) f_macro_memory_structure_decrease_by(status, uint16s, uint16_t, amount) + #define f_macro_uint16s_t_decimate_by(status, uint16s, amount) f_macro_memory_structure_decimate_by(status, uint16s, uint16_t, amount) +#endif // _di_uint16s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint16ss_t_ + #define f_macro_uint16ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_uint16ss_t_resize(status, uint16ss, length) status = f_type_uint16ss_resize(length, &uint16ss); + #define f_macro_uint16ss_t_adjust(status, uint16ss, length) status = f_type_uint16ss_adjust(length, &uint16ss); + + #define f_macro_uint16ss_t_delete_simple(uint16ss) f_type_uint16ss_resize(0, &uint16ss); + #define f_macro_uint16ss_t_destroy_simple(uint16ss) f_type_uint16ss_adjust(0, &uint16ss); + + #define f_macro_uint16ss_t_increase(status, uint16ss) status = f_type_uint16ss_increase(&uint16ss); + #define f_macro_uint16ss_t_increase_by(status, uint16ss, amount) status = f_type_uint16ss_increase(amount, &uint16ss); + #define f_macro_uint16ss_t_decrease_by(status, uint16ss, amount) status = f_type_uint16ss_decrease_by(amount, &uint16ss); + #define f_macro_uint16ss_t_decimate_by(status, uint16ss, amount) status = f_type_uint16ss_decimate_by(amount, &uint16ss); +#endif // _di_uint16ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int32s_t_ + #define f_macro_int32s_t_clear(int32s) f_macro_memory_structure_clear(int32s) + + #define f_macro_int32s_t_resize(status, int32s, length) f_macro_memory_structure_resize(status, int32s, int32_t, length) + #define f_macro_int32s_t_adjust(status, int32s, length) f_macro_memory_structure_adjust(status, int32s, int32_t, length) + + #define f_macro_int32s_t_delete_simple(int32s) f_macro_memory_structure_delete_simple(int32s, int32_t) + #define f_macro_int32s_t_destroy_simple(int32s) f_macro_memory_structure_destroy_simple(int32s, int32_t) + + #define f_macro_int32s_t_increase(status, int32s) f_macro_memory_structure_increase(status, int32s, int32_t) + #define f_macro_int32s_t_increase_by(status, int32s, amount) f_macro_memory_structure_increase_by(status, int32s, int32_t, amount) + #define f_macro_int32s_t_decrease_by(status, int32s, amount) f_macro_memory_structure_decrease_by(status, int32s, int32_t, amount) + #define f_macro_int32s_t_decimate_by(status, int32s, amount) f_macro_memory_structure_decimate_by(status, int32s, int32_t, amount) +#endif // _di_int32s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int32ss_t_ + #define f_macro_int32ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_int32ss_t_resize(status, int32ss, length) status = f_type_int32ss_resize(length, &int32ss); + #define f_macro_int32ss_t_adjust(status, int32ss, length) status = f_type_int32ss_adjust(length, &int32ss); + + #define f_macro_int32ss_t_delete_simple(int32ss) f_type_int32ss_resize(0, &int32ss); + #define f_macro_int32ss_t_destroy_simple(int32ss) f_type_int32ss_adjust(0, &int32ss); + + #define f_macro_int32ss_t_increase(status, int32ss) status = f_type_int32ss_increase(&int32ss); + #define f_macro_int32ss_t_increase_by(status, int32ss, amount) status = f_type_int32ss_increase(amount, &int32ss); + #define f_macro_int32ss_t_decrease_by(status, int32ss, amount) status = f_type_int32ss_decrease_by(amount, &int32ss); + #define f_macro_int32ss_t_decimate_by(status, int32ss, amount) status = f_type_int32ss_decimate_by(amount, &int32ss); +#endif // _di_int32ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint32s_t_ + #define f_macro_uint32s_t_clear(uint32s) f_macro_memory_structure_clear(uint32s) + + #define f_macro_uint32s_t_resize(status, uint32s, length) f_macro_memory_structure_resize(status, uint32s, uint32_t, length) + #define f_macro_uint32s_t_adjust(status, uint32s, length) f_macro_memory_structure_adjust(status, uint32s, uint32_t, length) + + #define f_macro_uint32s_t_delete_simple(uint32s) f_macro_memory_structure_delete_simple(uint32s, uint32_t) + #define f_macro_uint32s_t_destroy_simple(uint32s) f_macro_memory_structure_destroy_simple(uint32s, uint32_t) + + #define f_macro_uint32s_t_increase(status, uint32s) f_macro_memory_structure_increase(status, uint32s, uint32_t) + #define f_macro_uint32s_t_increase_by(status, uint32s, amount) f_macro_memory_structure_increase_by(status, uint32s, uint32_t, amount) + #define f_macro_uint32s_t_decrease_by(status, uint32s, amount) f_macro_memory_structure_decrease_by(status, uint32s, uint32_t, amount) + #define f_macro_uint32s_t_decimate_by(status, uint32s, amount) f_macro_memory_structure_decimate_by(status, uint32s, uint32_t, amount) +#endif // _di_uint32s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint32ss_t_ + #define f_macro_uint32ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_uint32ss_t_resize(status, uint32ss, length) status = f_type_uint32ss_resize(length, &uint32ss); + #define f_macro_uint32ss_t_adjust(status, uint32ss, length) status = f_type_uint32ss_adjust(length, &uint32ss); + + #define f_macro_uint32ss_t_delete_simple(uint32ss) f_type_uint32ss_resize(0, &uint32ss); + #define f_macro_uint32ss_t_destroy_simple(uint32ss) f_type_uint32ss_adjust(0, &uint32ss); + + #define f_macro_uint32ss_t_increase(status, uint32ss) status = f_type_uint32ss_increase(&uint32ss); + #define f_macro_uint32ss_t_increase_by(status, uint32ss, amount) status = f_type_uint32ss_increase(amount, &uint32ss); + #define f_macro_uint32ss_t_decrease_by(status, uint32ss, amount) status = f_type_uint32ss_decrease_by(amount, &uint32ss); + #define f_macro_uint32ss_t_decimate_by(status, uint32ss, amount) status = f_type_uint32ss_decimate_by(amount, &uint32ss); +#endif // _di_uint32ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int64s_t_ + #define f_macro_int64s_t_clear(int64s) f_macro_memory_structure_clear(int64s) + + #define f_macro_int64s_t_adjust(status, int64s, length) f_macro_memory_structure_adjust(status, int64s, int64_t, length) + #define f_macro_int64s_t_resize(status, int64s, length) f_macro_memory_structure_resize(status, int64s, int64_t, length) + + #define f_macro_int64s_t_delete_simple(int64s) f_macro_memory_structure_delete_simple(int64s, int64_t) + #define f_macro_int64s_t_destroy_simple(int64s) f_macro_memory_structure_destroy_simple(int64s, int64_t) + + #define f_macro_int64s_t_increase(status, int64s) f_macro_memory_structure_increase(status, int64s, int64_t) + #define f_macro_int64s_t_increase_by(status, int64s, amount) f_macro_memory_structure_increase_by(status, int64s, int64_t, amount) + #define f_macro_int64s_t_decrease_by(status, int64s, amount) f_macro_memory_structure_decrease_by(status, int64s, int64_t, amount) + #define f_macro_int64s_t_decimate_by(status, int64s, amount) f_macro_memory_structure_decimate_by(status, int64s, int64_t, amount) +#endif // _di_int64s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int64ss_t_ + #define f_macro_int64ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_int64ss_t_resize(status, int64ss, length) status = f_type_int64ss_resize(length, &int64ss); + #define f_macro_int64ss_t_adjust(status, int64ss, length) status = f_type_int64ss_adjust(length, &int64ss); + + #define f_macro_int64ss_t_increase(status, int64ss) status = f_type_int64ss_increase(&int64ss); + #define f_macro_int64ss_t_increase_by(status, int64ss, amount) status = f_type_int64ss_increase(amount, &int64ss); + #define f_macro_int64ss_t_decrease_by(status, int64ss, amount) status = f_type_int64ss_decrease_by(amount, &int64ss); + #define f_macro_int64ss_t_decimate_by(status, int64ss, amount) status = f_type_int64ss_decimate_by(amount, &int64ss); + + #define f_macro_int64ss_t_delete_simple(int64ss) f_type_int64ss_resize(0, &int64ss); + #define f_macro_int64ss_t_destroy_simple(int64ss) f_type_int64ss_adjust(0, &int64ss); +#endif // _di_int64ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint64s_t_ + #define f_macro_uint64s_t_clear(uint64s) f_macro_memory_structure_clear(uint64s) + + #define f_macro_uint64s_t_adjust(status, uint64s, length) f_macro_memory_structure_adjust(status, uint64s, uint64_t, length) + #define f_macro_uint64s_t_resize(status, uint64s, length) f_macro_memory_structure_resize(status, uint64s, uint64_t, length) + + #define f_macro_uint64s_t_delete_simple(uint64s) f_macro_memory_structure_delete_simple(uint64s, uint64_t) + #define f_macro_uint64s_t_destroy_simple(uint64s) f_macro_memory_structure_destroy_simple(uint64s, uint64_t) + + #define f_macro_uint64s_t_increase(status, uint64s) f_macro_memory_structure_increase(status, uint64s, uint64_t) + #define f_macro_uint64s_t_increase_by(status, uint64s, amount) f_macro_memory_structure_increase_by(status, uint64s, uint64_t, amount) + #define f_macro_uint64s_t_decrease_by(status, uint64s, amount) f_macro_memory_structure_decrease_by(status, uint64s, uint64_t, amount) + #define f_macro_uint64s_t_decimate_by(status, uint64s, amount) f_macro_memory_structure_decimate_by(status, uint64s, uint64_t, amount) +#endif // _di_uint64s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint64ss_t_ + #define f_macro_uint64ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_uint64ss_t_resize(status, uint64ss, length) status = f_type_uint64ss_resize(length, &uint64ss); + #define f_macro_uint64ss_t_adjust(status, uint64ss, length) status = f_type_uint64ss_adjust(length, &uint64ss); + + #define f_macro_uint64ss_t_increase(status, uint64ss) status = f_type_uint64ss_increase(&uint64ss); + #define f_macro_uint64ss_t_increase_by(status, uint64ss, amount) status = f_type_uint64ss_increase(amount, &uint64ss); + #define f_macro_uint64ss_t_decrease_by(status, uint64ss, amount) status = f_type_uint64ss_decrease_by(amount, &uint64ss); + #define f_macro_uint64ss_t_decimate_by(status, uint64ss, amount) status = f_type_uint64ss_decimate_by(amount, &uint64ss); + + #define f_macro_uint64ss_t_delete_simple(uint64ss) f_type_uint64ss_resize(0, &uint64ss); + #define f_macro_uint64ss_t_destroy_simple(uint64ss) f_type_uint64ss_adjust(0, &uint64ss); +#endif // _di_uint64ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int128s_t_ + #define f_macro_int128s_t_clear(int128s) f_macro_memory_structure_clear(int128s) + + #define f_macro_int128s_t_adjust(status, int128s, length) f_macro_memory_structure_adjust(status, int128s, f_int128_t, length) + #define f_macro_int128s_t_resize(status, int128s, length) f_macro_memory_structure_resize(status, int128s, f_int128_t, length) + + #define f_macro_int128s_t_delete_simple(int128s) f_macro_memory_structure_delete_simple(int128s, f_int128_t) + #define f_macro_int128s_t_destroy_simple(int128s) f_macro_memory_structure_destroy_simple(int128s, f_int128_t) + + #define f_macro_int128s_t_increase(status, int128s) f_macro_memory_structure_increase(status, int128s, f_int128_t) + #define f_macro_int128s_t_increase_by(status, int128s, amount) f_macro_memory_structure_increase_by(status, int128s, f_int128_t, amount) + #define f_macro_int128s_t_decrease_by(status, int128s, amount) f_macro_memory_structure_decrease_by(status, int128s, f_int128_t, amount) + #define f_macro_int128s_t_decimate_by(status, int128s, amount) f_macro_memory_structure_decimate_by(status, int128s, f_int128_t, amount) +#endif // _di_int128s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_int128ss_t_ + #define f_macro_int128ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_int128ss_t_resize(status, int128ss, length) status = f_type_int128ss_resize(length, &int128ss); + #define f_macro_int128ss_t_adjust(status, int128ss, length) status = f_type_int128ss_adjust(length, &int128ss); + + #define f_macro_int128ss_t_delete_simple(int128ss) f_type_int128ss_resize(0, &int128ss); + #define f_macro_int128ss_t_destroy_simple(int128ss) f_type_int128ss_adjust(0, &int128ss); + + #define f_macro_int128ss_t_increase(status, int128ss) status = f_type_int128ss_increase(&int128ss); + #define f_macro_int128ss_t_increase_by(status, int128ss, amount) status = f_type_int128ss_increase(amount, &int128ss); + #define f_macro_int128ss_t_decrease_by(status, int128ss, amount) status = f_type_int128ss_decrease_by(amount, &int128ss); + #define f_macro_int128ss_t_decimate_by(status, int128ss, amount) status = f_type_int128ss_decimate_by(amount, &int128ss); +#endif // _di_int128ss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint128s_t_ + #define f_macro_uint128s_t_clear(uint128s) f_macro_memory_structure_clear(uint128s) + + #define f_macro_uint128s_t_adjust(status, uint128s, length) f_macro_memory_structure_adjust(status, uint128s, f_uint128_t, length) + #define f_macro_uint128s_t_resize(status, uint128s, length) f_macro_memory_structure_resize(status, uint128s, f_uint128_t, length) + + #define f_macro_uint128s_t_delete_simple(uint128s) f_macro_memory_structure_delete_simple(uint128s, f_uint128_t) + #define f_macro_uint128s_t_destroy_simple(uint128s) f_macro_memory_structure_destroy_simple(uint128s, f_uint128_t) + + #define f_macro_uint128s_t_increase(status, uint128s) f_macro_memory_structure_increase(status, uint128s, f_uint128_t) + #define f_macro_uint128s_t_increase_by(status, uint128s, amount) f_macro_memory_structure_increase_by(status, uint128s, f_uint128_t, amount) + #define f_macro_uint128s_t_decrease_by(status, uint128s, amount) f_macro_memory_structure_decrease_by(status, uint128s, f_uint128_t, amount) + #define f_macro_uint128s_t_decimate_by(status, uint128s, amount) f_macro_memory_structure_decimate_by(status, uint128s, f_uint128_t, amount) +#endif // _di_uint128s_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_uint128ss_t_ + #define f_macro_uint128ss_t_clear(numbers) f_macro_memory_structures_clear(numbers) + + #define f_macro_uint128ss_t_resize(status, uint128ss, length) status = f_type_uint128ss_resize(length, &uint128ss); + #define f_macro_uint128ss_t_adjust(status, uint128ss, length) status = f_type_uint128ss_adjust(length, &uint128ss); + + #define f_macro_uint128ss_t_delete_simple(uint128ss) f_type_uint128ss_resize(0, &uint128ss); + #define f_macro_uint128ss_t_destroy_simple(uint128ss) f_type_uint128ss_adjust(0, &uint128ss); + + #define f_macro_uint128ss_t_increase(status, uint128ss) status = f_type_uint128ss_increase(&uint128ss); + #define f_macro_uint128ss_t_increase_by(status, uint128ss, amount) status = f_type_uint128ss_increase(amount, &uint128ss); + #define f_macro_uint128ss_t_decrease_by(status, uint128ss, amount) status = f_type_uint128ss_decrease_by(amount, &uint128ss); + #define f_macro_uint128ss_t_decimate_by(status, uint128ss, amount) status = f_type_uint128ss_decimate_by(amount, &uint128ss); +#endif // _di_uint128ss_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _F_type_array_common_h diff --git a/level_0/f_type_array/c/type_array.c b/level_0/f_type_array/c/type_array.c new file mode 100644 index 0000000..e8eeb54 --- /dev/null +++ b/level_0/f_type_array/c/type_array.c @@ -0,0 +1,1116 @@ +#include "type_array.h" +#include "private-type_array.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_f_type_cellss_adjust_ + f_status_t f_type_cellss_adjust(const f_array_length_t length, f_cellss_t *cellss) { + #ifndef _di_level_0_parameter_checking_ + if (!cellss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_cellss_adjust(length, cellss); + } +#endif // _di_f_type_cellss_adjust_ + +#ifndef _di_f_type_cellss_decimate_by_ + f_status_t f_type_cellss_decimate_by(const f_array_length_t amount, f_cellss_t *cellss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!cellss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (cellss->size - amount > 0) { + return private_f_type_cellss_adjust(cellss->size - amount, cellss); + } + + return private_f_type_cellss_adjust(0, cellss); + } +#endif // _di_f_type_cellss_decimate_by_ + +#ifndef _di_f_type_cellss_decrease_by_ + f_status_t f_type_cellss_decrease_by(const f_array_length_t amount, f_cellss_t *cellss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!cellss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (cellss->size - amount > 0) { + return private_f_type_cellss_resize(cellss->size - amount, cellss); + } + + return private_f_type_cellss_resize(0, cellss); + } +#endif // _di_f_type_cellss_decrease_by_ + +#ifndef _di_f_type_cellss_increase_ + f_status_t f_type_cellss_increase(f_cellss_t *cellss) { + #ifndef _di_level_0_parameter_checking_ + if (!cellss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (cellss->used + 1 > cellss->size) { + f_array_length_t size = cellss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (cellss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_cellss_resize(size, cellss); + } + + return F_data_not; + } +#endif // _di_f_type_cellss_increase_ + +#ifndef _di_f_type_cellss_increase_by_ + f_status_t f_type_cellss_increase_by(const f_array_length_t amount, f_cellss_t *cellss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!cellss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (cellss->used + amount > cellss->size) { + if (cellss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_cellss_resize(cellss->used + amount, cellss); + } + + return F_data_not; + } +#endif // _di_f_type_cellss_increase_by_ + +#ifndef _di_f_type_cellss_resize_ + f_status_t f_type_cellss_resize(const f_array_length_t length, f_cellss_t *cellss) { + #ifndef _di_level_0_parameter_checking_ + if (!cellss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_cellss_resize(length, cellss); + } +#endif // _di_f_type_cellss_resize_ + +#ifndef _di_f_type_array_lengthssss_adjust_ + f_status_t f_type_array_lengthssss_adjust(const f_array_length_t length, f_array_lengthss_t *array_lengthss) { + #ifndef _di_level_0_parameter_checking_ + if (!array_lengthss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_array_lengthss_adjust(length, array_lengthss); + } +#endif // _di_f_type_array_lengthss_adjust_ + +#ifndef _di_f_type_array_lengthss_decimate_by_ + f_status_t f_type_array_lengthss_decimate_by(const f_array_length_t amount, f_array_lengthss_t *array_lengthss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!array_lengthss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (array_lengthss->size - amount > 0) { + return private_f_type_array_lengthss_adjust(array_lengthss->size - amount, array_lengthss); + } + + return private_f_type_array_lengthss_adjust(0, array_lengthss); + } +#endif // _di_f_type_array_lengthss_decimate_by_ + +#ifndef _di_f_type_array_lengthss_decrease_by_ + f_status_t f_type_array_lengthss_decrease_by(const f_array_length_t amount, f_array_lengthss_t *array_lengthss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!array_lengthss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (array_lengthss->size - amount > 0) { + return private_f_type_array_lengthss_resize(array_lengthss->size - amount, array_lengthss); + } + + return private_f_type_array_lengthss_resize(0, array_lengthss); + } +#endif // _di_f_type_array_lengthss_decrease_by_ + +#ifndef _di_f_type_array_lengthss_increase_ + f_status_t f_type_array_lengthss_increase(f_array_lengthss_t *array_lengthss) { + #ifndef _di_level_0_parameter_checking_ + if (!array_lengthss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (array_lengthss->used + 1 > array_lengthss->size) { + f_array_length_t size = array_lengthss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (array_lengthss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_array_lengthss_resize(size, array_lengthss); + } + + return F_data_not; + } +#endif // _di_f_type_array_lengthss_increase_ + +#ifndef _di_f_type_array_lengthss_increase_by_ + f_status_t f_type_array_lengthss_increase_by(const f_array_length_t amount, f_array_lengthss_t *array_lengthss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!array_lengthss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (array_lengthss->used + amount > array_lengthss->size) { + if (array_lengthss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_array_lengthss_resize(array_lengthss->used + amount, array_lengthss); + } + + return F_data_not; + } +#endif // _di_f_type_array_lengthss_increase_by_ + +#ifndef _di_f_type_array_lengthss_resize_ + f_status_t f_type_array_lengthss_resize(const f_array_length_t length, f_array_lengthss_t *array_lengthss) { + #ifndef _di_level_0_parameter_checking_ + if (!array_lengthss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_array_lengthss_resize(length, array_lengthss); + } +#endif // _di_f_type_array_lengthss_resize_ + +#ifndef _di_f_type_int8ss_adjust_ + f_status_t f_type_int8ss_adjust(const f_array_length_t length, f_int8ss_t *int8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int8ss_adjust(length, int8ss); + } +#endif // _di_f_type_int8ss_adjust_ + +#ifndef _di_f_type_int8ss_decimate_by_ + f_status_t f_type_int8ss_decimate_by(const f_array_length_t amount, f_int8ss_t *int8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int8ss->size - amount > 0) { + return private_f_type_int8ss_adjust(int8ss->size - amount, int8ss); + } + + return private_f_type_int8ss_adjust(0, int8ss); + } +#endif // _di_f_type_int8ss_decimate_by_ + +#ifndef _di_f_type_int8ss_decrease_by_ + f_status_t f_type_int8ss_decrease_by(const f_array_length_t amount, f_int8ss_t *int8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int8ss->size - amount > 0) { + return private_f_type_int8ss_resize(int8ss->size - amount, int8ss); + } + + return private_f_type_int8ss_resize(0, int8ss); + } +#endif // _di_f_type_int8ss_decrease_by_ + +#ifndef _di_f_type_int8ss_increase_ + f_status_t f_type_int8ss_increase(f_int8ss_t *int8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int8ss->used + 1 > int8ss->size) { + f_array_length_t size = int8ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (int8ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_int8ss_resize(size, int8ss); + } + + return F_data_not; + } +#endif // _di_f_type_int8ss_increase_ + +#ifndef _di_f_type_int8ss_increase_by_ + f_status_t f_type_int8ss_increase_by(const f_array_length_t amount, f_int8ss_t *int8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int8ss->used + amount > int8ss->size) { + if (int8ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_int8ss_resize(int8ss->used + amount, int8ss); + } + + return F_data_not; + } +#endif // _di_f_type_int8ss_increase_by_ + +#ifndef _di_f_type_int8ss_resize_ + f_status_t f_type_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int8ss_resize(length, int8ss); + } +#endif // _di_f_type_int8ss_resize_ + +#ifndef _di_f_type_uint8ss_adjust_ + f_status_t f_type_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint8ss_adjust(length, uint8ss); + } +#endif // _di_f_type_uint8ss_adjust_ + +#ifndef _di_f_type_uint8ss_decimate_by_ + f_status_t f_type_uint8ss_decimate_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint8ss->size - amount > 0) { + return private_f_type_uint8ss_adjust(uint8ss->size - amount, uint8ss); + } + + return private_f_type_uint8ss_adjust(0, uint8ss); + } +#endif // _di_f_type_uint8ss_decimate_by_ + +#ifndef _di_f_type_uint8ss_decrease_by_ + f_status_t f_type_uint8ss_decrease_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint8ss->size - amount > 0) { + return private_f_type_uint8ss_resize(uint8ss->size - amount, uint8ss); + } + + return private_f_type_uint8ss_resize(0, uint8ss); + } +#endif // _di_f_type_uint8ss_decrease_by_ + +#ifndef _di_f_type_uint8ss_increase_ + f_status_t f_type_uint8ss_increase(f_uint8ss_t *uint8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint8ss->used + 1 > uint8ss->size) { + f_array_length_t size = uint8ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (uint8ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_uint8ss_resize(size, uint8ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint8ss_increase_ + +#ifndef _di_f_type_uint8ss_increase_by_ + f_status_t f_type_uint8ss_increase_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint8ss->used + amount > uint8ss->size) { + if (uint8ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_uint8ss_resize(uint8ss->used + amount, uint8ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint8ss_increase_by_ + +#ifndef _di_f_type_uint8ss_resize_ + f_status_t f_type_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint8ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint8ss_resize(length, uint8ss); + } +#endif // _di_f_type_uint8ss_resize_ + +#ifndef _di_f_type_int16ss_adjust_ + f_status_t f_type_int16ss_adjust(const f_array_length_t length, f_int16ss_t *int16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int16ss_adjust(length, int16ss); + } +#endif // _di_f_type_int16ss_adjust_ + +#ifndef _di_f_type_int16ss_decimate_by_ + f_status_t f_type_int16ss_decimate_by(const f_array_length_t amount, f_int16ss_t *int16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int16ss->size - amount > 0) { + return private_f_type_int16ss_adjust(int16ss->size - amount, int16ss); + } + + return private_f_type_int16ss_adjust(0, int16ss); + } +#endif // _di_f_type_int16ss_decimate_by_ + +#ifndef _di_f_type_int16ss_decrease_by_ + f_status_t f_type_int16ss_decrease_by(const f_array_length_t amount, f_int16ss_t *int16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int16ss->size - amount > 0) { + return private_f_type_int16ss_resize(int16ss->size - amount, int16ss); + } + + return private_f_type_int16ss_resize(0, int16ss); + } +#endif // _di_f_type_int16ss_decrease_by_ + +#ifndef _di_f_type_int16ss_increase_ + f_status_t f_type_int16ss_increase(f_int16ss_t *int16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int16ss->used + 1 > int16ss->size) { + f_array_length_t size = int16ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (int16ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_int16ss_resize(size, int16ss); + } + + return F_data_not; + } +#endif // _di_f_type_int16ss_increase_ + +#ifndef _di_f_type_int16ss_increase_by_ + f_status_t f_type_int16ss_increase_by(const f_array_length_t amount, f_int16ss_t *int16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int16ss->used + amount > int16ss->size) { + if (int16ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_int16ss_resize(int16ss->used + amount, int16ss); + } + + return F_data_not; + } +#endif // _di_f_type_int16ss_increase_by_ + +#ifndef _di_f_type_int16ss_resize_ + f_status_t f_type_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int16ss_resize(length, int16ss); + } +#endif // _di_f_type_int16ss_resize_ + +#ifndef _di_f_type_uint16ss_decimate_by_ + f_status_t f_type_uint16ss_decimate_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint16ss->size - amount > 0) { + return private_f_type_uint16ss_adjust(uint16ss->size - amount, uint16ss); + } + + return private_f_type_uint16ss_adjust(0, uint16ss); + } +#endif // _di_f_type_uint16ss_decimate_by_ + +#ifndef _di_f_type_uint16ss_decrease_by_ + f_status_t f_type_uint16ss_decrease_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint16ss->size - amount > 0) { + return private_f_type_uint16ss_resize(uint16ss->size - amount, uint16ss); + } + + return private_f_type_uint16ss_resize(0, uint16ss); + } +#endif // _di_f_type_uint16ss_decrease_by_ + +#ifndef _di_f_type_uint16ss_increase_ + f_status_t f_type_uint16ss_increase(f_uint16ss_t *uint16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint16ss->used + 1 > uint16ss->size) { + f_array_length_t size = uint16ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (uint16ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_uint16ss_resize(size, uint16ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint16ss_increase_ + +#ifndef _di_f_type_uint16ss_increase_by_ + f_status_t f_type_uint16ss_increase_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint16ss->used + amount > uint16ss->size) { + if (uint16ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_uint16ss_resize(uint16ss->used + amount, uint16ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint16ss_increase_by_ + +#ifndef _di_f_type_uint16ss_resize_ + f_status_t f_type_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint16ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint16ss_resize(length, uint16ss); + } +#endif // _di_f_type_uint16ss_resize_ + +#ifndef _di_f_type_int32ss_adjust_ + f_status_t f_type_int32ss_adjust(const f_array_length_t length, f_int32ss_t *int32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int32ss_adjust(length, int32ss); + } +#endif // _di_f_type_int32ss_adjust_ + +#ifndef _di_f_type_int32ss_decimate_by_ + f_status_t f_type_int32ss_decimate_by(const f_array_length_t amount, f_int32ss_t *int32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int32ss->size - amount > 0) { + return private_f_type_int32ss_adjust(int32ss->size - amount, int32ss); + } + + return private_f_type_int32ss_adjust(0, int32ss); + } +#endif // _di_f_type_int32ss_decimate_by_ + +#ifndef _di_f_type_int32ss_decrease_by_ + f_status_t f_type_int32ss_decrease_by(const f_array_length_t amount, f_int32ss_t *int32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int32ss->size - amount > 0) { + return private_f_type_int32ss_resize(int32ss->size - amount, int32ss); + } + + return private_f_type_int32ss_resize(0, int32ss); + } +#endif // _di_f_type_int32ss_decrease_by_ + +#ifndef _di_f_type_int32ss_increase_ + f_status_t f_type_int32ss_increase(f_int32ss_t *int32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int32ss->used + 1 > int32ss->size) { + f_array_length_t size = int32ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (int32ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_int32ss_resize(size, int32ss); + } + + return F_data_not; + } +#endif // _di_f_type_int32ss_increase_ + +#ifndef _di_f_type_int32ss_increase_by_ + f_status_t f_type_int32ss_increase_by(const f_array_length_t amount, f_int32ss_t *int32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int32ss->used + amount > int32ss->size) { + if (int32ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_int32ss_resize(int32ss->used + amount, int32ss); + } + + return F_data_not; + } +#endif // _di_f_type_int32ss_increase_by_ + +#ifndef _di_f_type_int32ss_resize_ + f_status_t f_type_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int32ss_resize(length, int32ss); + } +#endif // _di_f_type_int32ss_resize_ + +#ifndef _di_f_type_uint32ss_adjust_ + f_status_t f_type_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint32ss_adjust(length, uint32ss); + } +#endif // _di_f_type_uint32ss_adjust_ + +#ifndef _di_f_type_uint32ss_decimate_by_ + f_status_t f_type_uint32ss_decimate_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint32ss->size - amount > 0) { + return private_f_type_uint32ss_adjust(uint32ss->size - amount, uint32ss); + } + + return private_f_type_uint32ss_adjust(0, uint32ss); + } +#endif // _di_f_type_uint32ss_decimate_by_ + +#ifndef _di_f_type_uint32ss_decrease_by_ + f_status_t f_type_uint32ss_decrease_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint32ss->size - amount > 0) { + return private_f_type_uint32ss_resize(uint32ss->size - amount, uint32ss); + } + + return private_f_type_uint32ss_resize(0, uint32ss); + } +#endif // _di_f_type_uint32ss_decrease_by_ + +#ifndef _di_f_type_uint32ss_increase_ + f_status_t f_type_uint32ss_increase(f_uint32ss_t *uint32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint32ss->used + 1 > uint32ss->size) { + f_array_length_t size = uint32ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (uint32ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_uint32ss_resize(size, uint32ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint32ss_increase_ + +#ifndef _di_f_type_uint32ss_increase_by_ + f_status_t f_type_uint32ss_increase_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint32ss->used + amount > uint32ss->size) { + if (uint32ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_uint32ss_resize(uint32ss->used + amount, uint32ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint32ss_increase_by_ + +#ifndef _di_f_type_uint32ss_resize_ + f_status_t f_type_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint32ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint32ss_resize(length, uint32ss); + } +#endif // _di_f_type_uint32ss_resize_ + +#ifndef _di_f_type_int64ss_adjust_ + f_status_t f_type_int64ss_adjust(const f_array_length_t length, f_int64ss_t *int64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int64ss_adjust(length, int64ss); + } +#endif // _di_f_type_int64ss_adjust_ + +#ifndef _di_f_type_int64ss_decimate_by_ + f_status_t f_type_int64ss_decimate_by(const f_array_length_t amount, f_int64ss_t *int64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int64ss->size - amount > 0) { + return private_f_type_int64ss_adjust(int64ss->size - amount, int64ss); + } + + return private_f_type_int64ss_adjust(0, int64ss); + } +#endif // _di_f_type_int64ss_decimate_by_ + +#ifndef _di_f_type_int64ss_decrease_by_ + f_status_t f_type_int64ss_decrease_by(const f_array_length_t amount, f_int64ss_t *int64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int64ss->size - amount > 0) { + return private_f_type_int64ss_resize(int64ss->size - amount, int64ss); + } + + return private_f_type_int64ss_resize(0, int64ss); + } +#endif // _di_f_type_int64ss_decrease_by_ + +#ifndef _di_f_type_int64ss_increase_ + f_status_t f_type_int64ss_increase(f_int64ss_t *int64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int64ss->used + 1 > int64ss->size) { + f_array_length_t size = int64ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (int64ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_int64ss_resize(size, int64ss); + } + + return F_data_not; + } +#endif // _di_f_type_int64ss_increase_ + +#ifndef _di_f_type_int64ss_increase_by_ + f_status_t f_type_int64ss_increase_by(const f_array_length_t amount, f_int64ss_t *int64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int64ss->used + amount > int64ss->size) { + if (int64ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_int64ss_resize(int64ss->used + amount, int64ss); + } + + return F_data_not; + } +#endif // _di_f_type_int64ss_increase_by_ + +#ifndef _di_f_type_int64ss_resize_ + f_status_t f_type_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int64ss_resize(length, int64ss); + } +#endif // _di_f_type_int64ss_resize_ + +#ifndef _di_f_type_uint64ss_adjust_ + f_status_t f_type_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint64ss_adjust(length, uint64ss); + } +#endif // _di_f_type_uint64ss_adjust_ + +#ifndef _di_f_type_uint64ss_decimate_by_ + f_status_t f_type_uint64ss_decimate_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint64ss->size - amount > 0) { + return private_f_type_uint64ss_adjust(uint64ss->size - amount, uint64ss); + } + + return private_f_type_uint64ss_adjust(0, uint64ss); + } +#endif // _di_f_type_uint64ss_decimate_by_ + +#ifndef _di_f_type_uint64ss_decrease_by_ + f_status_t f_type_uint64ss_decrease_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint64ss->size - amount > 0) { + return private_f_type_uint64ss_resize(uint64ss->size - amount, uint64ss); + } + + return private_f_type_uint64ss_resize(0, uint64ss); + } +#endif // _di_f_type_uint64ss_decrease_by_ + +#ifndef _di_f_type_uint64ss_increase_ + f_status_t f_type_uint64ss_increase(f_uint64ss_t *uint64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint64ss->used + 1 > uint64ss->size) { + f_array_length_t size = uint64ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (uint64ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_uint64ss_resize(size, uint64ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint64ss_increase_ + +#ifndef _di_f_type_uint64ss_increase_by_ + f_status_t f_type_uint64ss_increase_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint64ss->used + amount > uint64ss->size) { + if (uint64ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_uint64ss_resize(uint64ss->used + amount, uint64ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint64ss_increase_by_ + +#ifndef _di_f_type_uint64ss_resize_ + f_status_t f_type_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint64ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint64ss_resize(length, uint64ss); + } +#endif // _di_f_type_uint64ss_resize_ + +#ifndef _di_f_type_int128ss_adjust_ + f_status_t f_type_int128ss_adjust(const f_array_length_t length, f_int128ss_t *int128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int128ss_adjust(length, int128ss); + } +#endif // _di_f_type_int128ss_adjust_ + +#ifndef _di_f_type_int128ss_decimate_by_ + f_status_t f_type_int128ss_decimate_by(const f_array_length_t amount, f_int128ss_t *int128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int128ss->size - amount > 0) { + return private_f_type_int128ss_adjust(int128ss->size - amount, int128ss); + } + + return private_f_type_int128ss_adjust(0, int128ss); + } +#endif // _di_f_type_int128ss_decimate_by_ + +#ifndef _di_f_type_int128ss_decrease_by_ + f_status_t f_type_int128ss_decrease_by(const f_array_length_t amount, f_int128ss_t *int128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int128ss->size - amount > 0) { + return private_f_type_int128ss_resize(int128ss->size - amount, int128ss); + } + + return private_f_type_int128ss_resize(0, int128ss); + } +#endif // _di_f_type_int128ss_decrease_by_ + +#ifndef _di_f_type_int128ss_increase_ + f_status_t f_type_int128ss_increase(f_int128ss_t *int128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int128ss->used + 1 > int128ss->size) { + f_array_length_t size = int128ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (int128ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_int128ss_resize(size, int128ss); + } + + return F_data_not; + } +#endif // _di_f_type_int128ss_increase_ + +#ifndef _di_f_type_int128ss_increase_by_ + f_status_t f_type_int128ss_increase_by(const f_array_length_t amount, f_int128ss_t *int128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!int128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (int128ss->used + amount > int128ss->size) { + if (int128ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_int128ss_resize(int128ss->used + amount, int128ss); + } + + return F_data_not; + } +#endif // _di_f_type_int128ss_increase_by_ + +#ifndef _di_f_type_int128ss_resize_ + f_status_t f_type_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!int128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_int128ss_resize(length, int128ss); + } +#endif // _di_f_type_int128ss_resize_ + +#ifndef _di_f_type_uint128ss_adjust_ + f_status_t f_type_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint128ss_adjust(length, uint128ss); + } +#endif // _di_f_type_uint128ss_adjust_ + +#ifndef _di_f_type_uint128ss_decimate_by_ + f_status_t f_type_uint128ss_decimate_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint128ss->size - amount > 0) { + return private_f_type_uint128ss_adjust(uint128ss->size - amount, uint128ss); + } + + return private_f_type_uint128ss_adjust(0, uint128ss); + } +#endif // _di_f_type_uint128ss_decimate_by_ + +#ifndef _di_f_type_uint128ss_decrease_by_ + f_status_t f_type_uint128ss_decrease_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint128ss->size - amount > 0) { + return private_f_type_uint128ss_resize(uint128ss->size - amount, uint128ss); + } + + return private_f_type_uint128ss_resize(0, uint128ss); + } +#endif // _di_f_type_uint128ss_decrease_by_ + +#ifndef _di_f_type_uint128ss_increase_ + f_status_t f_type_uint128ss_increase(f_uint128ss_t *uint128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint128ss->used + 1 > uint128ss->size) { + f_array_length_t size = uint128ss->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (uint128ss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_uint128ss_resize(size, uint128ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint128ss_increase_ + +#ifndef _di_f_type_uint128ss_increase_by_ + f_status_t f_type_uint128ss_increase_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!uint128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (uint128ss->used + amount > uint128ss->size) { + if (uint128ss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_uint128ss_resize(uint128ss->used + amount, uint128ss); + } + + return F_data_not; + } +#endif // _di_f_type_uint128ss_increase_by_ + +#ifndef _di_f_type_uint128ss_resize_ + f_status_t f_type_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) { + #ifndef _di_level_0_parameter_checking_ + if (!uint128ss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_uint128ss_resize(length, uint128ss); + } +#endif // _di_f_type_uint128ss_resize_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_type_array/c/type_array.h b/level_0/f_type_array/c/type_array.h new file mode 100644 index 0000000..9b6b15d --- /dev/null +++ b/level_0/f_type_array/c/type_array.h @@ -0,0 +1,1533 @@ +/** + * FLL - Level 0 + * + * Project: Type + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * Provides an extension to the Type project (f_type) that depends on f_memory (linking to the f_memory library). + * + * As an exceptional case, this is an extension to f_type to avoid circular dependency issues with f_memory. + * The functions and macros in this project therefore are prefixed with 'f_type_' instead of 'f_type_array_'. + */ +#ifndef _F_type_array_h +#define _F_type_array_h + +// fll-0 includes +#include +#include + +// fll-0 type_array includes +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Resize the string cellss array. + * + * @param length + * The new size to use. + * @param cellss + * The string cellss array to resize. + * + * @return + * F_none 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_type_cellss_adjust_ + extern f_status_t f_type_cellss_adjust(const f_array_length_t length, f_cellss_t *cellss); +#endif // _di_f_type_cellss_adjust_ + +/** + * Resize the string cellss 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 cellss + * The string cellss array to resize. + * + * @return + * F_none 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_type_cellss_decimate_by_ + extern f_status_t f_type_cellss_decimate_by(const f_array_length_t amount, f_cellss_t *cellss); +#endif // _di_f_type_cellss_decimate_by_ + +/** + * Resize the string cellss 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 decrease the size by. + * @param cellss + * The string cellss array to resize. + * + * @return + * F_none 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_type_cellss_decrease_by_ + extern f_status_t f_type_cellss_decrease_by(const f_array_length_t amount, f_cellss_t *cellss); +#endif // _di_f_type_cellss_decrease_by_ + +/** + * Increase the size of the string cellss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param cellss + * The string cellss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_cellss_increase_ + extern f_status_t f_type_cellss_increase(f_cellss_t *cellss); +#endif // _di_f_type_cellss_increase_ + +/** + * Resize the string cellss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 cellss + * The string cellss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_cellss_increase_by_ + extern f_status_t f_type_cellss_increase_by(const f_array_length_t amount, f_cellss_t *cellss); +#endif // _di_f_type_cellss_increase_by_ + +/** + * Resize the string cellss array. + * + * @param length + * The new size to use. + * @param cellss + * The string cellss array to adjust. + * + * @return + * F_none 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_type_cellss_resize_ + extern f_status_t f_type_cellss_resize(const f_array_length_t length, f_cellss_t *cellss); +#endif // _di_f_type_cellss_resize_ + +/** + * Resize the string array_lengthss array. + * + * @param length + * The new size to use. + * @param array_lengthss + * The string array_lengthss array to resize. + * + * @return + * F_none 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_type_array_lengthss_adjust_ + extern f_status_t f_type_array_lengthss_adjust(const f_array_length_t length, f_array_lengthss_t *array_lengthss); +#endif // _di_f_type_array_lengthss_adjust_ + +/** + * Resize the string array_lengthss 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 array_lengthss + * The string array_lengthss array to resize. + * + * @return + * F_none 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_type_array_lengthss_decimate_by_ + extern f_status_t f_type_array_lengthss_decimate_by(const f_array_length_t amount, f_array_lengthss_t *array_lengthss); +#endif // _di_f_type_array_lengthss_decimate_by_ + +/** + * Resize the string array_lengthss 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 decrease the size by. + * @param array_lengthss + * The string array_lengthss array to resize. + * + * @return + * F_none 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_type_array_lengthss_decrease_by_ + extern f_status_t f_type_array_lengthss_decrease_by(const f_array_length_t amount, f_array_lengthss_t *array_lengthss); +#endif // _di_f_type_array_lengthss_decrease_by_ + +/** + * Increase the size of the string array_lengthss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param array_lengthss + * The string array_lengthss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_array_lengthss_increase_ + extern f_status_t f_type_array_lengthss_increase(f_array_lengthss_t *array_lengthss); +#endif // _di_f_type_array_lengthss_increase_ + +/** + * Resize the string array_lengthss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 array_lengthss + * The string array_lengthss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_array_lengthss_increase_by_ + extern f_status_t f_type_array_lengthss_increase_by(const f_array_length_t amount, f_array_lengthss_t *array_lengthss); +#endif // _di_f_type_array_lengthss_increase_by_ + +/** + * Resize the string array_lengthss array. + * + * @param length + * The new size to use. + * @param array_lengthss + * The string array_lengthss array to adjust. + * + * @return + * F_none 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_type_array_lengthss_resize_ + extern f_status_t f_type_array_lengthss_resize(const f_array_length_t length, f_array_lengthss_t *array_lengthss); +#endif // _di_f_type_array_lengthss_resize_ + +/** + * Resize the string int8ss array. + * + * @param length + * The new size to use. + * @param int8ss + * The string int8ss array to resize. + * + * @return + * F_none 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_type_int8ss_adjust_ + extern f_status_t f_type_int8ss_adjust(const f_array_length_t length, f_int8ss_t *int8ss); +#endif // _di_f_type_int8ss_adjust_ + +/** + * Resize the string int8ss 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 int8ss + * The string int8ss array to resize. + * + * @return + * F_none 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_type_int8ss_decimate_by_ + extern f_status_t f_type_int8ss_decimate_by(const f_array_length_t amount, f_int8ss_t *int8ss); +#endif // _di_f_type_int8ss_decimate_by_ + +/** + * Resize the string int8ss 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 decrease the size by. + * @param int8ss + * The string int8ss array to resize. + * + * @return + * F_none 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_type_int8ss_decrease_by_ + extern f_status_t f_type_int8ss_decrease_by(const f_array_length_t amount, f_int8ss_t *int8ss); +#endif // _di_f_type_int8ss_decrease_by_ + +/** + * Increase the size of the string int8ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param int8ss + * The string int8ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_int8ss_increase_ + extern f_status_t f_type_int8ss_increase(f_int8ss_t *int8ss); +#endif // _di_f_type_int8ss_increase_ + +/** + * Resize the string int8ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 int8ss + * The string int8ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_int8ss_increase_by_ + extern f_status_t f_type_int8ss_increase_by(const f_array_length_t amount, f_int8ss_t *int8ss); +#endif // _di_f_type_int8ss_increase_by_ + +/** + * Resize the string int8ss array. + * + * @param length + * The new size to use. + * @param int8ss + * The string int8ss array to adjust. + * + * @return + * F_none 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_type_int8ss_resize_ + extern f_status_t f_type_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss); +#endif // _di_f_type_int8ss_resize_ + +/** + * Resize the string uint8ss array. + * + * @param length + * The new size to use. + * @param uint8ss + * The string uint8ss array to resize. + * + * @return + * F_none 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_type_uint8ss_adjust_ + extern f_status_t f_type_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss); +#endif // _di_f_type_uint8ss_adjust_ + +/** + * Resize the string uint8ss 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 uint8ss + * The string uint8ss array to resize. + * + * @return + * F_none 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_type_uint8ss_decimate_by_ + extern f_status_t f_type_uint8ss_decimate_by(const f_array_length_t amount, f_uint8ss_t *uint8ss); +#endif // _di_f_type_uint8ss_decimate_by_ + +/** + * Resize the string uint8ss 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 decrease the size by. + * @param uint8ss + * The string uint8ss array to resize. + * + * @return + * F_none 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_type_uint8ss_decrease_by_ + extern f_status_t f_type_uint8ss_decrease_by(const f_array_length_t amount, f_uint8ss_t *uint8ss); +#endif // _di_f_type_uint8ss_decrease_by_ + +/** + * Increase the size of the string uint8ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param uint8ss + * The string uint8ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_uint8ss_increase_ + extern f_status_t f_type_uint8ss_increase(f_uint8ss_t *uint8ss); +#endif // _di_f_type_uint8ss_increase_ + +/** + * Resize the string uint8ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 uint8ss + * The string uint8ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_uint8ss_increase_by_ + extern f_status_t f_type_uint8ss_increase_by(const f_array_length_t amount, f_uint8ss_t *uint8ss); +#endif // _di_f_type_uint8ss_increase_by_ + +/** + * Resize the string uint8ss array. + * + * @param length + * The new size to use. + * @param uint8ss + * The string uint8ss array to adjust. + * + * @return + * F_none 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_type_uint8ss_resize_ + extern f_status_t f_type_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss); +#endif // _di_f_type_uint8ss_resize_ + +/** + * Resize the string int16ss array. + * + * @param length + * The new size to use. + * @param int16ss + * The string int16ss array to resize. + * + * @return + * F_none 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_type_int16ss_adjust_ + extern f_status_t f_type_int16ss_adjust(const f_array_length_t length, f_int16ss_t *int16ss); +#endif // _di_f_type_int16ss_adjust_ + +/** + * Resize the string int16ss 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 int16ss + * The string int16ss array to resize. + * + * @return + * F_none 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_type_int16ss_decimate_by_ + extern f_status_t f_type_int16ss_decimate_by(const f_array_length_t amount, f_int16ss_t *int16ss); +#endif // _di_f_type_int16ss_decimate_by_ + +/** + * Resize the string int16ss 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 decrease the size by. + * @param int16ss + * The string int16ss array to resize. + * + * @return + * F_none 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_type_int16ss_decrease_by_ + extern f_status_t f_type_int16ss_decrease_by(const f_array_length_t amount, f_int16ss_t *int16ss); +#endif // _di_f_type_int16ss_decrease_by_ + +/** + * Increase the size of the string int16ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param int16ss + * The string int16ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_int16ss_increase_ + extern f_status_t f_type_int16ss_increase(f_int16ss_t *int16ss); +#endif // _di_f_type_int16ss_increase_ + +/** + * Resize the string int16ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 int16ss + * The string int16ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_int16ss_increase_by_ + extern f_status_t f_type_int16ss_increase_by(const f_array_length_t amount, f_int16ss_t *int16ss); +#endif // _di_f_type_int16ss_increase_by_ + +/** + * Resize the string int16ss array. + * + * @param length + * The new size to use. + * @param int16ss + * The string int16ss array to adjust. + * + * @return + * F_none 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_type_int16ss_resize_ + extern f_status_t f_type_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss); +#endif // _di_f_type_int16ss_resize_ + +/** + * Resize the string uint16ss array. + * + * @param length + * The new size to use. + * @param uint16ss + * The string uint16ss array to resize. + * + * @return + * F_none 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_type_uint16ss_adjust_ + extern f_status_t f_type_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss); +#endif // _di_f_type_uint16ss_adjust_ + +/** + * Resize the string uint16ss 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 uint16ss + * The string uint16ss array to resize. + * + * @return + * F_none 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_type_uint16ss_decimate_by_ + extern f_status_t f_type_uint16ss_decimate_by(const f_array_length_t amount, f_uint16ss_t *uint16ss); +#endif // _di_f_type_uint16ss_decimate_by_ + +/** + * Resize the string uint16ss 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 decrease the size by. + * @param uint16ss + * The string uint16ss array to resize. + * + * @return + * F_none 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_type_uint16ss_decrease_by_ + extern f_status_t f_type_uint16ss_decrease_by(const f_array_length_t amount, f_uint16ss_t *uint16ss); +#endif // _di_f_type_uint16ss_decrease_by_ + +/** + * Increase the size of the string uint16ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param uint16ss + * The string uint16ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_uint16ss_increase_ + extern f_status_t f_type_uint16ss_increase(f_uint16ss_t *uint16ss); +#endif // _di_f_type_uint16ss_increase_ + +/** + * Resize the string uint16ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 uint16ss + * The string uint16ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_uint16ss_increase_by_ + extern f_status_t f_type_uint16ss_increase_by(const f_array_length_t amount, f_uint16ss_t *uint16ss); +#endif // _di_f_type_uint16ss_increase_by_ + +/** + * Resize the string uint16ss array. + * + * @param length + * The new size to use. + * @param uint16ss + * The string uint16ss array to adjust. + * + * @return + * F_none 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_type_uint16ss_resize_ + extern f_status_t f_type_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss); +#endif // _di_f_type_uint16ss_resize_ + + +/** + * Resize the string int32ss array. + * + * @param length + * The new size to use. + * @param int32ss + * The string int32ss array to resize. + * + * @return + * F_none 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_type_int32ss_adjust_ + extern f_status_t f_type_int32ss_adjust(const f_array_length_t length, f_int32ss_t *int32ss); +#endif // _di_f_type_int32ss_adjust_ + +/** + * Resize the string int32ss 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 int32ss + * The string int32ss array to resize. + * + * @return + * F_none 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_type_int32ss_decimate_by_ + extern f_status_t f_type_int32ss_decimate_by(const f_array_length_t amount, f_int32ss_t *int32ss); +#endif // _di_f_type_int32ss_decimate_by_ + +/** + * Resize the string int32ss 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 decrease the size by. + * @param int32ss + * The string int32ss array to resize. + * + * @return + * F_none 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_type_int32ss_decrease_by_ + extern f_status_t f_type_int32ss_decrease_by(const f_array_length_t amount, f_int32ss_t *int32ss); +#endif // _di_f_type_int32ss_decrease_by_ + +/** + * Increase the size of the string int32ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param int32ss + * The string int32ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_int32ss_increase_ + extern f_status_t f_type_int32ss_increase(f_int32ss_t *int32ss); +#endif // _di_f_type_int32ss_increase_ + +/** + * Resize the string int32ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 int32ss + * The string int32ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_int32ss_increase_by_ + extern f_status_t f_type_int32ss_increase_by(const f_array_length_t amount, f_int32ss_t *int32ss); +#endif // _di_f_type_int32ss_increase_by_ + +/** + * Resize the string int32ss array. + * + * @param length + * The new size to use. + * @param int32ss + * The string int32ss array to adjust. + * + * @return + * F_none 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_type_int32ss_resize_ + extern f_status_t f_type_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss); +#endif // _di_f_type_int32ss_resize_ + + +/** + * Resize the string uint32ss array. + * + * @param length + * The new size to use. + * @param uint32ss + * The string uint32ss array to resize. + * + * @return + * F_none 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_type_uint32ss_adjust_ + extern f_status_t f_type_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss); +#endif // _di_f_type_uint32ss_adjust_ + +/** + * Resize the string uint32ss 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 uint32ss + * The string uint32ss array to resize. + * + * @return + * F_none 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_type_uint32ss_decimate_by_ + extern f_status_t f_type_uint32ss_decimate_by(const f_array_length_t amount, f_uint32ss_t *uint32ss); +#endif // _di_f_type_uint32ss_decimate_by_ + +/** + * Resize the string uint32ss 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 decrease the size by. + * @param uint32ss + * The string uint32ss array to resize. + * + * @return + * F_none 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_type_uint32ss_decrease_by_ + extern f_status_t f_type_uint32ss_decrease_by(const f_array_length_t amount, f_uint32ss_t *uint32ss); +#endif // _di_f_type_uint32ss_decrease_by_ + +/** + * Increase the size of the string uint32ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param uint32ss + * The string uint32ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_uint32ss_increase_ + extern f_status_t f_type_uint32ss_increase(f_uint32ss_t *uint32ss); +#endif // _di_f_type_uint32ss_increase_ + +/** + * Resize the string uint32ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 uint32ss + * The string uint32ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_uint32ss_increase_by_ + extern f_status_t f_type_uint32ss_increase_by(const f_array_length_t amount, f_uint32ss_t *uint32ss); +#endif // _di_f_type_uint32ss_increase_by_ + +/** + * Resize the string uint32ss array. + * + * @param length + * The new size to use. + * @param uint32ss + * The string uint32ss array to adjust. + * + * @return + * F_none 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_type_uint32ss_resize_ + extern f_status_t f_type_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss); +#endif // _di_f_type_uint32ss_resize_ + +/** + * Resize the string int64ss array. + * + * @param length + * The new size to use. + * @param int64ss + * The string int64ss array to resize. + * + * @return + * F_none 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_type_int64ss_adjust_ + extern f_status_t f_type_int64ss_adjust(const f_array_length_t length, f_int64ss_t *int64ss); +#endif // _di_f_type_int64ss_adjust_ + +/** + * Resize the string int64ss 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 int64ss + * The string int64ss array to resize. + * + * @return + * F_none 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_type_int64ss_decimate_by_ + extern f_status_t f_type_int64ss_decimate_by(const f_array_length_t amount, f_int64ss_t *int64ss); +#endif // _di_f_type_int64ss_decimate_by_ + +/** + * Resize the string int64ss 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 decrease the size by. + * @param int64ss + * The string int64ss array to resize. + * + * @return + * F_none 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_type_int64ss_decrease_by_ + extern f_status_t f_type_int64ss_decrease_by(const f_array_length_t amount, f_int64ss_t *int64ss); +#endif // _di_f_type_int64ss_decrease_by_ + +/** + * Increase the size of the string int64ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param int64ss + * The string int64ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_int64ss_increase_ + extern f_status_t f_type_int64ss_increase(f_int64ss_t *int64ss); +#endif // _di_f_type_int64ss_increase_ + +/** + * Resize the string int64ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 int64ss + * The string int64ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_int64ss_increase_by_ + extern f_status_t f_type_int64ss_increase_by(const f_array_length_t amount, f_int64ss_t *int64ss); +#endif // _di_f_type_int64ss_increase_by_ + +/** + * Resize the string int64ss array. + * + * @param length + * The new size to use. + * @param int64ss + * The string int64ss array to adjust. + * + * @return + * F_none 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_type_int64ss_resize_ + extern f_status_t f_type_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss); +#endif // _di_f_type_int64ss_resize_ + +/** + * Resize the string uint64ss array. + * + * @param length + * The new size to use. + * @param uint64ss + * The string uint64ss array to resize. + * + * @return + * F_none 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_type_uint64ss_adjust_ + extern f_status_t f_type_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss); +#endif // _di_f_type_uint64ss_adjust_ + +/** + * Resize the string uint64ss 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 uint64ss + * The string uint64ss array to resize. + * + * @return + * F_none 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_type_uint64ss_decimate_by_ + extern f_status_t f_type_uint64ss_decimate_by(const f_array_length_t amount, f_uint64ss_t *uint64ss); +#endif // _di_f_type_uint64ss_decimate_by_ + +/** + * Resize the string uint64ss 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 decrease the size by. + * @param uint64ss + * The string uint64ss array to resize. + * + * @return + * F_none 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_type_uint64ss_decrease_by_ + extern f_status_t f_type_uint64ss_decrease_by(const f_array_length_t amount, f_uint64ss_t *uint64ss); +#endif // _di_f_type_uint64ss_decrease_by_ + +/** + * Increase the size of the string uint64ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param uint64ss + * The string uint64ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_uint64ss_increase_ + extern f_status_t f_type_uint64ss_increase(f_uint64ss_t *uint64ss); +#endif // _di_f_type_uint64ss_increase_ + +/** + * Resize the string uint64ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 uint64ss + * The string uint64ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_uint64ss_increase_by_ + extern f_status_t f_type_uint64ss_increase_by(const f_array_length_t amount, f_uint64ss_t *uint64ss); +#endif // _di_f_type_uint64ss_increase_by_ + +/** + * Resize the string uint64ss array. + * + * @param length + * The new size to use. + * @param uint64ss + * The string uint64ss array to adjust. + * + * @return + * F_none 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_type_uint64ss_resize_ + extern f_status_t f_type_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss); +#endif // _di_f_type_uint64ss_resize_ + +/** + * Resize the string int128ss array. + * + * @param length + * The new size to use. + * @param int128ss + * The string int128ss array to resize. + * + * @return + * F_none 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_type_int128ss_adjust_ + extern f_status_t f_type_int128ss_adjust(const f_array_length_t length, f_int128ss_t *int128ss); +#endif // _di_f_type_int128ss_adjust_ + +/** + * Resize the string int128ss 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 int128ss + * The string int128ss array to resize. + * + * @return + * F_none 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_type_int128ss_decimate_by_ + extern f_status_t f_type_int128ss_decimate_by(const f_array_length_t amount, f_int128ss_t *int128ss); +#endif // _di_f_type_int128ss_decimate_by_ + +/** + * Resize the string int128ss 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 decrease the size by. + * @param int128ss + * The string int128ss array to resize. + * + * @return + * F_none 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_type_int128ss_decrease_by_ + extern f_status_t f_type_int128ss_decrease_by(const f_array_length_t amount, f_int128ss_t *int128ss); +#endif // _di_f_type_int128ss_decrease_by_ + +/** + * Increase the size of the string int128ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param int128ss + * The string int128ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_int128ss_increase_ + extern f_status_t f_type_int128ss_increase(f_int128ss_t *int128ss); +#endif // _di_f_type_int128ss_increase_ + +/** + * Resize the string int128ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 int128ss + * The string int128ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_int128ss_increase_by_ + extern f_status_t f_type_int128ss_increase_by(const f_array_length_t amount, f_int128ss_t *int128ss); +#endif // _di_f_type_int128ss_increase_by_ + +/** + * Resize the string int128ss array. + * + * @param length + * The new size to use. + * @param int128ss + * The string int128ss array to adjust. + * + * @return + * F_none 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_type_int128ss_resize_ + extern f_status_t f_type_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss); +#endif // _di_f_type_int128ss_resize_ + +/** + * Resize the string uint128ss array. + * + * @param length + * The new size to use. + * @param uint128ss + * The string uint128ss array to resize. + * + * @return + * F_none 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_type_uint128ss_adjust_ + extern f_status_t f_type_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss); +#endif // _di_f_type_uint128ss_adjust_ + +/** + * Resize the string uint128ss 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 uint128ss + * The string uint128ss array to resize. + * + * @return + * F_none 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_type_uint128ss_decimate_by_ + extern f_status_t f_type_uint128ss_decimate_by(const f_array_length_t amount, f_uint128ss_t *uint128ss); +#endif // _di_f_type_uint128ss_decimate_by_ + +/** + * Resize the string uint128ss 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 decrease the size by. + * @param uint128ss + * The string uint128ss array to resize. + * + * @return + * F_none 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_type_uint128ss_decrease_by_ + extern f_status_t f_type_uint128ss_decrease_by(const f_array_length_t amount, f_uint128ss_t *uint128ss); +#endif // _di_f_type_uint128ss_decrease_by_ + +/** + * Increase the size of the string uint128ss array, but only if necessary. + * + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param uint128ss + * The string uint128ss array to resize. + * + * @return + * F_none 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_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_type_uint128ss_increase_ + extern f_status_t f_type_uint128ss_increase(f_uint128ss_t *uint128ss); +#endif // _di_f_type_uint128ss_increase_ + +/** + * Resize the string uint128ss array to a larger size. + * + * This will resize making the string larger based on the given length. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size). + * 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 uint128ss + * The string uint128ss array to resize. + * + * @return + * F_none on success. + * F_data_not on success, but there is no reason to increase size (used + amount <= size). + * + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_type_uint128ss_increase_by_ + extern f_status_t f_type_uint128ss_increase_by(const f_array_length_t amount, f_uint128ss_t *uint128ss); +#endif // _di_f_type_uint128ss_increase_by_ + +/** + * Resize the string uint128ss array. + * + * @param length + * The new size to use. + * @param uint128ss + * The string uint128ss array to adjust. + * + * @return + * F_none 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_type_uint128ss_resize_ + extern f_status_t f_type_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss); +#endif // _di_f_type_uint128ss_resize_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _F_type_array_h diff --git a/level_1/fl_type/data/build/defines b/level_0/f_type_array/data/build/defines similarity index 100% rename from level_1/fl_type/data/build/defines rename to level_0/f_type_array/data/build/defines diff --git a/level_1/fl_type/data/build/dependencies b/level_0/f_type_array/data/build/dependencies similarity index 100% rename from level_1/fl_type/data/build/dependencies rename to level_0/f_type_array/data/build/dependencies diff --git a/level_1/fl_type/data/build/settings b/level_0/f_type_array/data/build/settings similarity index 82% rename from level_1/fl_type/data/build/settings rename to level_0/f_type_array/data/build/settings index dd0c87d..ed87396 100644 --- a/level_1/fl_type/data/build/settings +++ b/level_0/f_type_array/data/build/settings @@ -1,6 +1,6 @@ # fss-0001 -project_name fl_type +project_name f_type_array version_major 0 version_minor 5 @@ -20,16 +20,16 @@ build_indexer ar build_language c build_libraries -lc build_libraries-individual -lf_memory -build_sources_library type.c private-type.c +build_sources_library type_array.c private-type_array.c build_sources_program -build_sources_headers type.h +build_sources_headers type_array.h private-type_array.h type_array-common.h build_sources_script build_sources_setting build_script yes build_shared yes build_static no -path_headers level_1 +path_headers level_0 path_headers_preserve no path_library_script script path_library_shared shared diff --git a/level_0/f_utf/c/utf-common.h b/level_0/f_utf/c/utf-common.h index 5880973..b013df2 100644 --- a/level_0/f_utf/c/utf-common.h +++ b/level_0/f_utf/c/utf-common.h @@ -298,7 +298,6 @@ extern "C" { #define f_macro_utf_string_quantitys_t_decimate_by(status, quantitys, amount) f_macro_memory_structure_decimate_by(status, quantitys, f_utf_string_quantity_t, amount); #endif // _di_f_utf_string_quantitys_t_ - /** * A string that is analogous to f_utf_string_dynamic_t but intended for static-only uses. * @@ -425,7 +424,7 @@ extern "C" { if (new_length < dynamics.size) { \ for (f_utf_string_length_t _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; ++_macro__i) { \ f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[_macro__i]); \ - if (status != F_none) break; \ + if (F_status_is_error(status)) break; \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size, new_length); \ @@ -439,7 +438,7 @@ extern "C" { if (new_length < dynamics.size) { \ for (f_utf_string_length_t _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; ++_macro__i) { \ f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[_macro__i], f_utf_string_dynamic_t); \ - if (status != F_none) break; \ + if (F_status_is_error(status)) break; \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size, new_length); \ @@ -453,7 +452,7 @@ extern "C" { while (dynamics.size > 0) { \ --dynamics.size; \ f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[dynamics.size]); \ - if (status != F_none) break; \ + if (F_status_is_error(status)) break; \ } \ if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size); \ if (status == F_none) dynamics.used = 0; @@ -463,7 +462,7 @@ extern "C" { while (dynamics.size > 0) { \ --dynamics.size; \ f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[dynamics.size]); \ - if (status != F_none) break; \ + if (F_status_is_error(status)) break; \ } \ if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size); \ if (status == F_none) dynamics.used = 0; diff --git a/level_0/f_utf/c/utf.c b/level_0/f_utf/c/utf.c index b925b7d..0e1f9f6 100644 --- a/level_0/f_utf/c/utf.c +++ b/level_0/f_utf/c/utf.c @@ -629,8 +629,8 @@ extern "C" { uint8_t width = f_macro_utf_character_t_width_is(utf_character); if (!width_max) { - f_macro_string_t_new(status, *character, width); - + f_macro_string_t_clear((*character)) + f_macro_string_t_resize(status, (*character), 0, width) if (F_status_is_error(status)) return status; width = 1; @@ -731,7 +731,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_alpha(character_utf, width); @@ -765,7 +765,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_alpha_digit(character_utf, width); @@ -799,7 +799,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_alpha_numeric(character_utf, width); @@ -825,7 +825,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_ascii(character_utf, width); @@ -856,7 +856,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_combining(character_utf, width); @@ -890,7 +890,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_control(character_utf, width); @@ -921,7 +921,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_control_picture(character_utf, width); @@ -955,7 +955,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_digit(character_utf, width); @@ -989,7 +989,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_emoji(character_utf, width); @@ -1039,7 +1039,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } if (private_f_utf_character_is_control(character_utf, width)) { @@ -1086,7 +1086,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_numeric(character_utf, width); @@ -1117,7 +1117,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_phonetic(character_utf, width); @@ -1148,7 +1148,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_private(character_utf, width); @@ -1209,7 +1209,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_punctuation(character_utf, width); @@ -1255,7 +1255,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_symbol(character_utf, width); @@ -1281,7 +1281,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_unassigned(character_utf, width); @@ -1307,7 +1307,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_valid(character_utf, width); @@ -1341,7 +1341,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return f_utf_character_is_whitespace(character_utf); @@ -1373,7 +1373,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_whitespace_modifier(character_utf, width); @@ -1405,7 +1405,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_whitespace_other(character_utf, width); @@ -1439,7 +1439,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_word(character_utf, width, strict); @@ -1473,7 +1473,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_word_dash(character_utf, width, strict); @@ -1507,7 +1507,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_word_dash_plus(character_utf, width, strict); @@ -1549,7 +1549,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != F_none) return status; + if (F_status_is_error(status)) return status; } return private_f_utf_character_is_zero_width(character_utf, width); diff --git a/level_1/fl_console/c/console.c b/level_1/fl_console/c/console.c index eeffb35..47addbc 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -35,7 +35,8 @@ extern "C" { if (length > 0) { length += 2; - f_macro_string_dynamic_t_new(status, (*directory), length); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), length) if (F_status_is_error(status)) return status; memcpy(directory->string + 1, argument + begin, length - 2); @@ -46,7 +47,8 @@ extern "C" { directory->string[length - 1] = f_path_separator_s[0]; } else { - f_macro_string_dynamic_t_new(status, (*directory), 1); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), 1) if (F_status_is_error(status)) return status; directory->used = 1; @@ -66,7 +68,8 @@ extern "C" { if (length > 0) { length += 4; - f_macro_string_dynamic_t_new(status, (*directory), length); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), length); if (F_status_is_error(status)) return status; memcpy(directory->string + 3, argument + begin, length - 4); @@ -79,7 +82,8 @@ extern "C" { directory->string[length - 1] = f_path_separator_s[0]; } else { - f_macro_string_dynamic_t_new(status, (*directory), 3); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), 3) if (F_status_is_error(status)) return status; directory->used = 3; @@ -101,7 +105,8 @@ extern "C" { if (length > 0) { length += 3; - f_macro_string_dynamic_t_new(status, (*directory), length); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), length) if (F_status_is_error(status)) return status; memcpy(directory->string + 2, argument + begin, length - 3); @@ -113,7 +118,8 @@ extern "C" { directory->string[length - 1] = f_path_separator_s[0]; } else { - f_macro_string_dynamic_t_new(status, (*directory), 2); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), 2) if (F_status_is_error(status)) return status; directory->used = 2; @@ -125,7 +131,8 @@ extern "C" { else { length++; - f_macro_string_dynamic_t_new(status, (*directory), length); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), length) if (F_status_is_error(status)) return status; memcpy(directory->string, argument, length - 1); @@ -136,7 +143,8 @@ extern "C" { } } else if (argument[0] != f_path_separator_s[0]) { - f_macro_string_dynamic_t_new(status, (*directory), 2); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), 2) if (F_status_is_error(status)) return status; memcpy(directory->string, argument, 2); @@ -146,7 +154,8 @@ extern "C" { directory->string[1] = f_path_separator_s[0]; } else { - f_macro_string_dynamic_t_new(status, (*directory), 1); + f_macro_string_dynamic_t_clear((*directory)) + f_macro_string_dynamic_t_resize(status, (*directory), 1) if (F_status_is_error(status)) return status; memcpy(directory->string, argument, 1); diff --git a/level_1/fl_console/data/build/settings b/level_1/fl_console/data/build/settings index ef63b77..0ae0039 100644 --- a/level_1/fl_console/data/build/settings +++ b/level_1/fl_console/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lf_console -lf_conversion -lf_memory -lf_path -lf_string -lf_utf +build_libraries-individual -lf_console -lf_conversion -lf_memory -lf_path -lf_string -lf_type_array -lf_utf build_sources_library console.c build_sources_program build_sources_headers console.h diff --git a/level_1/fl_control_group/c/control_group.c b/level_1/fl_control_group/c/control_group.c index 48a5845..955e389 100644 --- a/level_1/fl_control_group/c/control_group.c +++ b/level_1/fl_control_group/c/control_group.c @@ -60,16 +60,6 @@ extern "C" { } #endif // _di_fl_control_group_apply_ -#ifndef _di_fl_control_group_delete_ - f_status_t fl_control_group_delete(f_control_group_t *control_group) { - f_status_t status = F_none; - - f_macro_control_group_t_delete(status, (*control_group)); - - return status; - } -#endif // _di_fl_control_group_delete_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_1/fl_control_group/c/control_group.h b/level_1/fl_control_group/c/control_group.h index 4da5578..c02ce20 100644 --- a/level_1/fl_control_group/c/control_group.h +++ b/level_1/fl_control_group/c/control_group.h @@ -66,20 +66,6 @@ extern "C" { extern f_status_t fl_control_group_apply(const f_control_group_t control_group, const pid_t id); #endif // _di_fl_control_group_apply_ -/** - * Delete the control group structure. - * - * @param control_group - * The control group to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_control_group_delete_ - extern f_status_t fl_control_group_delete(f_control_group_t *control_group); -#endif // _di_fl_control_group_delete_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index d62961b..d78427c 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -484,7 +484,7 @@ extern "C" { // There is no reason to include "." and ".." in the directory listing. if (!strncmp(entity[i]->d_name, "..", 3) || !strncmp(entity[i]->d_name, ".", 2)) { - f_memory_delete((void **) & entity[i], sizeof(char *), 1); + f_memory_resize((void **) & entity[i], sizeof(char *), 1, 0); continue; } @@ -525,7 +525,8 @@ extern "C" { if (F_status_is_error(status)) break; } - f_macro_string_dynamic_t_new(status, names->array[names->used], size); + f_macro_string_dynamic_t_clear(names->array[names->used]) + f_macro_string_dynamic_t_resize(status, names->array[names->used], size); if (F_status_is_error(status)) break; if (names->array[names->used].used > 0 && names->array[names->used].string[names->array[names->used].used - 1] != 0) { @@ -550,16 +551,16 @@ extern "C" { names->array[names->used].used = size; names->used++; - f_memory_delete((void **) & entity[i], sizeof(char *), 1); + f_memory_resize((void **) & entity[i], sizeof(char *), 1, 0); } // for closedir(parent); for (; i < length; i++) { - f_memory_delete((void **) & entity[i], sizeof(char *), 1); + f_memory_resize((void **) & entity[i], sizeof(char *), 1, 0); } // for - f_memory_delete((void **) & entity, sizeof(struct dirent *), 1); + f_memory_resize((void **) & entity, sizeof(struct dirent *), 1, 0); if (F_status_is_error(status)) return status; if (!length) return F_data_not; diff --git a/level_1/fl_environment/c/environment.c b/level_1/fl_environment/c/environment.c index 64c9057..9df21a1 100644 --- a/level_1/fl_environment/c/environment.c +++ b/level_1/fl_environment/c/environment.c @@ -131,13 +131,14 @@ extern "C" { if (total > 0) { if (path[i - 1] == f_path_separator_s[0]) { - f_macro_string_dynamic_t_new(status, part, total); + f_macro_string_dynamic_t_clear(part) + f_macro_string_dynamic_t_resize(status, part, total) if (F_status_is_error(status)) return status; part.used = total; } else { - f_macro_string_dynamic_t_new(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, (total + 1)) if (F_status_is_error(status)) return status; part.string[total] = f_path_separator_s[0]; @@ -149,8 +150,7 @@ extern "C" { paths->array[paths->used].string = part.string; paths->array[paths->used].used = part.used; - paths->array[paths->used].size = part.size; - paths->used++; + paths->array[paths->used++].size = part.size; first = i + 1; } @@ -207,7 +207,8 @@ extern "C" { total = i - first; if (total > 0) { - f_macro_string_dynamic_t_new(status, part, total); + f_macro_string_dynamic_t_clear(part) + f_macro_string_dynamic_t_resize(status, part, total) if (F_status_is_error(status)) return status; for (j = 0; j < total; j++) { @@ -218,7 +219,7 @@ extern "C" { } // for if (part.string[part.used - 1] != f_path_separator_s[0]) { - f_macro_string_dynamic_t_resize(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, (total + 1)) if (F_status_is_error(status)) return status; part.string[part.used] = f_path_separator_s[0]; @@ -228,8 +229,7 @@ extern "C" { paths->array[paths->used].string = part.string; paths->array[paths->used].used = part.used; - paths->array[paths->used].size = part.size; - paths->used++; + paths->array[paths->used++].size = part.size; first = i + 1; } @@ -258,8 +258,7 @@ extern "C" { paths->array[paths->used].string = 0; paths->array[paths->used].used = 0; - paths->array[paths->used].size = 0; - paths->used++; + paths->array[paths->used++].size = 0; return F_none; } @@ -283,13 +282,14 @@ extern "C" { if (total > 0) { if (path[j + total] == f_path_separator_s[0]) { - f_macro_string_dynamic_t_new(status, part, total); + f_macro_string_dynamic_t_clear(part) + f_macro_string_dynamic_t_resize(status, part, total) if (F_status_is_error(status)) return status; part.used = total; } else { - f_macro_string_dynamic_t_new(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, (total + 1)) if (F_status_is_error(status)) return status; part.string[total] = f_path_separator_s[0]; @@ -308,13 +308,14 @@ extern "C" { if (total > 0) { if (path[last - 1] == f_path_separator_s[0]) { - f_macro_string_dynamic_t_new(status, part, total); + f_macro_string_dynamic_t_clear(part) + f_macro_string_dynamic_t_resize(status, part, total) if (F_status_is_error(status)) return status; part.used = total; } else { - f_macro_string_dynamic_t_new(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, (total + 1)) if (F_status_is_error(status)) return status; part.used = total + 1; @@ -327,8 +328,7 @@ extern "C" { paths->array[paths->used].string = part.string; paths->array[paths->used].used = part.used; - paths->array[paths->used].size = part.size; - paths->used++; + paths->array[paths->used++].size = part.size; } } // for @@ -377,7 +377,8 @@ extern "C" { total = last - i; if (total > 0) { - f_macro_string_dynamic_t_new(status, part, total); + f_macro_string_dynamic_t_clear(part) + f_macro_string_dynamic_t_resize(status, part, total) if (F_status_is_error(status)) return status; for (k = 0; k < total; k++) { @@ -388,7 +389,7 @@ extern "C" { } // for if (part.string[part.used - 1] != f_path_separator_s[0]) { - f_macro_string_dynamic_t_resize(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, (total + 1)) if (F_status_is_error(status)) return status; part.string[part.used] = f_path_separator_s[0]; @@ -402,7 +403,8 @@ extern "C" { // when j = 0, the total is actually the entire length to max. total = last - j; - f_macro_string_dynamic_t_new(status, part, total); + f_macro_string_dynamic_t_clear(part) + f_macro_string_dynamic_t_resize(status, part, total) if (F_status_is_error(status)) return status; for (k = 0; k < total; k++) { @@ -413,7 +415,7 @@ extern "C" { } // for if (part.string[part.used - 1] != f_path_separator_s[0]) { - f_macro_string_dynamic_t_resize(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, (total + 1)) if (F_status_is_error(status)) return status; part.string[part.used - 1] = f_path_separator_s[0]; @@ -423,8 +425,7 @@ extern "C" { paths->array[paths->used].string = part.string; paths->array[paths->used].used = part.used; - paths->array[paths->used].size = part.size; - paths->used++; + paths->array[paths->used++].size = part.size; } } // for diff --git a/level_1/fl_execute/c/execute.h b/level_1/fl_execute/c/execute.h index f4a98cb..e3a804c 100644 --- a/level_1/fl_execute/c/execute.h +++ b/level_1/fl_execute/c/execute.h @@ -23,8 +23,9 @@ // fll-0 includes #include -#include #include +#include +#include #include #include #include diff --git a/level_1/fl_execute/data/build/dependencies b/level_1/fl_execute/data/build/dependencies index 2747470..456b6f9 100644 --- a/level_1/fl_execute/data/build/dependencies +++ b/level_1/fl_execute/data/build/dependencies @@ -2,6 +2,8 @@ f_type f_status +f_memory +f_type_array f_string f_capability f_limit diff --git a/level_1/fl_execute/data/build/settings b/level_1/fl_execute/data/build/settings index ebfad6d..e41ea57 100644 --- a/level_1/fl_execute/data/build/settings +++ b/level_1/fl_execute/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -lcap -build_libraries-individual -lf_capability -lf_limit -lf_memory -lf_signal -lf_string +build_libraries-individual -lf_capability -lf_limit -lf_memory -lf_signal -lf_string -lf_type_array build_sources_library build_sources_program build_sources_headers execute.h execute-common.h diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index 553ac48..b2738aa 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -51,7 +51,7 @@ extern "C" { return F_data_not_stop; } - f_macro_string_ranges_t_increase(status, (*found)); + f_macro_fss_content_t_increase(status, (*found)) if (F_status_is_error(status)) return status; found->array[found->used].start = range->start; diff --git a/level_1/fl_fss/c/fss_basic_list.c b/level_1/fl_fss/c/fss_basic_list.c index 0d2b358..c5f3111 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -247,7 +247,7 @@ extern "C" { private_fl_macro_fss_content_with_comments_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, F_none_eos, F_none_stop); - f_macro_string_ranges_t_increase(status, (*found)); + f_macro_fss_content_t_increase(status, (*found)) if (F_status_is_error(status)) return status; found->array[found->used].start = range->start; @@ -420,7 +420,7 @@ extern "C" { status = f_fss_seek_to_eol(buffer, range); if (F_status_is_error(status)) break; - f_macro_string_ranges_t_increase(status, (*comments)); + f_macro_fss_comments_t_increase(status, (*comments)) if (F_status_is_error(status)) break; if (range->start > range->stop || range->start >= buffer.used) { diff --git a/level_1/fl_fss/c/fss_embedded_list.c b/level_1/fl_fss/c/fss_embedded_list.c index f0c96db..4b019e9 100644 --- a/level_1/fl_fss/c/fss_embedded_list.c +++ b/level_1/fl_fss/c/fss_embedded_list.c @@ -271,12 +271,14 @@ extern "C" { f_string_lengths_t positions_start = f_string_lengths_t_initialize; - f_macro_string_lengths_t_new(status, positions_start, f_fss_default_allocation_step); + f_macro_string_lengths_t_clear(positions_start) + f_macro_string_lengths_t_resize(status, positions_start, f_fss_default_allocation_step) if (F_status_is_error(status)) return status; f_fss_objects_t objects = f_fss_objects_t_initialize; - f_macro_fss_objects_t_new(status, objects, f_fss_default_allocation_step); + f_macro_fss_objects_t_clear(objects) + f_macro_fss_objects_t_resize(status, objects, f_fss_default_allocation_step) if (F_status_is_error(status)) { f_macro_string_lengths_t_delete_simple(positions_start); @@ -745,7 +747,7 @@ extern "C" { status = f_fss_seek_to_eol(buffer, range); if (F_status_is_error(status)) break; - f_macro_string_ranges_t_increase(status, (*comments)); + f_macro_fss_comments_t_increase(status, (*comments)) if (F_status_is_error(status)) break; if (range->start > range->stop || range->start >= buffer.used) { diff --git a/level_1/fl_fss/c/fss_extended_list.c b/level_1/fl_fss/c/fss_extended_list.c index 7504737..f4395f4 100644 --- a/level_1/fl_fss/c/fss_extended_list.c +++ b/level_1/fl_fss/c/fss_extended_list.c @@ -265,7 +265,7 @@ extern "C" { private_fl_macro_fss_content_with_comments_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, F_none_eos, F_none_stop); - f_macro_string_ranges_t_increase(status, (*found)); + f_macro_fss_content_t_increase(status, (*found)) if (F_status_is_error(status)) return status; found->array[found->used].start = range->start; @@ -383,7 +383,7 @@ extern "C" { status = f_fss_seek_to_eol(buffer, range); if (F_status_is_error(status)) break; - f_macro_string_ranges_t_increase(status, (*comments)); + f_macro_fss_comments_t_increase(status, (*comments)) if (F_status_is_error(status)) break; if (range->start > range->stop || range->start >= buffer.used) { diff --git a/level_1/fl_fss/data/build/settings b/level_1/fl_fss/data/build/settings index 806a616..a751775 100644 --- a/level_1/fl_fss/data/build/settings +++ b/level_1/fl_fss/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lf_file -lf_fss -lf_memory -lf_string -lf_utf +build_libraries-individual -lf_file -lf_fss -lf_memory -lf_string -lf_type_array -lf_utf build_sources_library private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c build_sources_program build_sources_headers fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h fss_status.h diff --git a/level_1/fl_type/c/private-type.c b/level_1/fl_type/c/private-type.c deleted file mode 100644 index 464e00c..0000000 --- a/level_1/fl_type/c/private-type.c +++ /dev/null @@ -1,202 +0,0 @@ -#include "type.h" -#include "private-type.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(_di_fl_type_cellss_delete_) - void private_fl_type_cellss_delete(f_cellss_t *cellss) { - f_macro_cellss_t_delete_simple((*cellss)); - } -#endif // !defined(_di_fl_type_cellss_delete_) - -#if !defined(_di_fl_type_cellss_increase_) || !defined(_di_fl_type_cellss_increase_by_) - f_status_t private_fl_type_cellss_resize(const f_array_length_t length, f_cellss_t *cellss) { - f_status_t status = F_none; - - f_macro_cellss_t_resize(status, (*cellss), length); - - return status; - } -#endif // !defined(_di_fl_type_cellss_increase_) || !defined(_di_fl_type_cellss_increase_by_) - -#if !defined(_di_fl_type_array_lengthss_delete_) - void private_fl_type_array_lengthss_delete(f_array_lengthss_t *lengthss) { - f_macro_array_lengthss_t_delete_simple((*lengthss)); - } -#endif // !defined(_di_fl_type_array_lengthss_delete_) - -#if !defined(_di_fl_type_array_lengthss_increase_) || !defined(_di_fl_type_array_lengthss_increase_by_) - f_status_t private_fl_type_array_lengthss_resize(const f_array_length_t length, f_array_lengthss_t *array_lengthss) { - f_status_t status = F_none; - - f_macro_array_lengthss_t_resize(status, (*array_lengthss), length); - - return status; - } -#endif // !defined(_di_fl_type_array_lengthss_increase_) || !defined(_di_fl_type_array_lengthss_increase_by_) - -#if !defined(_di_fl_type_int8ss_delete_) - void private_fl_type_int8ss_delete(f_int8ss_t *int8ss) { - f_macro_int8ss_t_delete_simple((*int8ss)); - } -#endif // !defined(_di_fl_type_int8ss_delete_) - -#if !defined(_di_fl_type_int8ss_increase_) || !defined(_di_fl_type_int8ss_increase_by_) - f_status_t private_fl_type_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss) { - f_status_t status = F_none; - - f_macro_int8ss_t_resize(status, (*int8ss), length); - - return status; - } -#endif // !defined(_di_fl_type_int8ss_increase_) || !defined(_di_fl_type_int8ss_increase_by_) - -#if !defined(_di_fl_type_uint8ss_delete_) - void private_fl_type_uint8ss_delete(f_uint8ss_t *uint8ss) { - f_macro_uint8ss_t_delete_simple((*uint8ss)); - } -#endif // !defined(_di_fl_type_uint8ss_delete_) - -#if !defined(_di_fl_type_uint8ss_increase_) || !defined(_di_fl_type_uint8ss_increase_by_) - f_status_t private_fl_type_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) { - f_status_t status = F_none; - - f_macro_uint8ss_t_resize(status, (*uint8ss), length); - - return status; - } -#endif // !defined(_di_fl_type_uint8ss_increase_) || !defined(_di_fl_type_uint8ss_increase_by_) - -#if !defined(_di_fl_type_int16ss_delete_) - void private_fl_type_int16ss_delete(f_int16ss_t *int16ss) { - f_macro_int16ss_t_delete_simple((*int16ss)); - } -#endif // !defined(_di_fl_type_int16ss_delete_) - -#if !defined(_di_fl_type_int16ss_increase_) || !defined(_di_fl_type_int16ss_increase_by_) - f_status_t private_fl_type_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss) { - f_status_t status = F_none; - - f_macro_int16ss_t_resize(status, (*int16ss), length); - - return status; - } -#endif // !defined(_di_fl_type_int16ss_increase_) || !defined(_di_fl_type_int16ss_increase_by_) - -#if !defined(_di_fl_type_uint16ss_delete_) - void private_fl_type_uint16ss_delete(f_uint16ss_t *uint16ss) { - f_macro_uint16ss_t_delete_simple((*uint16ss)); - } -#endif // !defined(_di_fl_type_uint16ss_delete_) - -#if !defined(_di_fl_type_uint16ss_increase_) || !defined(_di_fl_type_uint16ss_increase_by_) - f_status_t private_fl_type_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) { - f_status_t status = F_none; - - f_macro_uint16ss_t_resize(status, (*uint16ss), length); - - return status; - } -#endif // !defined(_di_fl_type_uint16ss_increase_) || !defined(_di_fl_type_uint16ss_increase_by_) - -#if !defined(_di_fl_type_int32ss_delete_) - void private_fl_type_int32ss_delete(f_int32ss_t *int32ss) { - f_macro_int32ss_t_delete_simple((*int32ss)); - } -#endif // !defined(_di_fl_type_int32ss_delete_) - -#if !defined(_di_fl_type_int32ss_increase_) || !defined(_di_fl_type_int32ss_increase_by_) - f_status_t private_fl_type_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss) { - f_status_t status = F_none; - - f_macro_int32ss_t_resize(status, (*int32ss), length); - - return status; - } -#endif // !defined(_di_fl_type_int32ss_increase_) || !defined(_di_fl_type_int32ss_increase_by_) - -#if !defined(_di_fl_type_uint32ss_delete_) - void private_fl_type_uint32ss_delete(f_uint32ss_t *uint32ss) { - f_macro_uint32ss_t_delete_simple((*uint32ss)); - } -#endif // !defined(_di_fl_type_uint32ss_delete_) - -#if !defined(_di_fl_type_uint32ss_increase_) || !defined(_di_fl_type_uint32ss_increase_by_) - f_status_t private_fl_type_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) { - f_status_t status = F_none; - - f_macro_uint32ss_t_resize(status, (*uint32ss), length); - - return status; - } -#endif // !defined(_di_fl_type_uint32ss_increase_) || !defined(_di_fl_type_uint32ss_increase_by_) - -#if !defined(_di_fl_type_int64ss_delete_) - void private_fl_type_int64ss_delete(f_int64ss_t *int64ss) { - f_macro_int64ss_t_delete_simple((*int64ss)); - } -#endif // !defined(_di_fl_type_int64ss_delete_) - -#if !defined(_di_fl_type_int64ss_increase_) || !defined(_di_fl_type_int64ss_increase_by_) - f_status_t private_fl_type_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss) { - f_status_t status = F_none; - - f_macro_int64ss_t_resize(status, (*int64ss), length); - - return status; - } -#endif // !defined(_di_fl_type_int64ss_increase_) || !defined(_di_fl_type_int64ss_increase_by_) - -#if !defined(_di_fl_type_uint64ss_delete_) - void private_fl_type_uint64ss_delete(f_uint64ss_t *uint64ss) { - f_macro_uint64ss_t_delete_simple((*uint64ss)); - } -#endif // !defined(_di_fl_type_uint64ss_delete_) - -#if !defined(_di_fl_type_uint64ss_increase_) || !defined(_di_fl_type_uint64ss_increase_by_) - f_status_t private_fl_type_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) { - f_status_t status = F_none; - - f_macro_uint64ss_t_resize(status, (*uint64ss), length); - - return status; - } -#endif // !defined(_di_fl_type_uint64ss_increase_) || !defined(_di_fl_type_uint64ss_increase_by_) - -#if !defined(_di_fl_type_int128ss_delete_) - void private_fl_type_int128ss_delete(f_int128ss_t *int128ss) { - f_macro_int128ss_t_delete_simple((*int128ss)); - } -#endif // !defined(_di_fl_type_int128ss_delete_) - -#if !defined(_di_fl_type_int128ss_increase_) || !defined(_di_fl_type_int128ss_increase_by_) - f_status_t private_fl_type_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss) { - f_status_t status = F_none; - - f_macro_int128ss_t_resize(status, (*int128ss), length); - - return status; - } -#endif // !defined(_di_fl_type_int128ss_increase_) || !defined(_di_fl_type_int128ss_increase_by_) - -#if !defined(_di_fl_type_uint128ss_delete_) - void private_fl_type_uint128ss_delete(f_uint128ss_t *uint128ss) { - f_macro_uint128ss_t_delete_simple((*uint128ss)); - } -#endif // !defined(_di_fl_type_uint128ss_delete_) - -#if !defined(_di_fl_type_uint128ss_increase_) || !defined(_di_fl_type_uint128ss_increase_by_) - f_status_t private_fl_type_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) { - f_status_t status = F_none; - - f_macro_uint128ss_t_resize(status, (*uint128ss), length); - - return status; - } -#endif // !defined(_di_fl_type_uint128ss_increase_) || !defined(_di_fl_type_uint128ss_increase_by_) - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_1/fl_type/c/private-type.h b/level_1/fl_type/c/private-type.h deleted file mode 100644 index faba54e..0000000 --- a/level_1/fl_type/c/private-type.h +++ /dev/null @@ -1,418 +0,0 @@ -/** - * FLL - Level 1 - * - * Project: Type - * API Version: 0.5 - * Licenses: lgplv2.1 - * - * These are provided for internal reduction in redundant code. - * These should not be exposed/used outside of this project. - */ -#ifndef _PRIVATE_FL_type_h -#define _PRIVATE_FL_type_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Private implementation for deleting the cellss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param cellss - * The cellss array to delete. - */ -#if !defined(_di_fl_type_cellss_delete_) - extern void private_fl_type_cellss_delete(f_cellss_t *cellss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_cellss_delete_) - -/** - * Private implementation for resizing the cellss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param cellss - * The cellss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_cellss_t_resize(). - * - * @see f_macro_cellss_t_resize() - */ -#if !defined(_di_fl_type_cellss_increase_) || !defined(_di_fl_type_cellss_increase_by_) - extern f_status_t private_fl_type_cellss_resize(const f_array_length_t length, f_cellss_t *cellss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_cellss_increase_) || !defined(_di_fl_type_cellss_increase_by_) - -/** - * Private implementation for deleting the lengthss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param lengthss - * The lengthss array to delete. - */ -#if !defined(_di_fl_type_array_lengthss_delete_) - extern void private_fl_type_array_lengthss_delete(f_array_lengthss_t *lengthss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_array_lengthss_delete_) - -/** - * Private implementation for resizing the lengthss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param lengthss - * The lengthss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_array_lengthss_t_resize(). - * - * @see f_macro_array_lengthss_t_resize() - */ -#if !defined(_di_fl_type_array_lengthss_increase_) || !defined(_di_fl_type_array_lengthss_increase_by_) - extern f_status_t private_fl_type_array_lengthss_resize(const f_array_length_t length, f_array_lengthss_t *lengthss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_array_lengthss_increase_) || !defined(_di_fl_type_array_lengthss_increase_by_) - -/** - * Private implementation for deleting the int8ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param int8ss - * The int8ss array to delete. - */ -#if !defined(_di_fl_type_int8ss_delete_) - extern void private_fl_type_int8ss_delete(f_int8ss_t *int8ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int8ss_delete_) - -/** - * Private implementation for resizing the int8ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param int8ss - * The int8ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_int8ss_t_resize(). - * - * @see f_macro_int8ss_t_resize() - */ -#if !defined(_di_fl_type_int8ss_increase_) || !defined(_di_fl_type_int8ss_increase_by_) - extern f_status_t private_fl_type_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int8ss_increase_) || !defined(_di_fl_type_int8ss_increase_by_) - -/** - * Private implementation for deleting the uint8ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param uint8ss - * The uint8ss array to delete. - */ -#if !defined(_di_fl_type_uint8ss_delete_) - extern void private_fl_type_uint8ss_delete(f_uint8ss_t *uint8ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint8ss_delete_) - -/** - * Private implementation for resizing the uint8ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param uint8ss - * The uint8ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_uint8ss_t_resize(). - * - * @see f_macro_uint8ss_t_resize() - */ -#if !defined(_di_fl_type_uint8ss_increase_) || !defined(_di_fl_type_uint8ss_increase_by_) - extern f_status_t private_fl_type_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint8ss_increase_) || !defined(_di_fl_type_uint8ss_increase_by_) - -/** - * Private implementation for deleting the int16ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param int16ss - * The int16ss array to delete. - */ -#if !defined(_di_fl_type_int16ss_delete_) - extern void private_fl_type_int16ss_delete(f_int16ss_t *int16ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int16ss_delete_) - -/** - * Private implementation for resizing the int16ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param int16ss - * The int16ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_int16ss_t_resize(). - * - * @see f_macro_int16ss_t_resize() - */ -#if !defined(_di_fl_type_int16ss_increase_) || !defined(_di_fl_type_int16ss_increase_by_) - extern f_status_t private_fl_type_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int16ss_increase_) || !defined(_di_fl_type_int16ss_increase_by_) - -/** - * Private implementation for deleting the uint16ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param uint16ss - * The uint16ss array to delete. - */ -#if !defined(_di_fl_type_uint16ss_delete_) - extern void private_fl_type_uint16ss_delete(f_uint16ss_t *uint16ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint16ss_delete_) - -/** - * Private implementation for resizing the uint16ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param uint16ss - * The uint16ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_uint16ss_t_resize(). - * - * @see f_macro_uint16ss_t_resize() - */ -#if !defined(_di_fl_type_uint16ss_increase_) || !defined(_di_fl_type_uint16ss_increase_by_) - extern f_status_t private_fl_type_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint16ss_increase_) || !defined(_di_fl_type_uint16ss_increase_by_) - -/** - * Private implementation for deleting the int32ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param int32ss - * The int32ss array to delete. - */ -#if !defined(_di_fl_type_int32ss_delete_) - extern void private_fl_type_int32ss_delete(f_int32ss_t *int32ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int32ss_delete_) - -/** - * Private implementation for resizing the int32ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param int32ss - * The int32ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_int32ss_t_resize(). - * - * @see f_macro_int32ss_t_resize() - */ -#if !defined(_di_fl_type_int32ss_increase_) || !defined(_di_fl_type_int32ss_increase_by_) - extern f_status_t private_fl_type_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int32ss_increase_) || !defined(_di_fl_type_int32ss_increase_by_) - -/** - * Private implementation for deleting the uint32ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param uint32ss - * The uint32ss array to delete. - */ -#if !defined(_di_fl_type_uint32ss_delete_) - extern void private_fl_type_uint32ss_delete(f_uint32ss_t *uint32ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint32ss_delete_) - -/** - * Private implementation for resizing the uint32ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param uint32ss - * The uint32ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_uint32ss_t_resize(). - * - * @see f_macro_uint32ss_t_resize() - */ -#if !defined(_di_fl_type_uint32ss_increase_) || !defined(_di_fl_type_uint32ss_increase_by_) - extern f_status_t private_fl_type_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint32ss_increase_) || !defined(_di_fl_type_uint32ss_increase_by_) - -/** - * Private implementation for deleting the int64ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param int64ss - * The int64ss array to delete. - */ -#if !defined(_di_fl_type_int64ss_delete_) - extern void private_fl_type_int64ss_delete(f_int64ss_t *int64ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int64ss_delete_) - -/** - * Private implementation for resizing the int64ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param int64ss - * The int64ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_int64ss_t_resize(). - * - * @see f_macro_int64ss_t_resize() - */ -#if !defined(_di_fl_type_int64ss_increase_) || !defined(_di_fl_type_int64ss_increase_by_) - extern f_status_t private_fl_type_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int64ss_increase_) || !defined(_di_fl_type_int64ss_increase_by_) - -/** - * Private implementation for deleting the uint64ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param uint64ss - * The uint64ss array to delete. - */ -#if !defined(_di_fl_type_uint64ss_delete_) - extern void private_fl_type_uint64ss_delete(f_uint64ss_t *uint64ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint64ss_delete_) - -/** - * Private implementation for resizing the uint64ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param uint64ss - * The uint64ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_uint64ss_t_resize(). - * - * @see f_macro_uint64ss_t_resize() - */ -#if !defined(_di_fl_type_uint64ss_increase_) || !defined(_di_fl_type_uint64ss_increase_by_) - extern f_status_t private_fl_type_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint64ss_increase_) || !defined(_di_fl_type_uint64ss_increase_by_) - -/** - * Private implementation for deleting the int128ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param int128ss - * The int128ss array to delete. - */ -#if !defined(_di_fl_type_int128ss_delete_) - extern void private_fl_type_int128ss_delete(f_int128ss_t *int128ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int128ss_delete_) - -/** - * Private implementation for resizing the int128ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param int128ss - * The int128ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_int128ss_t_resize(). - * - * @see f_macro_int128ss_t_resize() - */ -#if !defined(_di_fl_type_int128ss_increase_) || !defined(_di_fl_type_int128ss_increase_by_) - extern f_status_t private_fl_type_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_int128ss_increase_) || !defined(_di_fl_type_int128ss_increase_by_) - -/** - * Private implementation for deleting the uint128ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param uint128ss - * The uint128ss array to delete. - */ -#if !defined(_di_fl_type_uint128ss_delete_) - extern void private_fl_type_uint128ss_delete(f_uint128ss_t *uint128ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint128ss_delete_) - -/** - * Private implementation for resizing the uint128ss array. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The length to resize to. - * @param uint128ss - * The uint128ss array to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_uint128ss_t_resize(). - * - * @see f_macro_uint128ss_t_resize() - */ -#if !defined(_di_fl_type_uint128ss_increase_) || !defined(_di_fl_type_uint128ss_increase_by_) - extern f_status_t private_fl_type_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_type_uint128ss_increase_) || !defined(_di_fl_type_uint128ss_increase_by_) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _PRIVATE_FL_type_h diff --git a/level_1/fl_type/c/type.c b/level_1/fl_type/c/type.c deleted file mode 100644 index b413e48..0000000 --- a/level_1/fl_type/c/type.c +++ /dev/null @@ -1,1164 +0,0 @@ -#include "type.h" -#include "private-type.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _di_fl_type_cells_delete_ - f_status_t fl_type_cells_delete(f_cells_t *cells) { - #ifndef _di_level_1_parameter_checking_ - if (!cells) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_cells_t_delete(status, (*cells)); - - return status; - } -#endif // _di_fl_type_cells_delete_ - -#ifndef _di_fl_type_cells_increase_ - f_status_t fl_type_cells_increase(f_cells_t *cells) { - #ifndef _di_level_1_parameter_checking_ - if (!cells) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_cells_t_increase(status, (*cells)); - - return status; - } -#endif // _di_fl_type_cells_increase_ - -#ifndef _di_fl_type_cells_increase_by_ - f_status_t fl_type_cells_increase_by(const f_array_length_t amount, f_cells_t *cells) { - #ifndef _di_level_1_parameter_checking_ - if (!cells) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_cells_t_increase_by(status, (*cells), amount); - - return status; - } -#endif // _di_fl_type_cells_increase_by_ - -#ifndef _di_fl_type_cellss_delete_ - f_status_t fl_type_cellss_delete(f_cellss_t *cellss) { - #ifndef _di_level_1_parameter_checking_ - if (!cellss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_cellss_delete(cellss); - - return F_none; - } -#endif // _di_fl_type_cellss_delete_ - -#ifndef _di_fl_type_cellss_increase_ - f_status_t fl_type_cellss_increase(f_cellss_t *cellss) { - #ifndef _di_level_1_parameter_checking_ - if (!cellss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (cellss->used + 1 > cellss->size) { - f_array_length_t size = cellss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (cellss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_cellss_resize(size, cellss); - } - - return F_none; - } -#endif // _di_fl_type_cellss_increase_ - -#ifndef _di_fl_type_cellss_increase_by_ - f_status_t fl_type_cellss_increase_by(const f_array_length_t amount, f_cellss_t *cellss) { - #ifndef _di_level_1_parameter_checking_ - if (!cellss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (cellss->used + amount > cellss->size) { - if (cellss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_cellss_resize(cellss->used + amount, cellss); - } - - return F_none; - } -#endif // _di_fl_type_cellss_increase_by_ - -#ifndef _di_fl_type_array_lengths_delete_ - f_status_t fl_type_array_lengths_delete(f_array_lengths_t *lengths) { - #ifndef _di_level_1_parameter_checking_ - if (!lengths) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_array_lengths_t_delete(status, (*lengths)); - - return status; - } -#endif // _di_fl_type_array_lengths_delete_ - -#ifndef _di_fl_type_array_lengths_increase_ - f_status_t fl_type_array_lengths_increase(f_array_lengths_t *lengths) { - #ifndef _di_level_1_parameter_checking_ - if (!lengths) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_array_lengths_t_increase(status, (*lengths)); - - return status; - } -#endif // _di_fl_type_array_lengths_increase_ - -#ifndef _di_fl_type_array_lengths_increase_by_ - f_status_t fl_type_array_lengths_increase_by(const f_array_length_t amount, f_array_lengths_t *lengths) { - #ifndef _di_level_1_parameter_checking_ - if (!lengths) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_array_lengths_t_increase_by(status, (*lengths), amount); - - return status; - } -#endif // _di_fl_type_array_lengths_increase_by_ - -#ifndef _di_fl_type_array_lengthss_delete_ - f_status_t fl_type_array_lengthss_delete(f_array_lengthss_t *lengthss) { - #ifndef _di_level_1_parameter_checking_ - if (!lengthss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_array_lengthss_delete(lengthss); - - return F_none; - } -#endif // _di_fl_type_array_lengthss_delete_ - -#ifndef _di_fl_type_array_lengthss_increase_ - f_status_t fl_type_array_lengthss_increase(f_array_lengthss_t *lengthss) { - #ifndef _di_level_1_parameter_checking_ - if (!lengthss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (lengthss->used + 1 > lengthss->size) { - f_array_length_t size = lengthss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (lengthss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_array_lengthss_resize(size, lengthss); - } - - return F_none; - } -#endif // _di_fl_type_array_lengthss_increase_ - -#ifndef _di_fl_type_array_lengthss_increase_by_ - f_status_t fl_type_array_lengthss_increase_by(const f_array_length_t amount, f_array_lengthss_t *lengthss) { - #ifndef _di_level_1_parameter_checking_ - if (!lengthss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (lengthss->used + amount > lengthss->size) { - if (lengthss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_array_lengthss_resize(lengthss->used + amount, lengthss); - } - - return F_none; - } -#endif // _di_fl_type_array_lengthss_increase_by_ - -#ifndef _di_fl_type_int8s_delete_ - f_status_t fl_type_int8s_delete(f_int8s_t *int8s) { - #ifndef _di_level_1_parameter_checking_ - if (!int8s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int8s_t_delete(status, (*int8s)); - - return status; - } -#endif // _di_fl_type_int8s_delete_ - -#ifndef _di_fl_type_int8s_increase_ - f_status_t fl_type_int8s_increase(f_int8s_t *int8s) { - #ifndef _di_level_1_parameter_checking_ - if (!int8s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int8s_t_increase(status, (*int8s)); - - return status; - } -#endif // _di_fl_type_int8s_increase_ - -#ifndef _di_fl_type_int8s_increase_by_ - f_status_t fl_type_int8s_increase_by(const f_array_length_t amount, f_int8s_t *int8s) { - #ifndef _di_level_1_parameter_checking_ - if (!int8s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int8s_t_increase_by(status, (*int8s), amount); - - return status; - } -#endif // _di_fl_type_int8s_increase_by_ - -#ifndef _di_fl_type_int8ss_delete_ - f_status_t fl_type_int8ss_delete(f_int8ss_t *int8ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int8ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_int8ss_delete(int8ss); - - return F_none; - } -#endif // _di_fl_type_int8ss_delete_ - -#ifndef _di_fl_type_int8ss_increase_ - f_status_t fl_type_int8ss_increase(f_int8ss_t *int8ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int8ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int8ss->used + 1 > int8ss->size) { - f_array_length_t size = int8ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (int8ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_int8ss_resize(size, int8ss); - } - - return F_none; - } -#endif // _di_fl_type_int8ss_increase_ - -#ifndef _di_fl_type_int8ss_increase_by_ - f_status_t fl_type_int8ss_increase_by(const f_array_length_t amount, f_int8ss_t *int8ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int8ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int8ss->used + amount > int8ss->size) { - if (int8ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_int8ss_resize(int8ss->used + amount, int8ss); - } - - return F_none; - } -#endif // _di_fl_type_int8ss_increase_by_ - -#ifndef _di_fl_type_uint8s_delete_ - f_status_t fl_type_uint8s_delete(f_uint8s_t *uint8s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint8s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint8s_t_delete(status, (*uint8s)); - - return status; - } -#endif // _di_fl_type_uint8s_delete_ - -#ifndef _di_fl_type_uint8s_increase_ - f_status_t fl_type_uint8s_increase(f_uint8s_t *uint8s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint8s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint8s_t_increase(status, (*uint8s)); - - return status; - } -#endif // _di_fl_type_uint8s_increase_ - -#ifndef _di_fl_type_uint8s_increase_by_ - f_status_t fl_type_uint8s_increase_by(const f_array_length_t amount, f_uint8s_t *uint8s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint8s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint8s_t_increase_by(status, (*uint8s), amount); - - return status; - } -#endif // _di_fl_type_uint8s_increase_by_ - -#ifndef _di_fl_type_uint8ss_delete_ - f_status_t fl_type_uint8ss_delete(f_uint8ss_t *uint8ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint8ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_uint8ss_delete(uint8ss); - - return F_none; - } -#endif // _di_fl_type_uint8ss_delete_ - -#ifndef _di_fl_type_uint8ss_increase_ - f_status_t fl_type_uint8ss_increase(f_uint8ss_t *uint8ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint8ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint8ss->used + 1 > uint8ss->size) { - f_array_length_t size = uint8ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (uint8ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_uint8ss_resize(size, uint8ss); - } - - return F_none; - } -#endif // _di_fl_type_uint8ss_increase_ - -#ifndef _di_fl_type_uint8ss_increase_by_ - f_status_t fl_type_uint8ss_increase_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint8ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint8ss->used + amount > uint8ss->size) { - if (uint8ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_uint8ss_resize(uint8ss->used + amount, uint8ss); - } - - return F_none; - } -#endif // _di_fl_type_uint8ss_increase_by_ - -#ifndef _di_fl_type_int16s_delete_ - f_status_t fl_type_int16s_delete(f_int16s_t *int16s) { - #ifndef _di_level_1_parameter_checking_ - if (!int16s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int16s_t_delete(status, (*int16s)); - - return status; - } -#endif // _di_fl_type_int16s_delete_ - -#ifndef _di_fl_type_int16s_increase_ - f_status_t fl_type_int16s_increase(f_int16s_t *int16s) { - #ifndef _di_level_1_parameter_checking_ - if (!int16s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int16s_t_increase(status, (*int16s)); - - return status; - } -#endif // _di_fl_type_int16s_increase_ - -#ifndef _di_fl_type_int16s_increase_by_ - f_status_t fl_type_int16s_increase_by(const f_array_length_t amount, f_int16s_t *int16s) { - #ifndef _di_level_1_parameter_checking_ - if (!int16s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int16s_t_increase_by(status, (*int16s), amount); - - return status; - } -#endif // _di_fl_type_int16s_increase_by_ - -#ifndef _di_fl_type_int16ss_delete_ - f_status_t fl_type_int16ss_delete(f_int16ss_t *int16ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int16ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_int16ss_delete(int16ss); - - return F_none; - } -#endif // _di_fl_type_int16ss_delete_ - -#ifndef _di_fl_type_int16ss_increase_ - f_status_t fl_type_int16ss_increase(f_int16ss_t *int16ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int16ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int16ss->used + 1 > int16ss->size) { - f_array_length_t size = int16ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (int16ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_int16ss_resize(size, int16ss); - } - - return F_none; - } -#endif // _di_fl_type_int16ss_increase_ - -#ifndef _di_fl_type_int16ss_increase_by_ - f_status_t fl_type_int16ss_increase_by(const f_array_length_t amount, f_int16ss_t *int16ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int16ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int16ss->used + amount > int16ss->size) { - if (int16ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_int16ss_resize(int16ss->used + amount, int16ss); - } - - return F_none; - } -#endif // _di_fl_type_int16ss_increase_by_ - -#ifndef _di_fl_type_uint16s_delete_ - f_status_t fl_type_uint16s_delete(f_uint16s_t *uint16s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint16s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint16s_t_delete(status, (*uint16s)); - - return status; - } -#endif // _di_fl_type_uint16s_delete_ - -#ifndef _di_fl_type_uint16s_increase_ - f_status_t fl_type_uint16s_increase(f_uint16s_t *uint16s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint16s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint16s_t_increase(status, (*uint16s)); - - return status; - } -#endif // _di_fl_type_uint16s_increase_ - -#ifndef _di_fl_type_uint16s_increase_by_ - f_status_t fl_type_uint16s_increase_by(const f_array_length_t amount, f_uint16s_t *uint16s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint16s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint16s_t_increase_by(status, (*uint16s), amount); - - return status; - } -#endif // _di_fl_type_uint16s_increase_by_ - -#ifndef _di_fl_type_uint16ss_delete_ - f_status_t fl_type_uint16ss_delete(f_uint16ss_t *uint16ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint16ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_uint16ss_delete(uint16ss); - - return F_none; - } -#endif // _di_fl_type_uint16ss_delete_ - -#ifndef _di_fl_type_uint16ss_increase_ - f_status_t fl_type_uint16ss_increase(f_uint16ss_t *uint16ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint16ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint16ss->used + 1 > uint16ss->size) { - f_array_length_t size = uint16ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (uint16ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_uint16ss_resize(size, uint16ss); - } - - return F_none; - } -#endif // _di_fl_type_uint16ss_increase_ - -#ifndef _di_fl_type_uint16ss_increase_by_ - f_status_t fl_type_uint16ss_increase_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint16ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint16ss->used + amount > uint16ss->size) { - if (uint16ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_uint16ss_resize(uint16ss->used + amount, uint16ss); - } - - return F_none; - } -#endif // _di_fl_type_uint16ss_increase_by_ - -#ifndef _di_fl_type_int32s_delete_ - f_status_t fl_type_int32s_delete(f_int32s_t *int32s) { - #ifndef _di_level_1_parameter_checking_ - if (!int32s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int32s_t_delete(status, (*int32s)); - - return status; - } -#endif // _di_fl_type_int32s_delete_ - -#ifndef _di_fl_type_int32s_increase_ - f_status_t fl_type_int32s_increase(f_int32s_t *int32s) { - #ifndef _di_level_1_parameter_checking_ - if (!int32s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int32s_t_increase(status, (*int32s)); - - return status; - } -#endif // _di_fl_type_int32s_increase_ - -#ifndef _di_fl_type_int32s_increase_by_ - f_status_t fl_type_int32s_increase_by(const f_array_length_t amount, f_int32s_t *int32s) { - #ifndef _di_level_1_parameter_checking_ - if (!int32s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int32s_t_increase_by(status, (*int32s), amount); - - return status; - } -#endif // _di_fl_type_int32s_increase_by_ - -#ifndef _di_fl_type_int32ss_delete_ - f_status_t fl_type_int32ss_delete(f_int32ss_t *int32ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int32ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_int32ss_delete(int32ss); - - return F_none; - } -#endif // _di_fl_type_int32ss_delete_ - -#ifndef _di_fl_type_int32ss_increase_ - f_status_t fl_type_int32ss_increase(f_int32ss_t *int32ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int32ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int32ss->used + 1 > int32ss->size) { - f_array_length_t size = int32ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (int32ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_int32ss_resize(size, int32ss); - } - - return F_none; - } -#endif // _di_fl_type_int32ss_increase_ - -#ifndef _di_fl_type_int32ss_increase_by_ - f_status_t fl_type_int32ss_increase_by(const f_array_length_t amount, f_int32ss_t *int32ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int32ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int32ss->used + amount > int32ss->size) { - if (int32ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_int32ss_resize(int32ss->used + amount, int32ss); - } - - return F_none; - } -#endif // _di_fl_type_int32ss_increase_by_ - -#ifndef _di_fl_type_uint32s_delete_ - f_status_t fl_type_uint32s_delete(f_uint32s_t *uint32s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint32s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint32s_t_delete(status, (*uint32s)); - - return status; - } -#endif // _di_fl_type_uint32s_delete_ - -#ifndef _di_fl_type_uint32s_increase_ - f_status_t fl_type_uint32s_increase(f_uint32s_t *uint32s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint32s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint32s_t_increase(status, (*uint32s)); - - return status; - } -#endif // _di_fl_type_uint32s_increase_ - -#ifndef _di_fl_type_uint32s_increase_by_ - f_status_t fl_type_uint32s_increase_by(const f_array_length_t amount, f_uint32s_t *uint32s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint32s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint32s_t_increase_by(status, (*uint32s), amount); - - return status; - } -#endif // _di_fl_type_uint32s_increase_by_ - -#ifndef _di_fl_type_uint32ss_delete_ - f_status_t fl_type_uint32ss_delete(f_uint32ss_t *uint32ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint32ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_uint32ss_delete(uint32ss); - - return F_none; - } -#endif // _di_fl_type_uint32ss_delete_ - -#ifndef _di_fl_type_uint32ss_increase_ - f_status_t fl_type_uint32ss_increase(f_uint32ss_t *uint32ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint32ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint32ss->used + 1 > uint32ss->size) { - f_array_length_t size = uint32ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (uint32ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_uint32ss_resize(size, uint32ss); - } - - return F_none; - } -#endif // _di_fl_type_uint32ss_increase_ - -#ifndef _di_fl_type_uint32ss_increase_by_ - f_status_t fl_type_uint32ss_increase_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint32ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint32ss->used + amount > uint32ss->size) { - if (uint32ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_uint32ss_resize(uint32ss->used + amount, uint32ss); - } - - return F_none; - } -#endif // _di_fl_type_uint32ss_increase_by_ - -#ifndef _di_fl_type_int64s_delete_ - f_status_t fl_type_int64s_delete(f_int64s_t *int64s) { - #ifndef _di_level_1_parameter_checking_ - if (!int64s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int64s_t_delete(status, (*int64s)); - - return status; - } -#endif // _di_fl_type_int64s_delete_ - -#ifndef _di_fl_int64s_increase_ - f_status_t fl_int64s_increase(f_int64s_t *int64s) { - #ifndef _di_level_1_parameter_checking_ - if (!int64s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int64s_t_increase(status, (*int64s)); - - return status; - } -#endif // _di_fl_int64s_increase_ - -#ifndef _di_fl_int64s_increase_by_ - f_status_t fl_int64s_increase_by(const f_array_length_t amount, f_int64s_t *int64s) { - #ifndef _di_level_1_parameter_checking_ - if (!int64s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int64s_t_increase_by(status, (*int64s), amount); - - return status; - } -#endif // _di_fl_int64s_increase_by_ - -#ifndef _di_fl_type_int64ss_delete_ - f_status_t fl_type_int64ss_delete(f_int64ss_t *int64ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int64ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_int64ss_delete(int64ss); - - return F_none; - } -#endif // _di_fl_type_int64ss_delete_ - -#ifndef _di_fl_int64ss_increase_ - f_status_t fl_int64ss_increase(f_int64ss_t *int64ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int64ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int64ss->used + 1 > int64ss->size) { - f_array_length_t size = int64ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (int64ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_int64ss_resize(size, int64ss); - } - - return F_none; - } -#endif // _di_fl_int64ss_increase_ - -#ifndef _di_fl_int64ss_increase_by_ - f_status_t fl_int64ss_increase_by(const f_array_length_t amount, f_int64ss_t *int64ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int64ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int64ss->used + amount > int64ss->size) { - if (int64ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_int64ss_resize(int64ss->used + amount, int64ss); - } - - return F_none; - } -#endif // _di_fl_int64ss_increase_by_ - -#ifndef _di_fl_type_uint64s_delete_ - f_status_t fl_type_uint64s_delete(f_uint64s_t *uint64s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint64s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint64s_t_delete(status, (*uint64s)); - - return status; - } -#endif // _di_fl_type_uint64s_delete_ - -#ifndef _di_fl_uint64s_increase_ - f_status_t fl_uint64s_increase(f_uint64s_t *uint64s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint64s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint64s_t_increase(status, (*uint64s)); - - return status; - } -#endif // _di_fl_uint64s_increase_ - -#ifndef _di_fl_uint64s_increase_by_ - f_status_t fl_uint64s_increase_by(const f_array_length_t amount, f_uint64s_t *uint64s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint64s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint64s_t_increase_by(status, (*uint64s), amount); - - return status; - } -#endif // _di_fl_uint64s_increase_by_ - -#ifndef _di_fl_type_uint64ss_delete_ - f_status_t fl_type_uint64ss_delete(f_uint64ss_t *uint64ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint64ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_uint64ss_delete(uint64ss); - - return F_none; - } -#endif // _di_fl_type_uint64ss_delete_ - -#ifndef _di_fl_uint64ss_increase_ - f_status_t fl_uint64ss_increase(f_uint64ss_t *uint64ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint64ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint64ss->used + 1 > uint64ss->size) { - f_array_length_t size = uint64ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (uint64ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_uint64ss_resize(size, uint64ss); - } - - return F_none; - } -#endif // _di_fl_uint64ss_increase_ - -#ifndef _di_fl_uint64ss_increase_by_ - f_status_t fl_uint64ss_increase_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint64ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint64ss->used + amount > uint64ss->size) { - if (uint64ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_uint64ss_resize(uint64ss->used + amount, uint64ss); - } - - return F_none; - } -#endif // _di_fl_uint64ss_increase_by_ - -#ifndef _di_fl_type_int128s_delete_ - f_status_t fl_type_int128s_delete(f_int128s_t *int128s) { - #ifndef _di_level_1_parameter_checking_ - if (!int128s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int128s_t_delete(status, (*int128s)); - - return status; - } -#endif // _di_fl_type_int128s_delete_ - -#ifndef _di_fl_type_int128s_increase_ - f_status_t fl_type_int128s_increase(f_int128s_t *int128s) { - #ifndef _di_level_1_parameter_checking_ - if (!int128s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int128s_t_increase(status, (*int128s)); - - return status; - } -#endif // _di_fl_type_int128s_increase_ - -#ifndef _di_fl_type_int128s_increase_by_ - f_status_t fl_type_int128s_increase_by(const f_array_length_t amount, f_int128s_t *int128s) { - #ifndef _di_level_1_parameter_checking_ - if (!int128s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_int128s_t_increase_by(status, (*int128s), amount); - - return status; - } -#endif // _di_fl_type_int128s_increase_by_ - -#ifndef _di_fl_type_int128ss_delete_ - f_status_t fl_type_int128ss_delete(f_int128ss_t *int128ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int128ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_int128ss_delete(int128ss); - - return F_none; - } -#endif // _di_fl_type_int128ss_delete_ - -#ifndef _di_fl_type_int128ss_increase_ - f_status_t fl_type_int128ss_increase(f_int128ss_t *int128ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int128ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int128ss->used + 1 > int128ss->size) { - f_array_length_t size = int128ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (int128ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_int128ss_resize(size, int128ss); - } - - return F_none; - } -#endif // _di_fl_type_int128ss_increase_ - -#ifndef _di_fl_type_int128ss_increase_by_ - f_status_t fl_type_int128ss_increase_by(const f_array_length_t amount, f_int128ss_t *int128ss) { - #ifndef _di_level_1_parameter_checking_ - if (!int128ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (int128ss->used + amount > int128ss->size) { - if (int128ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - f_status_t status = F_none; - - private_fl_type_int128ss_resize(int128ss->used + amount, int128ss); - } - - return F_none; - } -#endif // _di_fl_type_int128ss_increase_by_ - -#ifndef _di_fl_type_uint128s_delete_ - f_status_t fl_type_uint128s_delete(f_uint128s_t *uint128s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint128s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint128s_t_delete(status, (*uint128s)); - - return status; - } -#endif // _di_fl_type_uint128s_delete_ - -#ifndef _di_fl_type_uint128s_increase_ - f_status_t fl_type_uint128s_increase(f_uint128s_t *uint128s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint128s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint128s_t_increase(status, (*uint128s)); - - return status; - } -#endif // _di_fl_type_uint128s_increase_ - -#ifndef _di_fl_type_uint128s_increase_by_ - f_status_t fl_type_uint128s_increase_by(const f_array_length_t amount, f_uint128s_t *uint128s) { - #ifndef _di_level_1_parameter_checking_ - if (!uint128s) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status_t status = F_none; - - f_macro_uint128s_t_increase_by(status, (*uint128s), amount); - - return status; - } -#endif // _di_fl_type_uint128s_increase_by_ - -#ifndef _di_fl_type_uint128ss_delete_ - f_status_t fl_type_uint128ss_delete(f_uint128ss_t *uint128ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint128ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_type_uint128ss_delete(uint128ss); - - return F_none; - } -#endif // _di_fl_type_uint128ss_delete_ - -#ifndef _di_fl_type_uint128ss_increase_ - f_status_t fl_type_uint128ss_increase(f_uint128ss_t *uint128ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint128ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint128ss->used + 1 > uint128ss->size) { - f_array_length_t size = uint128ss->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (uint128ss->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - private_fl_type_uint128ss_resize(size, uint128ss); - } - - return F_none; - } -#endif // _di_fl_type_uint128ss_increase_ - -#ifndef _di_fl_type_uint128ss_increase_by_ - f_status_t fl_type_uint128ss_increase_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) { - #ifndef _di_level_1_parameter_checking_ - if (!uint128ss) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (uint128ss->used + amount > uint128ss->size) { - if (uint128ss->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - private_fl_type_uint128ss_resize(uint128ss->used + amount, uint128ss); - } - - return F_none; - } -#endif // _di_fl_type_uint128ss_increase_by_ - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_1/fl_type/c/type.h b/level_1/fl_type/c/type.h deleted file mode 100644 index be9676d..0000000 --- a/level_1/fl_type/c/type.h +++ /dev/null @@ -1,1229 +0,0 @@ -/** - * FLL - Level 1 - * - * Project: Type - * API Version: 0.5 - * Licenses: lgplv2.1 - * - * Provides type management functions. - */ -#ifndef _FL_type_h -#define _FL_type_h - -// libc includes - -// fll-0 includes -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Delete the cells array. - * - * @param cells - * The cells array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_cells_t_delete_simple() - */ -#ifndef _di_fl_type_cells_delete_ - extern f_status_t fl_type_cells_delete(f_cells_t *cells); -#endif // _di_fl_type_cells_delete_ - -/** - * Increase the size of cells array, but only if necessary. - * - * @param cells - * The cells array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_cells_increase_ - extern f_status_t fl_type_cells_increase(f_cells_t *cells); -#endif // _di_fl_type_cells_increase_ - -/** - * Increase the size of cells array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param cells - * The cells array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_cells_increase_by_ - extern f_status_t fl_type_cells_increase_by(const f_array_length_t amount, f_cells_t *cells); -#endif // _di_fl_type_cells_increase_by_ - -/** - * Delete the cellss array. - * - * @param cellss - * The cellss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_cellss_t_delete_simple() - */ -#ifndef _di_fl_type_cellss_delete_ - extern f_status_t fl_type_cellss_delete(f_cellss_t *cellss); -#endif // _di_fl_type_cellss_delete_ - -/** - * Increase the size of cells array, but only if necessary. - * - * @param cells - * The cells array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_cellss_increase_ - extern f_status_t fl_type_cellss_increase(f_cellss_t *cellss); -#endif // _di_fl_type_cellss_increase_ - -/** - * Increase the size of cellss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param cellss - * The cellss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_cellss_increase_by_ - extern f_status_t fl_type_cellss_increase_by(const f_array_length_t amount, f_cellss_t *cellss); -#endif // _di_fl_type_cellss_increase_by_ - -/** - * Delete the array_lengths array. - * - * @param array_lengths - * The array_lengths array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_array_lengths_t_delete_simple() - */ -#ifndef _di_fl_type_array_lengths_delete_ - extern f_status_t fl_type_array_lengths_delete(f_array_lengths_t *array_lengths); -#endif // _di_fl_type_array_lengths_delete_ - -/** - * Increase the size of array_lengths array, but only if necessary. - * - * @param array_lengths - * The array_lengths array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_array_lengths_increase_ - extern f_status_t fl_type_array_lengths_increase(f_array_lengths_t *array_lengths); -#endif // _di_fl_type_array_lengths_increase_ - -/** - * Increase the size of array_lengths array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param array_lengths - * The array_lengths array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_array_lengths_increase_by_ - extern f_status_t fl_type_array_lengths_increase_by(const f_array_length_t amount, f_array_lengths_t *array_lengths); -#endif // _di_fl_type_array_lengths_increase_by_ - -/** - * Delete the array_lengthss array. - * - * @param array_lengthss - * The array_lengthss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_array_lengthss_t_delete_simple() - */ -#ifndef _di_fl_type_array_lengthss_delete_ - extern f_status_t fl_type_array_lengthss_delete(f_array_lengthss_t *array_lengthss); -#endif // _di_fl_type_array_lengthss_delete_ - -/** - * Increase the size of array_lengths array, but only if necessary. - * - * @param array_lengths - * The array_lengths array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_array_lengthss_increase_ - extern f_status_t fl_type_array_lengthss_increase(f_array_lengthss_t *array_lengthss); -#endif // _di_fl_type_array_lengthss_increase_ - -/** - * Increase the size of array_lengthss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param array_lengthss - * The array_lengthss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_array_lengthss_increase_by_ - extern f_status_t fl_type_array_lengthss_increase_by(const f_array_length_t amount, f_array_lengthss_t *array_lengthss); -#endif // _di_fl_type_array_lengthss_increase_by_ - -/** - * Delete the int8s array. - * - * @param int8s - * The int8s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int8s_t_delete_simple() - */ -#ifndef _di_fl_type_int8s_delete_ - extern f_status_t fl_type_int8s_delete(f_int8s_t *int8s); -#endif // _di_fl_type_int8s_delete_ - -/** - * Increase the size of int8s array, but only if necessary. - * - * @param int8s - * The int8s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int8s_increase_ - extern f_status_t fl_type_int8s_increase(f_int8s_t *int8s); -#endif // _di_fl_type_int8s_increase_ - -/** - * Increase the size of int8s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int8s - * The int8s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int8s_increase_by_ - extern f_status_t fl_type_int8s_increase_by(const f_array_length_t amount, f_int8s_t *int8s); -#endif // _di_fl_type_int8s_increase_by_ - -/** - * Delete the int8ss array. - * - * @param int8ss - * The int8ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int8ss_t_delete_simple() - */ -#ifndef _di_fl_type_int8ss_delete_ - extern f_status_t fl_type_int8ss_delete(f_int8ss_t *int8ss); -#endif // _di_fl_type_int8ss_delete_ - -/** - * Increase the size of int8s array, but only if necessary. - * - * @param int8s - * The int8s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int8ss_increase_ - extern f_status_t fl_type_int8ss_increase(f_int8ss_t *int8ss); -#endif // _di_fl_type_int8ss_increase_ - -/** - * Increase the size of int8ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int8ss - * The int8ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int8ss_increase_by_ - extern f_status_t fl_type_int8ss_increase_by(const f_array_length_t amount, f_int8ss_t *int8ss); -#endif // _di_fl_type_int8ss_increase_by_ - -/** - * Delete the uint8s array. - * - * @param uint8s - * The uint8s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint8s_t_delete_simple() - */ -#ifndef _di_fl_type_uint8s_delete_ - extern f_status_t fl_type_uint8s_delete(f_uint8s_t *uint8s); -#endif // _di_fl_type_uint8s_delete_ - -/** - * Increase the size of uint8s array, but only if necessary. - * - * @param uint8s - * The uint8s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint8s_increase_ - extern f_status_t fl_type_uint8s_increase(f_uint8s_t *uint8s); -#endif // _di_fl_type_uint8s_increase_ - -/** - * Increase the size of uint8s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint8s - * The uint8s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint8s_increase_by_ - extern f_status_t fl_type_uint8s_increase_by(const f_array_length_t amount, f_uint8s_t *uint8s); -#endif // _di_fl_type_uint8s_increase_by_ - -/** - * Delete the uint8ss array. - * - * @param uint8ss - * The uint8ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint8ss_t_delete_simple() - */ -#ifndef _di_fl_type_uint8ss_delete_ - extern f_status_t fl_type_uint8ss_delete(f_uint8ss_t *uint8ss); -#endif // _di_fl_type_uint8ss_delete_ - -/** - * Increase the size of uint8s array, but only if necessary. - * - * @param uint8s - * The uint8s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint8ss_increase_ - extern f_status_t fl_type_uint8ss_increase(f_uint8ss_t *uint8ss); -#endif // _di_fl_type_uint8ss_increase_ - -/** - * Increase the size of uint8ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint8ss - * The uint8ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint8ss_increase_by_ - extern f_status_t fl_type_uint8ss_increase_by(const f_array_length_t amount, f_uint8ss_t *uint8ss); -#endif // _di_fl_type_uint8ss_increase_by_ - -/** - * Delete the int16s array. - * - * @param int16s - * The int16s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int16s_t_delete_simple() - */ -#ifndef _di_fl_type_int16s_delete_ - extern f_status_t fl_type_int16s_delete(f_int16s_t *int16s); -#endif // _di_fl_type_int16s_delete_ - -/** - * Increase the size of int16s array, but only if necessary. - * - * @param int16s - * The int16s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int16s_increase_ - extern f_status_t fl_type_int16s_increase(f_int16s_t *int16s); -#endif // _di_fl_type_int16s_increase_ - -/** - * Increase the size of int16s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int16s - * The int16s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int16s_increase_by_ - extern f_status_t fl_type_int16s_increase_by(const f_array_length_t amount, f_int16s_t *int16s); -#endif // _di_fl_type_int16s_increase_by_ - -/** - * Delete the int16ss array. - * - * @param int16ss - * The int16ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int16ss_t_delete_simple() - */ -#ifndef _di_fl_type_int16ss_delete_ - extern f_status_t fl_type_int16ss_delete(f_int16ss_t *int16ss); -#endif // _di_fl_type_int16ss_delete_ - -/** - * Increase the size of int16s array, but only if necessary. - * - * @param int16s - * The int16s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int16ss_increase_ - extern f_status_t fl_type_int16ss_increase(f_int16ss_t *int16ss); -#endif // _di_fl_type_int16ss_increase_ - -/** - * Increase the size of int16ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int16ss - * The int16ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int16ss_increase_by_ - extern f_status_t fl_type_int16ss_increase_by(const f_array_length_t amount, f_int16ss_t *int16ss); -#endif // _di_fl_type_int16ss_increase_by_ - -/** - * Delete the uint16s array. - * - * @param uint16s - * The uint16s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint16s_t_delete_simple() - */ -#ifndef _di_fl_type_uint16s_delete_ - extern f_status_t fl_type_uint16s_delete(f_uint16s_t *uint16s); -#endif // _di_fl_type_uint16s_delete_ - -/** - * Increase the size of uint16s array, but only if necessary. - * - * @param uint16s - * The uint16s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint16s_increase_ - extern f_status_t fl_type_uint16s_increase(f_uint16s_t *uint16s); -#endif // _di_fl_type_uint16s_increase_ - -/** - * Increase the size of uint16s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint16s - * The uint16s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint16s_increase_by_ - extern f_status_t fl_type_uint16s_increase_by(const f_array_length_t amount, f_uint16s_t *uint16s); -#endif // _di_fl_type_uint16s_increase_by_ - -/** - * Delete the uint16ss array. - * - * @param uint16ss - * The uint16ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint16ss_t_delete_simple() - */ -#ifndef _di_fl_type_uint16ss_delete_ - extern f_status_t fl_type_uint16ss_delete(f_uint16ss_t *uint16ss); -#endif // _di_fl_type_uint16ss_delete_ - -/** - * Increase the size of uint16s array, but only if necessary. - * - * @param uint16s - * The uint16s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint16ss_increase_ - extern f_status_t fl_type_uint16ss_increase(f_uint16ss_t *uint16ss); -#endif // _di_fl_type_uint16ss_increase_ - -/** - * Increase the size of uint16ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint16ss - * The uint16ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint16ss_increase_by_ - extern f_status_t fl_type_uint16ss_increase_by(const f_array_length_t amount, f_uint16ss_t *uint16ss); -#endif // _di_fl_type_uint16ss_increase_by_ - -/** - * Delete the int32s array. - * - * @param int32s - * The int32s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int32s_t_delete_simple() - */ -#ifndef _di_fl_type_int32s_delete_ - extern f_status_t fl_type_int32s_delete(f_int32s_t *int32s); -#endif // _di_fl_type_int32s_delete_ - -/** - * Increase the size of int32s array, but only if necessary. - * - * @param int32s - * The int32s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int32s_increase_ - extern f_status_t fl_type_int32s_increase(f_int32s_t *int32s); -#endif // _di_fl_type_int32s_increase_ - -/** - * Increase the size of int32s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int32s - * The int32s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int32s_increase_by_ - extern f_status_t fl_type_int32s_increase_by(const f_array_length_t amount, f_int32s_t *int32s); -#endif // _di_fl_type_int32s_increase_by_ - -/** - * Delete the int32ss array. - * - * @param int32ss - * The int32ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int32ss_t_delete_simple() - */ -#ifndef _di_fl_type_int32ss_delete_ - extern f_status_t fl_type_int32ss_delete(f_int32ss_t *int32ss); -#endif // _di_fl_type_int32ss_delete_ - -/** - * Increase the size of int32s array, but only if necessary. - * - * @param int32s - * The int32s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int32ss_increase_ - extern f_status_t fl_type_int32ss_increase(f_int32ss_t *int32ss); -#endif // _di_fl_type_int32ss_increase_ - -/** - * Increase the size of int32ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int32ss - * The int32ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int32ss_increase_by_ - extern f_status_t fl_type_int32ss_increase_by(const f_array_length_t amount, f_int32ss_t *int32ss); -#endif // _di_fl_type_int32ss_increase_by_ - -/** - * Delete the uint32s array. - * - * @param uint32s - * The uint32s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint32s_t_delete_simple() - */ -#ifndef _di_fl_type_uint32s_delete_ - extern f_status_t fl_type_uint32s_delete(f_uint32s_t *uint32s); -#endif // _di_fl_type_uint32s_delete_ - -/** - * Increase the size of uint32s array, but only if necessary. - * - * @param uint32s - * The uint32s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint32s_increase_ - extern f_status_t fl_type_uint32s_increase(f_uint32s_t *uint32s); -#endif // _di_fl_type_uint32s_increase_ - -/** - * Increase the size of uint32s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint32s - * The uint32s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint32s_increase_by_ - extern f_status_t fl_type_uint32s_increase_by(const f_array_length_t amount, f_uint32s_t *uint32s); -#endif // _di_fl_type_uint32s_increase_by_ - -/** - * Delete the uint32ss array. - * - * @param uint32ss - * The uint32ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint32ss_t_delete_simple() - */ -#ifndef _di_fl_type_uint32ss_delete_ - extern f_status_t fl_type_uint32ss_delete(f_uint32ss_t *uint32ss); -#endif // _di_fl_type_uint32ss_delete_ - -/** - * Increase the size of uint32s array, but only if necessary. - * - * @param uint32s - * The uint32s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint32ss_increase_ - extern f_status_t fl_type_uint32ss_increase(f_uint32ss_t *uint32ss); -#endif // _di_fl_type_uint32ss_increase_ - -/** - * Increase the size of uint32ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint32ss - * The uint32ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint32ss_increase_by_ - extern f_status_t fl_type_uint32ss_increase_by(const f_array_length_t amount, f_uint32ss_t *uint32ss); -#endif // _di_fl_type_uint32ss_increase_by_ - -/** - * Delete the int64s array. - * - * @param int64s - * The int64s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int64s_t_delete_simple() - */ -#ifndef _di_fl_type_int64s_delete_ - extern f_status_t fl_type_int64s_delete(f_int64s_t *int64s); -#endif // _di_fl_type_int64s_delete_ - -/** - * Increase the size of int64s array, but only if necessary. - * - * @param int64s - * The int64s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_int64s_increase_ - extern f_status_t fl_int64s_increase(f_int64s_t *int64s); -#endif // _di_fl_int64s_increase_ - -/** - * Increase the size of int64s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int64s - * The int64s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_int64s_increase_by_ - extern f_status_t fl_int64s_increase_by(const f_array_length_t amount, f_int64s_t *int64s); -#endif // _di_fl_int64s_increase_by_ - -/** - * Delete the int64ss array. - * - * @param int64ss - * The int64ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int64ss_t_delete_simple() - */ -#ifndef _di_fl_type_int64ss_delete_ - extern f_status_t fl_type_int64ss_delete(f_int64ss_t *int64ss); -#endif // _di_fl_type_int64ss_delete_ - -/** - * Increase the size of int64s array, but only if necessary. - * - * @param int64s - * The int64s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_int64ss_increase_ - extern f_status_t fl_int64ss_increase(f_int64ss_t *int64ss); -#endif // _di_fl_int64ss_increase_ - -/** - * Increase the size of int64ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int64ss - * The int64ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_int64ss_increase_by_ - extern f_status_t fl_int64ss_increase_by(const f_array_length_t amount, f_int64ss_t *int64ss); -#endif // _di_fl_int64ss_increase_by_ - -/** - * Delete the uint64s array. - * - * @param uint64s - * The uint64s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint64s_t_delete_simple() - */ -#ifndef _di_fl_type_uint64s_delete_ - extern f_status_t fl_type_uint64s_delete(f_uint64s_t *uint64s); -#endif // _di_fl_type_uint64s_delete_ - -/** - * Increase the size of uint64s array, but only if necessary. - * - * @param uint64s - * The uint64s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_uint64s_increase_ - extern f_status_t fl_uint64s_increase(f_uint64s_t *uint64s); -#endif // _di_fl_uint64s_increase_ - -/** - * Increase the size of uint64s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint64s - * The uint64s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_uint64s_increase_by_ - extern f_status_t fl_uint64s_increase_by(const f_array_length_t amount, f_uint64s_t *uint64s); -#endif // _di_fl_uint64s_increase_by_ - -/** - * Delete the uint64ss array. - * - * @param uint64ss - * The uint64ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint64ss_t_delete_simple() - */ -#ifndef _di_fl_type_uint64ss_delete_ - extern f_status_t fl_type_uint64ss_delete(f_uint64ss_t *uint64ss); -#endif // _di_fl_type_uint64ss_delete_ - -/** - * Increase the size of uint64s array, but only if necessary. - * - * @param uint64s - * The uint64s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_uint64ss_increase_ - extern f_status_t fl_uint64ss_increase(f_uint64ss_t *uint64ss); -#endif // _di_fl_uint64ss_increase_ - -/** - * Increase the size of uint64ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint64ss - * The uint64ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_uint64ss_increase_by_ - extern f_status_t fl_uint64ss_increase_by(const f_array_length_t amount, f_uint64ss_t *uint64ss); -#endif // _di_fl_uint64ss_increase_by_ - -/** - * Delete the int128s array. - * - * @param int128s - * The int128s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int128s_t_delete_simple() - */ -#ifndef _di_fl_type_int128s_delete_ - extern f_status_t fl_type_int128s_delete(f_int128s_t *int128s); -#endif // _di_fl_type_int128s_delete_ - -/** - * Increase the size of int128s array, but only if necessary. - * - * @param int128s - * The int128s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int128s_increase_ - extern f_status_t fl_type_int128s_increase(f_int128s_t *int128s); -#endif // _di_fl_type_int128s_increase_ - -/** - * Increase the size of int128s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int128s - * The int128s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int128s_increase_by_ - extern f_status_t fl_type_int128s_increase_by(const f_array_length_t amount, f_int128s_t *int128s); -#endif // _di_fl_type_int128s_increase_by_ - -/** - * Delete the int128ss array. - * - * @param int128ss - * The int128ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_int128ss_t_delete_simple() - */ -#ifndef _di_fl_type_int128ss_delete_ - extern f_status_t fl_type_int128ss_delete(f_int128ss_t *int128ss); -#endif // _di_fl_type_int128ss_delete_ - -/** - * Increase the size of int128s array, but only if necessary. - * - * @param int128s - * The int128s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int128ss_increase_ - extern f_status_t fl_type_int128ss_increase(f_int128ss_t *int128ss); -#endif // _di_fl_type_int128ss_increase_ - -/** - * Increase the size of int128ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param int128ss - * The int128ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_int128ss_increase_by_ - extern f_status_t fl_type_int128ss_increase_by(const f_array_length_t amount, f_int128ss_t *int128ss); -#endif // _di_fl_type_int128ss_increase_by_ - -/** - * Delete the uint128s array. - * - * @param uint128s - * The uint128s array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint128s_t_delete_simple() - */ -#ifndef _di_fl_type_uint128s_delete_ - extern f_status_t fl_type_uint128s_delete(f_uint128s_t *uint128s); -#endif // _di_fl_type_uint128s_delete_ - -/** - * Increase the size of uint128s array, but only if necessary. - * - * @param uint128s - * The uint128s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint128s_increase_ - extern f_status_t fl_type_uint128s_increase(f_uint128s_t *uint128s); -#endif // _di_fl_type_uint128s_increase_ - -/** - * Increase the size of uint128s array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint128s - * The uint128s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint128s_increase_by_ - extern f_status_t fl_type_uint128s_increase_by(const f_array_length_t amount, f_uint128s_t *uint128s); -#endif // _di_fl_type_uint128s_increase_by_ - -/** - * Delete the uint128ss array. - * - * @param uint128ss - * The uint128ss array to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_macro_uint128ss_t_delete_simple() - */ -#ifndef _di_fl_type_uint128ss_delete_ - extern f_status_t fl_type_uint128ss_delete(f_uint128ss_t *uint128ss); -#endif // _di_fl_type_uint128ss_delete_ - -/** - * Increase the size of uint128s array, but only if necessary. - * - * @param uint128s - * The uint128s array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint128ss_increase_ - extern f_status_t fl_type_uint128ss_increase(f_uint128ss_t *uint128ss); -#endif // _di_fl_type_uint128ss_increase_ - -/** - * Increase the size of uint128ss array by the given amount, but only if necessary. - * - * @param amount - * The amount to increase by. - * @param uint128ss - * The uint128ss array to increase. - * - * @return - * F_none on success. - * F_array_too_large (with error bit) if new length is larger than max array length. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_type_uint128ss_increase_by_ - extern f_status_t fl_type_uint128ss_increase_by(const f_array_length_t amount, f_uint128ss_t *uint128ss); -#endif // _di_fl_type_uint128ss_increase_by_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _FL_type_h diff --git a/level_1/fl_utf/c/private-utf.c b/level_1/fl_utf/c/private-utf.c index dd135f0..11f6fe2 100644 --- a/level_1/fl_utf/c/private-utf.c +++ b/level_1/fl_utf/c/private-utf.c @@ -15,7 +15,7 @@ extern "C" { const f_utf_string_length_t total = destination->used + length; if (total > destination->size) { - f_macro_string_dynamic_t_resize(status, (*destination), total); + f_macro_utf_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -48,7 +48,7 @@ extern "C" { f_utf_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_t_resize(status, (*destination), total); + f_macro_utf_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -71,7 +71,7 @@ extern "C" { f_utf_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_t_resize(status, (*destination), total); + f_macro_utf_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -262,7 +262,7 @@ extern "C" { const f_utf_string_length_t total = destination->used + length; if (total > destination->size) { - f_macro_string_dynamic_t_resize(status, (*destination), total); + f_macro_utf_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -304,7 +304,7 @@ extern "C" { const f_utf_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_t_resize(status, (*destination), total); + f_macro_utf_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -330,7 +330,7 @@ extern "C" { const f_utf_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_t_resize(status, (*destination), total); + f_macro_utf_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } diff --git a/level_1/fl_utf/c/utf.c b/level_1/fl_utf/c/utf.c index a6c240e..8e8d425 100644 --- a/level_1/fl_utf/c/utf.c +++ b/level_1/fl_utf/c/utf.c @@ -983,7 +983,7 @@ extern "C" { if (total > destination->size) { f_status_t status = F_none; - f_macro_string_dynamic_t_resize(status, (*destination), total); + f_macro_utf_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -1017,7 +1017,7 @@ extern "C" { if (total > destination->size) { f_status_t status = F_none; - f_macro_string_dynamic_t_resize(status, (*destination), total); + f_macro_utf_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } diff --git a/level_1/fl_utf_file/c/utf_file.c b/level_1/fl_utf_file/c/utf_file.c index 68bfc3e..187ce73 100644 --- a/level_1/fl_utf_file/c/utf_file.c +++ b/level_1/fl_utf_file/c/utf_file.c @@ -33,7 +33,7 @@ extern "C" { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); + f_macro_utf_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } @@ -93,7 +93,7 @@ extern "C" { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); + f_macro_utf_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } @@ -161,7 +161,7 @@ extern "C" { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); + f_macro_utf_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } diff --git a/level_2/fll_error/data/build/settings b/level_2/fll_error/data/build/settings index b75bc8f..27eff0b 100644 --- a/level_2/fll_error/data/build/settings +++ b/level_2/fll_error/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lf_color -lf_console -lf_file -lf_memory -lf_print -lf_string -lf_utf +build_libraries-individual -lf_color -lf_console -lf_file -lf_memory -lf_print -lf_string -lf_type_array -lf_utf build_sources_library error.c error-common.c private-error.c build_sources_program build_sources_headers error.h error-common.h diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 1782b6d..ba960bb 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -204,18 +204,10 @@ extern "C" { status = fl_environment_path_explode_dynamic(path, &paths); } - if (F_status_is_error(status)) { - f_string_dynamic_delete(&path); - f_string_dynamics_delete(&paths); - - return status; - } - - status = f_string_dynamic_delete(&path); + f_macro_string_dynamic_t_delete_simple(path); if (F_status_is_error(status)) { f_macro_string_dynamics_t_delete_simple(paths); - return status; } @@ -254,14 +246,14 @@ extern "C" { } if (F_status_is_error(status)) { - f_string_dynamics_delete(&paths); + f_macro_string_dynamics_t_delete_simple(paths); return status; } } // for if (!found) { - f_string_dynamics_delete(&paths); + f_macro_string_dynamics_t_delete_simple(paths); return F_status_set_error(F_file_found_not); } @@ -270,7 +262,7 @@ extern "C" { memcpy(&program_path, found->string, found->used); - status = f_string_dynamics_delete(&paths); + status = f_macro_string_dynamics_t_delete_simple(paths); if (F_status_is_error(status)) return status; if (parameter && parameter->data) { diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index 78a3067..7b98241 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -17,7 +17,7 @@ extern "C" { status = f_string_append(source, length, &argument); if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } } @@ -25,7 +25,7 @@ extern "C" { status = f_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } @@ -50,7 +50,7 @@ extern "C" { status = f_string_append(prefix, prefix_length, &argument); if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_string_dynamic_resize(0, &argument); return status; } @@ -60,7 +60,7 @@ extern "C" { status = f_string_append(name, name_length, &argument); if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_string_dynamic_resize(0, &argument); return status; } @@ -69,15 +69,14 @@ extern "C" { status = f_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_string_dynamic_resize(0, &argument); return status; } arguments->array[arguments->used].string = argument.string; arguments->array[arguments->used].used = argument.used; - arguments->array[arguments->used].size = argument.size; - arguments->used++; + arguments->array[arguments->used++].size = argument.size; f_macro_string_dynamic_t_clear(argument); @@ -85,7 +84,7 @@ extern "C" { status = f_string_append(value, value_length, &argument); if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } @@ -94,7 +93,7 @@ extern "C" { status = f_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } @@ -102,15 +101,14 @@ extern "C" { status = f_string_dynamics_increase(arguments); if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_string_dynamic_resize(0, &argument); return status; } arguments->array[arguments->used].string = argument.string; arguments->array[arguments->used].used = argument.used; - arguments->array[arguments->used].size = argument.size; - arguments->used++; + arguments->array[arguments->used++].size = argument.size; return F_none; } diff --git a/level_2/fll_execute/data/build/settings b/level_2/fll_execute/data/build/settings index 9dbb962..e915a46 100644 --- a/level_2/fll_execute/data/build/settings +++ b/level_2/fll_execute/data/build/settings @@ -19,8 +19,8 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -lcap -build_libraries-individual -lfl_control_group -lfl_environment -lf_account -lf_capability -lf_control_group -lf_environment -lf_file -lf_limit -lf_memory -lf_path -lf_signal -lf_string -lf_thread -lf_utf -build_libraries-individual_threadless -lfl_control_group -lfl_environment -lf_account -lf_capability -lf_control_group -lf_environment -lf_file -lf_limit -lf_memory -lf_path -lf_signal -lf_string -lf_utf +build_libraries-individual -lfl_control_group -lfl_environment -lf_account -lf_capability -lf_control_group -lf_environment -lf_file -lf_limit -lf_memory -lf_path -lf_signal -lf_string -lf_thread -lf_type_array -lf_utf +build_libraries-individual_threadless -lfl_control_group -lfl_environment -lf_account -lf_capability -lf_control_group -lf_environment -lf_file -lf_limit -lf_memory -lf_path -lf_signal -lf_string -lf_type_array -lf_utf build_sources_library execute.c private-execute.c build_sources_program build_sources_headers execute.h diff --git a/level_2/fll_fss/c/fss.c b/level_2/fll_fss/c/fss.c index 3a39465..3700499 100644 --- a/level_2/fll_fss/c/fss.c +++ b/level_2/fll_fss/c/fss.c @@ -205,7 +205,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_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -217,14 +217,14 @@ extern "C" { status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used); if (F_status_is_error(status)) { - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } if (status == F_equal_to) { matched = F_true; - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); break; } } // for @@ -237,14 +237,14 @@ extern "C" { if (values[j]->used == values[j]->size) { if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { if (values[j]->used == f_array_length_t_size) { - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return F_status_set_error(F_array_too_large); } f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) { - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -257,7 +257,7 @@ extern "C" { f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -274,7 +274,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_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } } @@ -294,7 +294,7 @@ extern "C" { } // for } // for - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return F_none; } #endif // _di_fll_fss_snatch_map_ @@ -332,30 +332,11 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_equal_to_not) continue; - if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { - if (values[j]->used == f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + 1); - if (F_status_is_error(status)) return status; - - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); - if (F_status_is_error(status)) return status; - } - } - else { - f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; + status = f_string_map_multis_increase(values[j]); + if (F_status_is_error(status)) return status; - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; - } - } - } + f_macro_array_lengths_t_increase(status, (*indexs[j])); + if (F_status_is_error(status)) return status; map_multi = &values[j]->array[values[j]->used]; @@ -370,12 +351,8 @@ extern "C" { } if (contents.array[i].used > 1) { - if (map_multi->value.used + contents.array[i].used - 1 > map_multi->value.size) { - if (map_multi->value.used + contents.array[i].used - 1 > f_array_length_t_size) return F_status_set_error(F_array_too_large); - - f_macro_string_dynamics_t_resize(status, map_multi->value, map_multi->value.used + contents.array[i].used - 1); - if (F_status_is_error(status)) return status; - } + status = f_string_dynamics_increase_by(contents.array[i].used - 1, &map_multi->value); + if (F_status_is_error(status)) return status; for (k = 1; k < contents.array[i].used; k++) { @@ -425,30 +402,11 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_equal_to_not) continue; - if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { - if (values[j]->used == f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1); - if (F_status_is_error(status)) return status; - - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); - if (F_status_is_error(status)) return status; - } - } - else { - f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; + status = f_string_maps_increase(values[j]); + if (F_status_is_error(status)) return status; - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; - } - } - } + f_macro_array_lengths_t_increase(status, (*indexs[j])); + if (F_status_is_error(status)) return status; map = &values[j]->array[values[j]->used]; @@ -514,7 +472,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_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -526,7 +484,7 @@ extern "C" { status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used); if (F_status_is_error(status)) { - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -544,30 +502,11 @@ extern "C" { map_multi = &values[j]->array[k]; } else { - if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { - if (values[j]->used == f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + 1); - if (F_status_is_error(status)) return status; - - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); - if (F_status_is_error(status)) return status; - } - } - else { - f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; + status = f_string_map_multis_increase(values[j]); + if (F_status_is_error(status)) return status; - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; - } - } - } + f_macro_array_lengths_t_increase(status, (*indexs[j])); + if (F_status_is_error(status)) return status; map_multi = &values[j]->array[values[j]->used]; map_multi->name.string = name.string; @@ -586,14 +525,8 @@ extern "C" { if (contents.array[i].used == 1) continue; } - if (map_multi->value.used == map_multi->value.size) { - if (map_multi->value.used == f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - f_macro_string_dynamics_t_resize(status, map_multi->value, map_multi->value.used + 1); - if (F_status_is_error(status)) return status; - } + status = f_string_dynamics_increase(&map_multi->value); + if (F_status_is_error(status)) return status; for (k = 1; k < contents.array[i].used; k++) { @@ -605,7 +538,7 @@ extern "C" { } // for } // for - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return F_none; } #endif // _di_fll_fss_snatch_map_mash_apart_ @@ -649,7 +582,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_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -661,14 +594,14 @@ extern "C" { status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used); if (F_status_is_error(status)) { - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } if (status == F_equal_to) { matched = F_true; - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); break; } } // for @@ -679,39 +612,11 @@ extern "C" { map = &values[j]->array[k]; } else { - if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { - if (values[j]->used == f_array_length_t_size) { - f_string_dynamic_delete(&name); - return F_status_set_error(F_array_too_large); - } - - f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1); - - if (F_status_is_error(status)) { - f_string_dynamic_delete(&name); - return status; - } - - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); - if (F_status_is_error(status)) return status; - } - } - else { - f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); - - if (F_status_is_error(status)) { - f_string_dynamic_delete(&name); - return status; - } - - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; - } - } - } + status = f_string_maps_increase(values[j]); + if (F_status_is_error(status)) return status; + + f_macro_array_lengths_t_increase(status, (*indexs[j])); + if (F_status_is_error(status)) return status; map = &values[j]->array[values[j]->used]; @@ -733,14 +638,14 @@ extern "C" { status = f_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[1], &map->value); if (F_status_is_error(status)) { - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } } } // for } // for - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return F_none; } #endif // _di_fll_fss_snatch_map_together_ @@ -828,30 +733,11 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_equal_to_not) continue; - if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { - if (values[j]->used == f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - f_macro_string_dynamics_t_resize(status, (*values[j]), values[j]->used + 1); - if (F_status_is_error(status)) return status; - - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); - if (F_status_is_error(status)) return status; - } - } - else { - f_macro_string_dynamics_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; + status = f_string_dynamics_increase(values[j]); + if (F_status_is_error(status)) return status; - if (indexs) { - f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); - if (F_status_is_error(status)) return status; - } - } - } + f_macro_array_lengths_t_increase(status, (*indexs[j])); + if (F_status_is_error(status)) return status; for (k = 0; k < contents.array[i].used; k++) { diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index 770fa2a..db6a969 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -23,14 +23,14 @@ extern "C" { do { if (objects->used == objects->size) { - f_macro_fss_objects_t_resize(status2, (*objects), objects->used + f_fss_default_allocation_step); + f_macro_fss_objects_t_increase(status2, (*objects)) if (F_status_is_error(status2)) return status2; - f_macro_fss_contents_t_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); + f_macro_fss_contents_t_increase(status2, (*contents)) if (F_status_is_error(status2)) return status2; if (objects_quoted) { - f_macro_fss_quotes_t_resize(status2, (*objects_quoted), objects_quoted->used + f_fss_default_allocation_step); + f_macro_fss_quotes_t_increase(status2, (*objects_quoted)) if (F_status_is_error(status2)) return status2; } } @@ -41,10 +41,7 @@ extern "C" { } status = fl_fss_basic_object_read(buffer, range, &objects->array[objects->used], quoted_object, objects_delimits); - - if (F_status_is_error(status)) { - return status; - } + if (F_status_is_error(status)) return status; if (range->start >= range->stop || range->start >= buffer.used) { if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { @@ -55,7 +52,7 @@ extern "C" { } if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_increase(status2, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; } @@ -92,7 +89,7 @@ extern "C" { found_data = F_true; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_increase(status2, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; } @@ -178,10 +175,8 @@ extern "C" { if (F_status_is_error(status)) return status; } else { - if (destination->used + 1 > destination->size) { - status = f_string_dynamic_increase_by(f_fss_default_allocation_step, destination); - if (F_status_is_error(status)) return status; - } + status = f_string_dynamic_increase(destination); + if (F_status_is_error(status)) return status; destination->string[destination->used++] = f_string_eol_s[0]; } diff --git a/level_2/fll_fss/c/fss_basic_list.c b/level_2/fll_fss/c/fss_basic_list.c index a72026f..93f4ae6 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -37,7 +37,7 @@ extern "C" { objects->used++; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_delimits_t_increase(status2, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; } @@ -74,7 +74,7 @@ extern "C" { found_data = F_true; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_increase(status2, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; } diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index feb9fef..1c239eb 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -61,7 +61,7 @@ extern "C" { } if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_increase(status2, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; } @@ -109,7 +109,7 @@ extern "C" { found_data = F_true; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_increase(status2, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; } diff --git a/level_2/fll_fss/c/fss_extended_list.c b/level_2/fll_fss/c/fss_extended_list.c index 3b21093..90342c3 100644 --- a/level_2/fll_fss/c/fss_extended_list.c +++ b/level_2/fll_fss/c/fss_extended_list.c @@ -37,7 +37,7 @@ extern "C" { objects->used++; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_increase(status2, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; } @@ -74,7 +74,7 @@ extern "C" { found_data = F_true; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_increase(status2, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; } diff --git a/level_2/fll_fss/data/build/settings b/level_2/fll_fss/data/build/settings index 4dc367c..1cdcbae 100644 --- a/level_2/fll_fss/data/build/settings +++ b/level_2/fll_fss/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfl_conversion -lfl_fss -lfl_status -lfl_string -lf_conversion -lf_file -lf_fss -lf_memory -lf_string -lf_utf +build_libraries-individual -lfl_conversion -lfl_fss -lfl_status -lfl_string -lf_conversion -lf_file -lf_fss -lf_memory -lf_string -lf_type_array -lf_utf build_sources_library fss.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c fss_status.c build_sources_program build_sources_headers fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h fss_status.h diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index 4f86b8a..5f63c0a 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -272,7 +272,7 @@ extern "C" { status = fl_string_rip(argv[values.array[i]], length, &ripped); if (F_status_is_error(status)) { - f_string_dynamic_delete(&ripped); + f_macro_string_dynamic_t_delete_simple(ripped); return status; } @@ -280,7 +280,7 @@ extern "C" { status = f_string_dynamic_mash(glue, glue_length, ripped, destination); if (F_status_is_error(status)) { - f_string_dynamic_delete(&ripped); + f_macro_string_dynamic_t_delete_simple(ripped) return F_status_set_error(F_string_too_large); } } @@ -288,7 +288,7 @@ extern "C" { } // for if (ripped.size) { - status = f_string_dynamic_delete(&ripped); + f_macro_string_dynamic_t_delete_simple(ripped) } if (status == F_none && start == destination->used) { diff --git a/level_2/fll_program/data/build/settings b/level_2/fll_program/data/build/settings index a202e24..7bf54a1 100644 --- a/level_2/fll_program/data/build/settings +++ b/level_2/fll_program/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfl_color -lfl_string -lf_color -lf_console -lf_file -lf_memory -lf_print -lf_string -lf_utf +build_libraries-individual -lfl_color -lfl_string -lf_color -lf_console -lf_file -lf_memory -lf_print -lf_string -lf_type_array -lf_utf build_sources_library program.c build_sources_program build_sources_headers program.h diff --git a/level_3/byte_dump/data/build/settings b/level_3/byte_dump/data/build/settings index a02e030..d827471 100644 --- a/level_3/byte_dump/data/build/settings +++ b/level_3/byte_dump/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_string -lfl_utf -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_string -lfl_utf -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library byte_dump.c private-byte_dump.c diff --git a/level_3/control/data/build/settings b/level_3/control/data/build/settings index 3c9a12a..cf9682f 100644 --- a/level_3/control/data/build/settings +++ b/level_3/control/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_program -lfll_status -lfl_color -lfl_console -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_program -lfll_status -lfl_color -lfl_console -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library control.c private-control.c diff --git a/level_3/controller/c/private-common.h b/level_3/controller/c/private-common.h index c5a2047..53fa17a 100644 --- a/level_3/controller/c/private-common.h +++ b/level_3/controller/c/private-common.h @@ -342,7 +342,7 @@ extern "C" { } #define controller_macro_rule_action_t_delete_simple(action) \ - f_string_dynamics_delete(&action.parameters); + f_macro_string_dynamics_t_delete_simple(action.parameters); #endif // _di_controller_rule_action_t_ #ifndef _di_controller_rule_actions_t_ @@ -525,21 +525,21 @@ extern "C" { } #define controller_macro_rule_t_delete_simple(rule) \ - f_string_dynamic_delete(&rule.id); \ - f_string_dynamic_delete(&rule.name); \ - f_string_dynamic_delete(&rule.path); \ - f_string_dynamic_delete(&rule.script); \ + f_macro_string_dynamic_t_delete_simple(rule.id) \ + f_macro_string_dynamic_t_delete_simple(rule.name) \ + f_macro_string_dynamic_t_delete_simple(rule.path) \ + f_macro_string_dynamic_t_delete_simple(rule.script) \ f_macro_string_maps_t_delete_simple(rule.define) \ f_macro_string_maps_t_delete_simple(rule.parameter) \ - f_string_dynamics_delete(&rule.environment); \ - f_string_dynamics_delete(&rule.need); \ - f_string_dynamics_delete(&rule.want); \ - f_string_dynamics_delete(&rule.wish); \ - fl_type_int32s_delete(&rule.affinity); \ + f_macro_string_dynamics_t_delete_simple(rule.environment) \ + f_macro_string_dynamics_t_delete_simple(rule.need) \ + f_macro_string_dynamics_t_delete_simple(rule.want) \ + f_macro_string_dynamics_t_delete_simple(rule.wish) \ + f_macro_int32s_t_delete_simple(rule.affinity) \ f_capability_delete(&rule.capability); \ - fl_control_group_delete(&rule.control_group); \ - fl_type_int32s_delete(&rule.groups); \ - f_macro_limit_sets_t_delete_simple(rule.limits); \ + f_macro_control_group_t_delete_simple(rule.control_group) \ + f_macro_int32s_t_delete_simple(rule.groups) \ + f_macro_limit_sets_t_delete_simple(rule.limits) \ controller_macro_rule_items_t_delete_simple(rule.items) #endif // _di_controller_rule_t_ @@ -609,7 +609,7 @@ extern "C" { } #define controller_macro_entry_action_t_delete_simple(action) \ - f_string_dynamics_delete(&action.parameters); + f_macro_string_dynamics_t_delete_simple(action.parameters); #endif // _di_controller_entry_action_t_ #ifndef _di_controller_entry_actions_t_ @@ -633,7 +633,7 @@ extern "C" { actions.used--; \ controller_macro_entry_action_t_delete_simple(actions.array[actions.used]); \ } \ - f_memory_delete((void **) & actions.array, sizeof(controller_entry_action_t), actions.size); \ + f_memory_resize((void **) & actions.array, sizeof(controller_entry_action_t), actions.size, 0); \ actions.size = 0; #endif // _di_controller_entry_actions_t_ @@ -653,7 +653,7 @@ extern "C" { } #define controller_macro_entry_item_t_delete_simple(item) \ - f_string_dynamic_delete(&item.name); \ + f_macro_string_dynamic_t_delete_simple(item.name); \ controller_macro_entry_actions_t_delete_simple(item.actions) #endif // _di_controller_entry_item_t_ @@ -746,9 +746,9 @@ extern "C" { } #define controller_macro_setting_t_delete_simple(setting) \ - f_string_dynamic_delete(&setting.path_control); \ - f_string_dynamic_delete(&setting.path_pid); \ - f_string_dynamic_delete(&setting.path_setting); \ + f_macro_string_dynamic_t_delete_simple(setting.path_control) \ + f_macro_string_dynamic_t_delete_simple(setting.path_pid) \ + f_macro_string_dynamic_t_delete_simple(setting.path_setting) \ controller_macro_entry_t_delete_simple(setting.entry) \ controller_macro_rules_t_delete_simple(setting.rules) #endif // _di_controller_setting_t @@ -809,8 +809,8 @@ extern "C" { } #define controller_macro_cache_t_delete_simple(cache) \ - fl_type_array_lengths_delete(&cache.ats); \ - fl_type_array_lengths_delete(&cache.stack); \ + f_macro_array_lengths_t_delete_simple(cache.ats) \ + f_macro_array_lengths_t_delete_simple(cache.stack) \ f_macro_fss_comments_t_delete_simple(cache.comments) \ f_macro_fss_delimits_t_delete_simple(cache.delimits) \ f_macro_fss_content_t_delete_simple(cache.content_action) \ @@ -818,13 +818,13 @@ extern "C" { f_macro_fss_contents_t_delete_simple(cache.content_items) \ f_macro_fss_objects_t_delete_simple(cache.object_actions) \ f_macro_fss_objects_t_delete_simple(cache.object_items) \ - f_string_dynamic_delete(&cache.buffer_file); \ - f_string_dynamic_delete(&cache.buffer_item); \ - f_string_dynamic_delete(&cache.buffer_other); \ - f_string_dynamic_delete(&cache.buffer_path); \ - f_string_dynamic_delete(&cache.name_action); \ - f_string_dynamic_delete(&cache.name_file); \ - f_string_dynamic_delete(&cache.name_item); + f_macro_string_dynamic_t_delete_simple(cache.buffer_file) \ + f_macro_string_dynamic_t_delete_simple(cache.buffer_item) \ + f_macro_string_dynamic_t_delete_simple(cache.buffer_other) \ + f_macro_string_dynamic_t_delete_simple(cache.buffer_path) \ + f_macro_string_dynamic_t_delete_simple(cache.name_action) \ + f_macro_string_dynamic_t_delete_simple(cache.name_file) \ + f_macro_string_dynamic_t_delete_simple(cache.name_item) #endif // _di_controller_cache_t_ #ifdef __cplusplus diff --git a/level_3/controller/c/private-controller.c b/level_3/controller/c/private-controller.c index a0f2924..d058d40 100644 --- a/level_3/controller/c/private-controller.c +++ b/level_3/controller/c/private-controller.c @@ -144,7 +144,7 @@ extern "C" { status = f_directory_exists(path_directory.string); } - f_string_dynamic_delete(&path_directory); + f_macro_string_dynamic_t_delete_simple(path_directory) if (F_status_is_error(status)) return status; @@ -214,7 +214,7 @@ extern "C" { } } - f_string_dynamic_delete(&pid_buffer); + f_macro_string_dynamic_t_delete_simple(pid_buffer); } #endif // _di_controller_file_pid_delete_ @@ -358,10 +358,10 @@ extern "C" { cache->name_action.used = 0; cache->name_item.used = 0; - status = fl_type_array_lengths_increase_by(controller_default_allocation_step, &cache->ats); + f_macro_array_lengths_t_increase_by(status, cache->ats, controller_default_allocation_step) if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_type_array_lengths_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true); return status; } @@ -452,10 +452,10 @@ extern "C" { if (error_has) break; - status2 = fl_type_array_lengths_increase_by(controller_default_allocation_step, &cache->ats); + f_macro_array_lengths_t_increase_by(status2, cache->ats, controller_default_allocation_step) if (F_status_is_error(status2)) { - fll_error_print(data.error, F_status_set_fine(status2), "fl_type_array_lengths_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status2), "f_macro_array_lengths_t_increase_by", F_true); controller_entry_error_print(data.error, *cache); return status2; @@ -581,10 +581,10 @@ extern "C" { if (F_status_is_error(status)) return status; } - status = fl_type_array_lengths_increase_by(controller_default_allocation_step, &cache->ats); + f_macro_array_lengths_t_increase_by(status, cache->ats, controller_default_allocation_step) if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_type_array_lengths_increase_by", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true); controller_entry_error_print(data->error, *cache); return status; @@ -769,10 +769,10 @@ extern "C" { return F_status_is_error(F_critical); } - status = fl_type_array_lengths_increase_by(controller_default_allocation_step, &cache->ats); + f_macro_array_lengths_t_increase_by(status, cache->ats, controller_default_allocation_step) if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_type_array_lengths_increase_by", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true); controller_entry_error_print(data->error, *cache); return status; diff --git a/level_3/controller/c/private-controller.h b/level_3/controller/c/private-controller.h index dcafc68..62e5e2b 100644 --- a/level_3/controller/c/private-controller.h +++ b/level_3/controller/c/private-controller.h @@ -250,16 +250,16 @@ extern "C" { * F_recurse (with error bit) on a recursion error. * F_valid_not (with error bit) on invalid entry item, entry item action, or entry item action value. * + * Errors (with error bit) from: f_macro_array_lengths_t_increase_by(). * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_terminate_after(). - * Errors (with error bit) from: fl_type_array_lengths_increase_by(). * * This will detect and report all errors, but only the first error is returned. * Memory related errors return immediately. - * + + * @see f_macro_array_lengths_t_increase_by() * @see f_string_dynamic_append() * @see f_string_dynamic_terminate_after() - * @see fl_type_array_lengths_increase_by() */ #ifndef _di_controller_preprocess_entry_ extern f_status_t controller_preprocess_entry(const controller_data_t data, controller_setting_t *setting, controller_cache_t *cache) f_gcc_attribute_visibility_internal; @@ -279,13 +279,13 @@ extern "C" { * F_none on success. * F_critical (with error bit) on any critical error. * + * Errors (with error bit) from: f_macro_array_lengths_t_increase_by(). * Errors (with error bit) from: controller_perform_ready(). * Errors (with error bit) from: controller_string_dynamic_append_terminated(). - * Errors (with error bit) from: fl_type_array_lengths_increase_by(). * + * @see f_macro_array_lengths_t_increase_by() * @see controller_perform_ready() * @see controller_string_dynamic_append_terminated() - * @see fl_type_array_lengths_increase_by() */ #ifndef _di_controller_process_entry_ extern f_status_t controller_process_entry(controller_data_t *data, controller_setting_t *setting, controller_cache_t *cache) f_gcc_attribute_visibility_internal; diff --git a/level_3/controller/c/private-entry.c b/level_3/controller/c/private-entry.c index 8bc1fa7..d7442e5 100644 --- a/level_3/controller/c/private-entry.c +++ b/level_3/controller/c/private-entry.c @@ -85,7 +85,7 @@ extern "C" { return status; } - return F_none; + return F_data_not; } #endif // _di_controller_entry_actions_increase_by_ @@ -588,7 +588,7 @@ extern "C" { return status; } - return F_none; + return F_data_not; } #endif // _di_controller_entry_items_increase_by_ diff --git a/level_3/controller/c/private-rule.c b/level_3/controller/c/private-rule.c index a631205..5eca06a 100644 --- a/level_3/controller/c/private-rule.c +++ b/level_3/controller/c/private-rule.c @@ -174,7 +174,7 @@ extern "C" { return status; } - return F_none; + return F_data_not; } #endif // _di_controller_rule_actions_increase_by_ @@ -672,7 +672,7 @@ extern "C" { if (status == F_child || status == F_signal || F_status_is_error(status) && !simulate) break; } // for - f_string_maps_delete(&environment); + f_macro_string_maps_t_delete_simple(environment); if (status == F_child) { return status; @@ -1107,7 +1107,7 @@ extern "C" { return status; } - return F_none; + return F_data_not; } #endif // _di_controller_rule_items_increase_by_ @@ -1310,10 +1310,12 @@ extern "C" { return F_status_set_error(F_parameter); } - f_status_t status = fl_type_array_lengths_increase_by(controller_default_allocation_step, &cache->stack); + f_status_t status = F_none; + + f_macro_array_lengths_t_increase_by(status, cache->stack, controller_default_allocation_step) if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_type_array_lengths_increase_by", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true); controller_rule_error_print(data->error, *cache, F_true); return status; @@ -1441,10 +1443,10 @@ extern "C" { // when the status is unknown, then the rule has not been executed, so attempt to execute it. if (setting->rules.array[at].status == F_known_not) { - status = fl_type_array_lengths_increase_by(controller_default_allocation_step, &cache->stack); + f_macro_array_lengths_t_increase_by(status, cache->stack, controller_default_allocation_step) if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_type_array_lengths_increase_by", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true); controller_rule_error_print(data->error, *cache, F_true); // always exit on memory errors, even in simulate mode. @@ -3145,10 +3147,10 @@ extern "C" { for (j = 0; j < cache->content_actions.array[i].used; ++j) { - status = fl_type_int32s_increase(&rule->groups); + f_macro_array_lengths_t_increase_by(status, rule->groups, controller_default_allocation_step) if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_type_int32s_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true); if (F_status_set_fine(status) == F_memory_not) { status_return = status; diff --git a/level_3/controller/data/build/dependencies b/level_3/controller/data/build/dependencies index c0bd26a..795b0d9 100644 --- a/level_3/controller/data/build/dependencies +++ b/level_3/controller/data/build/dependencies @@ -3,6 +3,7 @@ f_type f_status f_memory +f_type_array f_string f_utf f_account @@ -30,7 +31,6 @@ fl_environment fl_fss fl_iki fl_string -fl_type fll_control_group fll_error fll_execute diff --git a/level_3/controller/data/build/settings b/level_3/controller/data/build/settings index 8dc69ed..c62035e 100644 --- a/level_3/controller/data/build/settings +++ b/level_3/controller/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -lcap -build_libraries-individual -lfll_control_group -lfll_error -lfll_execute -lfll_fss -lfll_path -lfll_program -lfll_status -lfl_color -lfl_console -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_status -lfl_string -lfl_type -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_string -lf_thread -lf_utf +build_libraries-individual -lfll_control_group -lfll_error -lfll_execute -lfll_fss -lfll_path -lfll_program -lfll_status -lfl_color -lfl_console -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_status -lfl_string -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_string -lf_thread -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library controller.c private-control.c private-controller.c private-entry.c private-rule.c diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 642f972..388f266 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -387,60 +387,60 @@ extern "C" { f_macro_string_lengths_t_delete_simple(data->remaining); - f_string_dynamics_delete(&data->define); - f_string_dynamic_delete(&data->fakefile); - f_string_dynamics_delete(&data->mode); - f_string_dynamic_delete(&data->process); - f_string_dynamic_delete(&data->settings); - - f_string_dynamic_delete(&data->path_build); - f_string_dynamic_delete(&data->path_build_documents); - f_string_dynamic_delete(&data->path_build_includes); - f_string_dynamic_delete(&data->path_build_libraries); - f_string_dynamic_delete(&data->path_build_libraries_script); - f_string_dynamic_delete(&data->path_build_libraries_shared); - f_string_dynamic_delete(&data->path_build_libraries_static); - f_string_dynamic_delete(&data->path_build_objects); - f_string_dynamic_delete(&data->path_build_programs); - f_string_dynamic_delete(&data->path_build_programs_script); - f_string_dynamic_delete(&data->path_build_programs_shared); - f_string_dynamic_delete(&data->path_build_programs_static); - f_string_dynamic_delete(&data->path_build_settings); - f_string_dynamic_delete(&data->path_build_stage); - f_string_dynamic_delete(&data->path_work); - - f_string_dynamic_delete(&data->path_data); - f_string_dynamic_delete(&data->path_data_build); - - f_string_dynamic_delete(&data->path_data_settings); - - f_string_dynamic_delete(&data->path_documents); - - f_string_dynamic_delete(&data->path_licenses); - - f_string_dynamic_delete(&data->path_sources); - f_string_dynamic_delete(&data->path_sources_bash); - f_string_dynamic_delete(&data->path_sources_c); - f_string_dynamic_delete(&data->path_sources_cpp); - f_string_dynamic_delete(&data->path_sources_script); - - f_string_dynamic_delete(&data->path_work); - f_string_dynamic_delete(&data->path_work_includes); - f_string_dynamic_delete(&data->path_work_libraries); - f_string_dynamic_delete(&data->path_work_libraries_script); - f_string_dynamic_delete(&data->path_work_libraries_shared); - f_string_dynamic_delete(&data->path_work_libraries_static); - f_string_dynamic_delete(&data->path_work_programs); - f_string_dynamic_delete(&data->path_work_programs_script); - f_string_dynamic_delete(&data->path_work_programs_shared); - f_string_dynamic_delete(&data->path_work_programs_static); - - f_string_dynamic_delete(&data->file_data_build_defines); - f_string_dynamic_delete(&data->file_data_build_dependencies); - f_string_dynamic_delete(&data->file_data_build_fakefile); - f_string_dynamic_delete(&data->file_data_build_settings); - - f_string_dynamic_delete(&data->file_documents_readme); + f_macro_string_dynamics_t_delete_simple(data->define); + f_macro_string_dynamic_t_delete_simple(data->fakefile); + f_macro_string_dynamics_t_delete_simple(data->mode); + f_macro_string_dynamic_t_delete_simple(data->process); + f_macro_string_dynamic_t_delete_simple(data->settings); + + f_macro_string_dynamic_t_delete_simple(data->path_build); + f_macro_string_dynamic_t_delete_simple(data->path_build_documents); + f_macro_string_dynamic_t_delete_simple(data->path_build_includes); + f_macro_string_dynamic_t_delete_simple(data->path_build_libraries); + f_macro_string_dynamic_t_delete_simple(data->path_build_libraries_script); + f_macro_string_dynamic_t_delete_simple(data->path_build_libraries_shared); + f_macro_string_dynamic_t_delete_simple(data->path_build_libraries_static); + f_macro_string_dynamic_t_delete_simple(data->path_build_objects); + f_macro_string_dynamic_t_delete_simple(data->path_build_programs); + f_macro_string_dynamic_t_delete_simple(data->path_build_programs_script); + f_macro_string_dynamic_t_delete_simple(data->path_build_programs_shared); + f_macro_string_dynamic_t_delete_simple(data->path_build_programs_static); + f_macro_string_dynamic_t_delete_simple(data->path_build_settings); + f_macro_string_dynamic_t_delete_simple(data->path_build_stage); + f_macro_string_dynamic_t_delete_simple(data->path_work); + + f_macro_string_dynamic_t_delete_simple(data->path_data); + f_macro_string_dynamic_t_delete_simple(data->path_data_build); + + f_macro_string_dynamic_t_delete_simple(data->path_data_settings); + + f_macro_string_dynamic_t_delete_simple(data->path_documents); + + f_macro_string_dynamic_t_delete_simple(data->path_licenses); + + f_macro_string_dynamic_t_delete_simple(data->path_sources); + f_macro_string_dynamic_t_delete_simple(data->path_sources_bash); + f_macro_string_dynamic_t_delete_simple(data->path_sources_c); + f_macro_string_dynamic_t_delete_simple(data->path_sources_cpp); + f_macro_string_dynamic_t_delete_simple(data->path_sources_script); + + f_macro_string_dynamic_t_delete_simple(data->path_work); + f_macro_string_dynamic_t_delete_simple(data->path_work_includes); + f_macro_string_dynamic_t_delete_simple(data->path_work_libraries); + f_macro_string_dynamic_t_delete_simple(data->path_work_libraries_script); + f_macro_string_dynamic_t_delete_simple(data->path_work_libraries_shared); + f_macro_string_dynamic_t_delete_simple(data->path_work_libraries_static); + f_macro_string_dynamic_t_delete_simple(data->path_work_programs); + f_macro_string_dynamic_t_delete_simple(data->path_work_programs_script); + f_macro_string_dynamic_t_delete_simple(data->path_work_programs_shared); + f_macro_string_dynamic_t_delete_simple(data->path_work_programs_static); + + f_macro_string_dynamic_t_delete_simple(data->file_data_build_defines); + f_macro_string_dynamic_t_delete_simple(data->file_data_build_dependencies); + f_macro_string_dynamic_t_delete_simple(data->file_data_build_fakefile); + f_macro_string_dynamic_t_delete_simple(data->file_data_build_settings); + + f_macro_string_dynamic_t_delete_simple(data->file_documents_readme); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index 72ef847..d15f95e 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -51,9 +51,9 @@ // fll-0 includes #include -#include #include #include +#include #include #include #include diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index 7eecdcd..c994981 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -185,12 +185,12 @@ extern "C" { fprintf(data.output.stream, "%c", f_string_eol_s[0]); } - f_macro_string_dynamic_t_new(*status, path_source, source.used); + f_macro_string_dynamic_t_resize(*status, path_source, source.used); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "f_macro_string_dynamic_t_new", F_true); + fll_error_print(data.error, F_status_set_fine(*status), " f_macro_string_dynamic_t_resize", F_true); - f_string_dynamic_delete(&path_source); + f_macro_string_dynamic_t_delete_simple(path_source); return; } @@ -369,9 +369,9 @@ extern "C" { } // for f_macro_directory_statuss_t_delete_simple(failures); - f_string_dynamic_delete(&path_source); - f_string_dynamic_delete(&destination_file); - f_string_dynamic_delete(&destination_directory); + f_macro_string_dynamic_t_delete_simple(path_source); + f_macro_string_dynamic_t_delete_simple(destination_file); + f_macro_string_dynamic_t_delete_simple(destination_directory); if (F_status_is_error_not(*status)) { fake_build_touch(data, file_stage, status); @@ -516,7 +516,7 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } @@ -536,8 +536,8 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_mash", F_true); - f_string_dynamic_delete(&defines); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamic_t_delete_simple(defines); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } @@ -546,8 +546,8 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); - f_string_dynamic_delete(&defines); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamic_t_delete_simple(defines); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } } @@ -614,12 +614,12 @@ extern "C" { *status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_prefix_length, parameters_name, parameters_name_length, parameters_value, parameters_value_length, 7, &arguments); - f_string_dynamic_delete(&defines); + f_macro_string_dynamic_t_delete_simple(defines); if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "fll_execute_arguments_add_parameter_set", F_true); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } } @@ -646,8 +646,8 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), function, F_true); - f_string_dynamic_delete(&path); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamic_t_delete_simple(path); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } } @@ -657,8 +657,8 @@ extern "C" { if (fake_signal_received(data)) { *status = F_status_set_error(F_signal); - f_string_dynamic_delete(&path); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamic_t_delete_simple(path); + f_macro_string_dynamics_t_delete_simple(arguments); } else { // child processes should receive all signals, without blocking. @@ -670,7 +670,7 @@ extern "C" { *status = fll_execute_program(path.string, arguments, ¶meter, 0, &return_code); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); if (fake_signal_received(data)) { *status = F_status_set_error(F_signal); @@ -696,7 +696,7 @@ extern "C" { } } - f_string_dynamic_delete(&path); + f_macro_string_dynamic_t_delete_simple(path); return return_code; } @@ -793,7 +793,7 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } } @@ -932,7 +932,7 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } } @@ -940,7 +940,7 @@ extern "C" { { const int result = fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_error(*status)) { return 0; @@ -1189,9 +1189,9 @@ extern "C" { result = fake_execute(data, data_build.environment, data_build.setting.build_indexer, arguments, status); } - f_string_dynamic_delete(&file_name); - f_string_dynamic_delete(&source_path); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamic_t_delete_simple(file_name); + f_macro_string_dynamic_t_delete_simple(source_path); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_error_not(*status) && *status != F_child) { fake_build_touch(data, file_stage, status); @@ -1320,7 +1320,7 @@ extern "C" { f_macro_fss_delimits_t_delete_simple(delimits); } - f_string_dynamic_delete(&buffer); + f_macro_string_dynamic_t_delete_simple(buffer); f_macro_fss_objects_t_delete_simple(objects); f_macro_fss_contents_t_delete_simple(contents); } @@ -1599,10 +1599,10 @@ extern "C" { setting_mode_lengths[j] = settings_length[j] + 1 + modes->array[i].used; - f_macro_string_dynamic_t_new(*status, settings_mode_name_dynamic[j], setting_mode_lengths[j]); + f_macro_string_dynamic_t_resize(*status, settings_mode_name_dynamic[j], setting_mode_lengths[j]); if (F_status_is_error(*status)) { - function = "f_macro_string_dynamic_t_new"; + function = " f_macro_string_dynamic_t_resize"; break; } @@ -1622,7 +1622,7 @@ extern "C" { } for (j = 0; j < fake_build_setting_total; j++) { - f_string_dynamic_delete(&settings_mode_name_dynamic[j]); + f_macro_string_dynamic_t_delete_simple(settings_mode_name_dynamic[j]); } // for if (F_status_is_error(*status)) break; @@ -1985,33 +1985,33 @@ extern "C" { } // for } - f_string_dynamics_delete(&build_compiler); - f_string_dynamics_delete(&build_indexer); - f_string_dynamics_delete(&build_language); - f_string_dynamics_delete(&build_script); - f_string_dynamics_delete(&build_shared); - f_string_dynamics_delete(&build_static); - f_string_dynamics_delete(&path_headers); - f_string_dynamics_delete(&path_headers_preserve); - f_string_dynamics_delete(&path_language); - f_string_dynamics_delete(&path_library_script); - f_string_dynamics_delete(&path_library_shared); - f_string_dynamics_delete(&path_library_static); - f_string_dynamics_delete(&path_program_script); - f_string_dynamics_delete(&path_program_shared); - f_string_dynamics_delete(&path_program_static); - f_string_dynamics_delete(&path_sources); - f_string_dynamics_delete(&path_standard); - f_string_dynamics_delete(&process_post); - f_string_dynamics_delete(&process_pre); - f_string_dynamics_delete(&project_name); - f_string_dynamics_delete(&search_exclusive); - f_string_dynamics_delete(&search_shared); - f_string_dynamics_delete(&search_static); - f_string_dynamics_delete(&version_major); - f_string_dynamics_delete(&version_micro); - f_string_dynamics_delete(&version_minor); - f_string_dynamics_delete(&version_target); + f_macro_string_dynamics_t_delete_simple(build_compiler); + f_macro_string_dynamics_t_delete_simple(build_indexer); + f_macro_string_dynamics_t_delete_simple(build_language); + f_macro_string_dynamics_t_delete_simple(build_script); + f_macro_string_dynamics_t_delete_simple(build_shared); + f_macro_string_dynamics_t_delete_simple(build_static); + f_macro_string_dynamics_t_delete_simple(path_headers); + f_macro_string_dynamics_t_delete_simple(path_headers_preserve); + f_macro_string_dynamics_t_delete_simple(path_language); + f_macro_string_dynamics_t_delete_simple(path_library_script); + f_macro_string_dynamics_t_delete_simple(path_library_shared); + f_macro_string_dynamics_t_delete_simple(path_library_static); + f_macro_string_dynamics_t_delete_simple(path_program_script); + f_macro_string_dynamics_t_delete_simple(path_program_shared); + f_macro_string_dynamics_t_delete_simple(path_program_static); + f_macro_string_dynamics_t_delete_simple(path_sources); + f_macro_string_dynamics_t_delete_simple(path_standard); + f_macro_string_dynamics_t_delete_simple(process_post); + f_macro_string_dynamics_t_delete_simple(process_pre); + f_macro_string_dynamics_t_delete_simple(project_name); + f_macro_string_dynamics_t_delete_simple(search_exclusive); + f_macro_string_dynamics_t_delete_simple(search_shared); + f_macro_string_dynamics_t_delete_simple(search_static); + f_macro_string_dynamics_t_delete_simple(version_major); + f_macro_string_dynamics_t_delete_simple(version_micro); + f_macro_string_dynamics_t_delete_simple(version_minor); + f_macro_string_dynamics_t_delete_simple(version_target); } #endif // _di_fake_build_load_setting_process_ @@ -2309,7 +2309,7 @@ extern "C" { } } // for - f_string_dynamic_delete(&settings_file_base); + f_macro_string_dynamic_t_delete_simple(settings_file_base); } #endif // _di_fake_build_load_stage_ @@ -2496,14 +2496,14 @@ extern "C" { result = fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_error(*status) || *status == F_child) break; } // for - f_string_dynamic_delete(&file_name); - f_string_dynamic_delete(&destination_path); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamic_t_delete_simple(file_name); + f_macro_string_dynamic_t_delete_simple(destination_path); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_error_not(*status) && *status != F_child) { fake_build_touch(data, file_stage, status); @@ -2741,13 +2741,13 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } int result = fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_error_not(*status) && *status != F_child) { fake_build_touch(data, file_stage, status); @@ -2859,13 +2859,13 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return 0; } int result = fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_error_not(*status) && *status != F_child) { fake_build_touch(data, file_stage, status); diff --git a/level_3/fake/c/private-build.h b/level_3/fake/c/private-build.h index 2527a76..e13d7e8 100644 --- a/level_3/fake/c/private-build.h +++ b/level_3/fake/c/private-build.h @@ -114,40 +114,40 @@ extern "C" { } #define fake_macro_build_setting_t_delete_simple(setting) \ - f_string_dynamic_delete(&setting.build_compiler); \ - f_string_dynamic_delete(&setting.build_indexer); \ - f_string_dynamic_delete(&setting.path_headers); \ - f_string_dynamic_delete(&setting.path_language); \ - f_string_dynamic_delete(&setting.path_library_script); \ - f_string_dynamic_delete(&setting.path_library_shared); \ - f_string_dynamic_delete(&setting.path_library_static); \ - f_string_dynamic_delete(&setting.path_program_script); \ - f_string_dynamic_delete(&setting.path_program_shared); \ - f_string_dynamic_delete(&setting.path_program_static); \ - f_string_dynamic_delete(&setting.path_sources); \ - f_string_dynamic_delete(&setting.process_post); \ - f_string_dynamic_delete(&setting.process_pre); \ - f_string_dynamic_delete(&setting.project_name); \ - f_string_dynamic_delete(&setting.version_major); \ - f_string_dynamic_delete(&setting.version_micro); \ - f_string_dynamic_delete(&setting.version_minor); \ - f_string_dynamics_delete(&setting.build_libraries); \ - f_string_dynamics_delete(&setting.build_sources_headers); \ - f_string_dynamics_delete(&setting.build_sources_library); \ - f_string_dynamics_delete(&setting.build_sources_program); \ - f_string_dynamics_delete(&setting.build_sources_setting); \ - f_string_dynamics_delete(&setting.build_sources_script); \ - f_string_dynamics_delete(&setting.defines_all); \ - f_string_dynamics_delete(&setting.defines_shared); \ - f_string_dynamics_delete(&setting.defines_static); \ - f_string_dynamics_delete(&setting.environment); \ - f_string_dynamics_delete(&setting.flags_all); \ - f_string_dynamics_delete(&setting.flags_library); \ - f_string_dynamics_delete(&setting.flags_program); \ - f_string_dynamics_delete(&setting.flags_shared); \ - f_string_dynamics_delete(&setting.flags_static); \ - f_string_dynamics_delete(&setting.modes); \ - f_string_dynamics_delete(&setting.modes_default); + f_macro_string_dynamic_t_delete_simple(setting.build_compiler); \ + f_macro_string_dynamic_t_delete_simple(setting.build_indexer); \ + f_macro_string_dynamic_t_delete_simple(setting.path_headers); \ + f_macro_string_dynamic_t_delete_simple(setting.path_language); \ + f_macro_string_dynamic_t_delete_simple(setting.path_library_script); \ + f_macro_string_dynamic_t_delete_simple(setting.path_library_shared); \ + f_macro_string_dynamic_t_delete_simple(setting.path_library_static); \ + f_macro_string_dynamic_t_delete_simple(setting.path_program_script); \ + f_macro_string_dynamic_t_delete_simple(setting.path_program_shared); \ + f_macro_string_dynamic_t_delete_simple(setting.path_program_static); \ + f_macro_string_dynamic_t_delete_simple(setting.path_sources); \ + f_macro_string_dynamic_t_delete_simple(setting.process_post); \ + f_macro_string_dynamic_t_delete_simple(setting.process_pre); \ + f_macro_string_dynamic_t_delete_simple(setting.project_name); \ + f_macro_string_dynamic_t_delete_simple(setting.version_major); \ + f_macro_string_dynamic_t_delete_simple(setting.version_micro); \ + f_macro_string_dynamic_t_delete_simple(setting.version_minor); \ + f_macro_string_dynamics_t_delete_simple(setting.build_libraries); \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_headers); \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_library); \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_program); \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_setting); \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_script); \ + f_macro_string_dynamics_t_delete_simple(setting.defines_all); \ + f_macro_string_dynamics_t_delete_simple(setting.defines_shared); \ + f_macro_string_dynamics_t_delete_simple(setting.defines_static); \ + f_macro_string_dynamics_t_delete_simple(setting.environment); \ + f_macro_string_dynamics_t_delete_simple(setting.flags_all); \ + f_macro_string_dynamics_t_delete_simple(setting.flags_library); \ + f_macro_string_dynamics_t_delete_simple(setting.flags_program); \ + f_macro_string_dynamics_t_delete_simple(setting.flags_shared); \ + f_macro_string_dynamics_t_delete_simple(setting.flags_static); \ + f_macro_string_dynamics_t_delete_simple(setting.modes); \ + f_macro_string_dynamics_t_delete_simple(setting.modes_default); #define fake_build_setting_name_build_compiler "build_compiler" #define fake_build_setting_name_build_language "build_language" @@ -282,19 +282,19 @@ extern "C" { #define fake_build_stage_total 13 #define fake_macro_build_stage_t_delete_simple(stage) \ - f_string_dynamic_delete(&stage.file_libraries_script); \ - f_string_dynamic_delete(&stage.file_libraries_shared); \ - f_string_dynamic_delete(&stage.file_libraries_static); \ - f_string_dynamic_delete(&stage.file_objects_static); \ - f_string_dynamic_delete(&stage.file_process_post); \ - f_string_dynamic_delete(&stage.file_process_pre); \ - f_string_dynamic_delete(&stage.file_programs_script); \ - f_string_dynamic_delete(&stage.file_programs_shared); \ - f_string_dynamic_delete(&stage.file_programs_static); \ - f_string_dynamic_delete(&stage.file_skeleton); \ - f_string_dynamic_delete(&stage.file_sources_headers); \ - f_string_dynamic_delete(&stage.file_sources_script); \ - f_string_dynamic_delete(&stage.file_sources_settings); + f_macro_string_dynamic_t_delete_simple(stage.file_libraries_script); \ + f_macro_string_dynamic_t_delete_simple(stage.file_libraries_shared); \ + f_macro_string_dynamic_t_delete_simple(stage.file_libraries_static); \ + f_macro_string_dynamic_t_delete_simple(stage.file_objects_static); \ + f_macro_string_dynamic_t_delete_simple(stage.file_process_post); \ + f_macro_string_dynamic_t_delete_simple(stage.file_process_pre); \ + f_macro_string_dynamic_t_delete_simple(stage.file_programs_script); \ + f_macro_string_dynamic_t_delete_simple(stage.file_programs_shared); \ + f_macro_string_dynamic_t_delete_simple(stage.file_programs_static); \ + f_macro_string_dynamic_t_delete_simple(stage.file_skeleton); \ + f_macro_string_dynamic_t_delete_simple(stage.file_sources_headers); \ + f_macro_string_dynamic_t_delete_simple(stage.file_sources_script); \ + f_macro_string_dynamic_t_delete_simple(stage.file_sources_settings); #define fake_build_stage_built ".built" #define fake_build_stage_libraries_script "libraries_script" @@ -342,7 +342,7 @@ extern "C" { #define fake_macro_build_data_delete_simple(build) \ fake_macro_build_setting_t_delete_simple(build.setting) \ - f_string_maps_delete(&build.environment); + f_macro_string_maps_t_delete_simple(build.environment); #endif // _di_fake_build_data_t_ #ifndef _di_fake_build_parameter_ diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index fee3a88..2e4d4d7 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -105,12 +105,12 @@ extern "C" { size_file = fake_common_initial_buffer_max; } - f_macro_string_dynamic_t_new((status), (*buffer), size_file); + f_macro_string_dynamic_t_resize((status), (*buffer), size_file); if (F_status_is_error(status)) { fll_error_file_print(data.error, F_status_set_fine(status), name_function, F_true, path_file, "allocate buffer size for", fll_error_file_type_file); - f_string_dynamic_delete(&(*buffer)); + f_macro_string_dynamic_t_delete_simple((*buffer)); return status; } } @@ -143,7 +143,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_file_print(data.error, F_status_set_fine(status), name_function, F_true, path_file, "read", fll_error_file_type_file); - f_string_dynamic_delete(&(*buffer)); + f_macro_string_dynamic_t_delete_simple((*buffer)); } return status; @@ -785,10 +785,10 @@ extern "C" { } } else if (parameter_default_lengths[i] > 0) { - f_macro_string_dynamic_t_new(status, (*parameters_value[i]), parameter_default_lengths[i]); + f_macro_string_dynamic_t_resize(status, (*parameters_value[i]), parameter_default_lengths[i]); if (F_status_is_error(status)) { - if (fll_error_print(data->error, F_status_set_fine(status), "f_macro_string_dynamic_t_new", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { + if (fll_error_print(data->error, F_status_set_fine(status), " f_macro_string_dynamic_t_resize", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to load default for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable_s, parameters_name[i]); diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index b5a83f2..a32012c 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -240,10 +240,10 @@ extern "C" { const f_string_range_t name_settings_range = f_macro_string_range_t_initialize(fake_make_section_settings_length); const f_string_range_t name_main_range = f_macro_string_range_t_initialize(fake_make_section_main_length); - f_macro_fss_nameds_t_new((*status), data_make->fakefile, list_objects.used); + f_macro_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "f_macro_fss_nameds_t_new", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_macro_fss_nameds_t_resize", F_true); f_macro_fss_set_t_delete_simple(settings); f_macro_fss_objects_t_delete_simple(list_objects); @@ -351,9 +351,9 @@ extern "C" { // always have the parameter variable "return" map at index 0 and pre-initialized. { - f_string_t function_name = "f_macro_string_map_multis_t_new"; + f_string_t function_name = "f_macro_string_map_multis_t_resize"; - f_macro_string_map_multis_t_new(*status, data_make->setting_make.parameter, f_memory_default_allocation_step); + f_macro_string_map_multis_t_resize(*status, data_make->setting_make.parameter, f_memory_default_allocation_step); if (F_status_is_error_not(*status)) { data_make->setting_make.parameter.used = 1; @@ -368,8 +368,8 @@ extern "C" { } if (F_status_is_error_not(*status)) { - function_name = "f_macro_string_dynamics_new"; - f_macro_string_dynamics_new(*status, data_make->setting_make.parameter.array[0].value, 1); + function_name = "f_string_dynamics_resize"; + *status = f_string_dynamics_resize(1, &data_make->setting_make.parameter.array[0].value); } if (F_status_is_error_not(*status)) { @@ -486,12 +486,12 @@ extern "C" { } // for if (F_status_is_error(*status)) { - f_string_dynamic_delete(&name_define); + f_macro_string_dynamic_t_delete_simple(name_define); break; } *status = F_none; - f_string_dynamic_delete(&name_define); + f_macro_string_dynamic_t_delete_simple(name_define); } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_fail, data_make->buffer, fake_make_setting_fail_length, settings.objects.array[i]) == F_equal_to) { if (unmatched_fail) { @@ -745,7 +745,7 @@ extern "C" { } } // for - f_string_dynamic_delete(&combined); + f_macro_string_dynamic_t_delete_simple(combined); } f_macro_string_map_multis_t_delete_simple(define); @@ -1065,10 +1065,10 @@ extern "C" { f_string_lengths_t section_stack = f_string_lengths_t_initialize; fake_make_data_t data_make = fake_make_data_t_initialize; - f_macro_string_dynamics_new(status, data_make.path.stack, f_memory_default_allocation_step); + status = f_string_dynamics_increase(&data_make.path.stack); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "f_macro_string_dynamics_new", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); return status; } @@ -1794,12 +1794,12 @@ extern "C" { } if (F_status_is_error(status)) { - f_string_dynamic_delete(&value); + f_macro_string_dynamic_t_delete_simple(value); return status; } if (unmatched) { - f_string_dynamic_delete(&value); + f_macro_string_dynamic_t_delete_simple(value); return F_false; } @@ -1822,7 +1822,7 @@ extern "C" { } } - f_string_dynamic_delete(&value); + f_macro_string_dynamic_t_delete_simple(value); if (F_status_is_error_not(status)) { return F_true; @@ -1847,15 +1847,15 @@ extern "C" { status = f_environment_get(name.string, &value); - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); } if (F_status_is_error(status)) { - f_string_dynamic_delete(&value); + f_macro_string_dynamic_t_delete_simple(value); return status; } else if (status == F_exist_not) { - f_string_dynamic_delete(&value); + f_macro_string_dynamic_t_delete_simple(value); return F_false; } @@ -1878,7 +1878,7 @@ extern "C" { } } - f_string_dynamic_delete(&value); + f_macro_string_dynamic_t_delete_simple(value); if (F_status_is_error_not(status)) { return F_true; @@ -2233,7 +2233,7 @@ extern "C" { if (*status == F_status_set_error(F_signal)) { for (i = 0; i < section->objects.used; i++) { - f_string_dynamics_delete(&arguments[i]); + f_macro_string_dynamics_t_delete_simple(arguments[i]); } // for return 0; @@ -2268,7 +2268,7 @@ extern "C" { } for (i = 0; i < section->objects.used; i++) { - f_string_dynamics_delete(&arguments[i]); + f_macro_string_dynamics_t_delete_simple(arguments[i]); } // for section_stack->used--; @@ -3563,7 +3563,7 @@ extern "C" { } if (operation == fake_make_operation_type_pop) { - f_string_dynamic_delete(&data_make->path.stack.array[data_make->path.stack.used - 1]); + f_macro_string_dynamic_t_delete_simple(data_make->path.stack.array[data_make->path.stack.used - 1]); data_make->path.stack.used--; @@ -3711,7 +3711,7 @@ extern "C" { // clear stack, except for the project root. for (f_array_length_t i = 1; i < data_make->path.stack.used; i++) { - f_string_dynamic_delete(&data_make->path.stack.array[i]); + f_macro_string_dynamic_t_delete_simple(data_make->path.stack.array[i]); } // for data_make->path.stack.used = 1; @@ -3871,13 +3871,13 @@ extern "C" { fll_error_print(data_make->error, F_status_set_fine(*status), "f_conversion_number_signed_to_string", F_true); - f_string_dynamic_delete(&number); + f_macro_string_dynamic_t_delete_simple(number); return; } status2 = f_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); - f_string_dynamic_delete(&number); + f_macro_string_dynamic_t_delete_simple(number); } else { status2 = f_string_append("0", 1, &data_make->setting_make.parameter.array[0].value.array[0]); @@ -3924,10 +3924,10 @@ extern "C" { f_string_dynamics_t args = f_string_dynamics_t_initialize; if (arguments.used > 1) { - f_macro_string_dynamics_new(status, args, arguments.used - 1); + status = f_string_dynamics_resize(arguments.used - 1, &args); if (F_status_is_error(status)) { - fll_error_print(data_make->error, F_status_set_fine(status), "f_macro_string_dynamics_new", F_true); + fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamics_resize", F_true); return status; } @@ -3938,7 +3938,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_append", F_true); - f_string_dynamics_delete(&args); + f_macro_string_dynamics_t_delete_simple(args); return status; } @@ -3947,7 +3947,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_terminate", F_true); - f_string_dynamics_delete(&args); + f_macro_string_dynamics_t_delete_simple(args); return status; } @@ -3957,7 +3957,7 @@ extern "C" { status = fake_make_operate_process_execute(data, *program, args, as_shell, data_make); - f_string_dynamics_delete(&args); + f_macro_string_dynamics_t_delete_simple(args); return status; } #endif // _di_fake_make_operate_process_run_ diff --git a/level_3/fake/c/private-make.h b/level_3/fake/c/private-make.h index 1b2639e..e6ae583 100644 --- a/level_3/fake/c/private-make.h +++ b/level_3/fake/c/private-make.h @@ -317,17 +317,17 @@ extern "C" { } #define fake_macro_make_parameter_delete_simple(parameter) \ - f_string_dynamics_delete(¶meter.build); \ - f_string_dynamics_delete(¶meter.color); \ - f_string_dynamics_delete(¶meter.data); \ - f_string_dynamics_delete(¶meter.define); \ - f_string_dynamics_delete(¶meter.fakefile); \ - f_string_dynamics_delete(¶meter.mode); \ - f_string_dynamics_delete(¶meter.process); \ - f_string_dynamics_delete(¶meter.settings); \ - f_string_dynamics_delete(¶meter.sources); \ - f_string_dynamics_delete(¶meter.verbosity); \ - f_string_dynamics_delete(¶meter.work); + f_macro_string_dynamics_t_delete_simple(parameter.build); \ + f_macro_string_dynamics_t_delete_simple(parameter.color); \ + f_macro_string_dynamics_t_delete_simple(parameter.data); \ + f_macro_string_dynamics_t_delete_simple(parameter.define); \ + f_macro_string_dynamics_t_delete_simple(parameter.fakefile); \ + f_macro_string_dynamics_t_delete_simple(parameter.mode); \ + f_macro_string_dynamics_t_delete_simple(parameter.process); \ + f_macro_string_dynamics_t_delete_simple(parameter.settings); \ + f_macro_string_dynamics_t_delete_simple(parameter.sources); \ + f_macro_string_dynamics_t_delete_simple(parameter.verbosity); \ + f_macro_string_dynamics_t_delete_simple(parameter.work); #endif // _di_fake_make_parameter_t_ #ifndef _di_fake_make_path_t_ @@ -345,7 +345,7 @@ extern "C" { } #define fake_macro_make_path_delete_simple(path) \ - f_string_dynamics_delete(&path.stack); + f_macro_string_dynamics_t_delete_simple(path.stack); #endif // _di_fake_make_path_t_ #ifndef _di_fake_make_data_t_ @@ -384,12 +384,12 @@ extern "C" { #define fake_macro_make_data_t_delete_simple(data) \ fake_macro_build_setting_t_delete_simple(data.setting_build) \ fake_macro_make_setting_t_delete_simple(data.setting_make) \ - f_string_maps_delete(&data.environment); \ + f_macro_string_maps_t_delete_simple(data.environment); \ fake_macro_make_parameter_delete_simple(data.parameter) \ fake_macro_make_path_delete_simple(data.path) \ f_macro_fss_nameds_t_delete_simple(data.fakefile) \ - f_string_dynamic_delete(&data.buffer); \ - f_string_dynamic_delete(&data.path_cache); + f_macro_string_dynamic_t_delete_simple(data.buffer); \ + f_macro_string_dynamic_t_delete_simple(data.path_cache); #endif // _di_fake_make_data_t_ /** diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index 041a969..9694d45 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -147,8 +147,8 @@ extern "C" { } if (F_status_is_error(status)) { - f_string_dynamic_delete(&file_data_build_process_post); - f_string_dynamic_delete(&file_data_build_process_pre); + f_macro_string_dynamic_t_delete_simple(file_data_build_process_post); + f_macro_string_dynamic_t_delete_simple(file_data_build_process_pre); return status; } diff --git a/level_3/fake/data/build/dependencies b/level_3/fake/data/build/dependencies index 86001b4..7a1f748 100644 --- a/level_3/fake/data/build/dependencies +++ b/level_3/fake/data/build/dependencies @@ -3,6 +3,7 @@ f_type f_status f_memory +f_type_array f_string f_utf f_account diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index 9d7a89d..84decdc 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -lcap -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_path -lfll_program -lfl_color -lfl_console -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_status -lfl_string -lfl_utf -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_path -lf_print -lf_signal -lf_string -lf_thread -lf_utf +build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_path -lfll_program -lfl_color -lfl_console -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_status -lfl_string -lfl_utf -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_path -lf_print -lf_signal -lf_string -lf_thread -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fake.c private-fake.c private-clean.c private-build.c private-make.c private-print.c private-skeleton.c diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 9a1155a..3898b6c 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -380,7 +380,7 @@ extern "C" { parameters.array[5].used = 0; parameters.array[6].used = 0; - f_string_dynamics_delete(& parameters); + f_macro_string_dynamics_t_delete_simple( parameters); firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -615,7 +615,7 @@ extern "C" { status = firewall_buffer_rules(file_path.string, F_true, &local, data); - f_string_dynamic_delete(&file_path); + f_macro_string_dynamic_t_delete_simple(file_path); } if (F_status_is_error(status)) { @@ -732,9 +732,9 @@ extern "C" { f_macro_string_lengths_t_delete_simple(data->parameters[i].values); } // for - f_string_dynamics_delete(&data->chains); + f_macro_string_dynamics_t_delete_simple(data->chains); f_macro_string_lengths_t_delete_simple(data->remaining); - f_string_dynamics_delete(&data->devices); + f_macro_string_dynamics_t_delete_simple(data->devices); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index a3b8201..b0063c8 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -19,9 +19,9 @@ // fll-0 includes #include -#include #include #include +#include #include #include #include diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index c856faa..fbb64ed 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -41,10 +41,10 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } else { if (data.devices.array[local.device].used > 0) { - f_macro_string_dynamic_t_new(status, device, data.devices.array[local.device].used); + f_macro_string_dynamic_t_resize(status, device, data.devices.array[local.device].used); if (F_status_is_error(status)) { - f_string_dynamic_delete(&device); + f_macro_string_dynamic_t_delete_simple(device); return status; } @@ -66,7 +66,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi is_ip_list = F_false; ip_list_direction = F_false; - f_string_dynamic_delete(&ip_list); + f_macro_string_dynamic_t_delete_simple(ip_list); // process chain rule if (length >= firewall_chain_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_chain, length, firewall_chain_length) == F_equal_to) { @@ -136,7 +136,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi invalid = F_true; } else if (length >= firewall_device_all_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_device_all, length, firewall_device_all_length) == F_equal_to) { - f_string_dynamic_delete(&device); + f_macro_string_dynamic_t_delete_simple(device); device_all = F_true; continue; } @@ -153,7 +153,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi device.used = data.devices.array[local.device].used; } else { - f_string_dynamic_delete(&device); + f_macro_string_dynamic_t_delete_simple(device); } device_all = F_false; @@ -172,7 +172,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi device.used = length; } else { - f_string_dynamic_delete(&device); + f_macro_string_dynamic_t_delete_simple(device); } device_all = F_false; @@ -230,8 +230,8 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi use_protocol = F_false; } else if (length > 0) { - f_string_dynamic_delete(&protocol); - f_macro_string_dynamic_t_new(status, protocol, length); + f_macro_string_dynamic_t_delete_simple(protocol); + f_macro_string_dynamic_t_resize(status, protocol, length); if (F_status_is_error(status)) break; @@ -319,9 +319,9 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi for (r = repeat; r > 0; r--) { // first add the program name - f_string_dynamics_delete(&arguments); - f_macro_string_dynamics_new(status, arguments, firewall_default_allocation_step); + f_string_dynamics_resize(0, &arguments); + status = f_string_dynamics_increase(&arguments); if (F_status_is_error(status)) break; if (tool == firewall_program_ip46tables) { @@ -335,14 +335,14 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } } - f_string_dynamic_delete(&argument); + f_macro_string_dynamic_t_delete_simple(argument); if (F_status_is_error(status)) break; // process the action when a non-none chain is specified. if (chain != firewall_chain_none_id && action != firewall_action_none_id) { if (action == firewall_action_append_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_action_append_command_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_action_append_command_length); if (F_status_is_error(status)) break; @@ -350,7 +350,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi argument.used = firewall_action_append_command_length; } else if (action == firewall_action_insert_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_action_insert_command_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_action_insert_command_length); if (F_status_is_error(status)) break; @@ -358,7 +358,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi argument.used = firewall_action_insert_command_length; } else if (action == firewall_action_policy_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_action_policy_command_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_action_policy_command_length); if (F_status_is_error(status)) break; @@ -369,14 +369,14 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi if (argument.used > 0) { firewall_macro_append_argument_to_arguments(status, arguments, argument) if (F_status_is_error(status)) { - f_string_dynamic_delete(&argument); + f_macro_string_dynamic_t_delete_simple(argument); break; } // process the chain, which is required by the action. if (chain == firewall_chain_custom_id) { if (data.chains.array[local.chain_ids.array[local.chain]].used > 0) { - f_macro_string_dynamic_t_new(status, argument, data.chains.array[local.chain_ids.array[local.chain]].used); + f_macro_string_dynamic_t_resize(status, argument, data.chains.array[local.chain_ids.array[local.chain]].used); if (F_status_is_error(status)) break; @@ -385,7 +385,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } } else if (chain == firewall_chain_forward_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_chain_forward_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_chain_forward_length); if (F_status_is_error(status)) break; @@ -393,7 +393,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi argument.used = firewall_chain_forward_length; } else if (chain == firewall_chain_postrouting_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_chain_postrouting_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_chain_postrouting_length); if (F_status_is_error(status)) break; @@ -401,7 +401,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi argument.used += firewall_chain_postrouting_length; } else if (chain == firewall_chain_prerouting_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_chain_prerouting_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_chain_prerouting_length); if (F_status_is_error(status)) break; @@ -409,7 +409,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi argument.used = firewall_chain_prerouting_length; } else if (chain == firewall_chain_input_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_chain_input_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_chain_input_length); if (F_status_is_error(status)) break; @@ -417,7 +417,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi argument.used = firewall_chain_input_length; } else if (chain == firewall_chain_output_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_chain_output_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_chain_output_length); if (F_status_is_error(status)) break; @@ -438,14 +438,14 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi if (device.used > 0 && (direction == firewall_direction_input_id || direction == firewall_direction_output_id)) { if (length < firewall_device_all_length || fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_device_all, length, firewall_device_all_length) == F_equal_to_not) { if (direction == firewall_direction_input_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_device_input_command_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_device_input_command_length); if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_device_input_command, firewall_device_input_command_length); argument.used = firewall_device_input_command_length; } else if (direction == firewall_direction_output_id) { - f_macro_string_dynamic_t_new(status, argument, firewall_device_output_command_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_device_output_command_length); if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_device_output_command, firewall_device_output_command_length); @@ -462,7 +462,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi // add the device. if (device.used > 0) { - f_macro_string_dynamic_t_new(status, argument, device.used); + f_macro_string_dynamic_t_resize(status, argument, device.used); if (F_status_is_error(status)) break; @@ -477,7 +477,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } if (use_protocol) { - f_macro_string_dynamic_t_new(status, argument, firewall_protocol_command_length); + f_macro_string_dynamic_t_resize(status, argument, firewall_protocol_command_length); if (F_status_is_error(status)) break; @@ -490,7 +490,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } if (protocol.used > 0) { - f_macro_string_dynamic_t_new(status, argument, protocol.used); + f_macro_string_dynamic_t_resize(status, argument, protocol.used); if (F_status_is_error(status)) break; @@ -515,7 +515,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi length = firewall_macro_structure_size(local.rule_contents.array[i], subcounter); if (length > 0) { - f_macro_string_dynamic_t_new(status, ip_list, length); + f_macro_string_dynamic_t_resize(status, ip_list, length); if (F_status_is_error(status)) { // prevent the loop below from being processed. @@ -535,7 +535,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi length = firewall_macro_structure_size(local.rule_contents.array[i], subcounter); if (length > 0) { - f_macro_string_dynamic_t_new(status, argument, length); + f_macro_string_dynamic_t_resize(status, argument, length); if (F_status_is_error(status)) break; @@ -572,7 +572,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi f_fss_objects_t basic_objects = f_fss_objects_t_initialize; f_fss_contents_t basic_contents = f_fss_objects_t_initialize; - f_macro_string_dynamic_t_new(status, file_path, network_path_length + ip_list.used + firewall_default_allocation_step); + f_macro_string_dynamic_t_resize(status, file_path, network_path_length + ip_list.used + firewall_default_allocation_step); if (status == F_none) { firewall_macro_concat_string(file_path.string, network_path, network_path_length); @@ -711,14 +711,14 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi if (F_status_is_error(status)) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); - f_string_dynamic_delete(&ip_list_action); + f_macro_string_dynamic_t_delete_simple(ip_list_action); } else { f_string_dynamic_t ip_argument = f_string_dynamic_t_initialize; firewall_macro_append_argument_to_arguments(status, arguments, ip_list_action) if (F_status_is_error(status)) { - f_string_dynamic_delete(&ip_argument); + f_macro_string_dynamic_t_delete_simple(ip_argument); break; } @@ -727,7 +727,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi ip_length = firewall_macro_structure_size(basic_objects, buffer_counter); - f_macro_string_dynamic_t_new(status, ip_argument, ip_length); + f_macro_string_dynamic_t_resize(status, ip_argument, ip_length); if (F_status_is_error(status)) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); @@ -774,7 +774,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi fprintf(f_type_error, "\n"); // remove ip_argument from arguments string. - f_string_dynamic_delete(&arguments.array[arguments.used]); + f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); arguments.used--; break; @@ -783,21 +783,21 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol_s[0]); // remove ip_argument from arguments string. - f_string_dynamic_delete(&arguments.array[arguments.used]); + f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); arguments.used--; break; } // remove ip_argument from arguments string. - f_string_dynamic_delete(&arguments.array[arguments.used]); + f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); arguments.used--; } // for - f_string_dynamic_delete(&ip_argument); + f_macro_string_dynamic_t_delete_simple(ip_argument); // remove ip_list_action from arguments string. - f_string_dynamic_delete(&arguments.array[arguments.used]); + f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); arguments.used--; } } @@ -806,8 +806,8 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } } - f_string_dynamic_delete(&local_buffer); - f_string_dynamic_delete(&file_path); + f_macro_string_dynamic_t_delete_simple(local_buffer); + f_macro_string_dynamic_t_delete_simple(file_path); f_macro_fss_objects_t_delete_simple(basic_objects); f_macro_fss_contents_t_delete_simple(basic_contents); @@ -857,11 +857,11 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } // for } // for - f_string_dynamic_delete(&ip_list); - f_string_dynamic_delete(&argument); - f_string_dynamics_delete(&arguments); - f_string_dynamic_delete(&device); - f_string_dynamic_delete(&protocol); + f_macro_string_dynamic_t_delete_simple(ip_list); + f_macro_string_dynamic_t_delete_simple(argument); + f_macro_string_dynamics_t_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(device); + f_macro_string_dynamic_t_delete_simple(protocol); return status; } @@ -884,22 +884,19 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f f_string_dynamic_t fixed_string = f_string_dynamic_t_initialize; f_macro_array_lengths_t_delete_simple(local->chain_ids); - f_macro_array_lengths_t_new(status, local->chain_ids, local->chain_objects.used); + f_macro_array_lengths_t_resize(status, local->chain_ids, local->chain_objects.used); if (F_status_is_error(status)) { return status; } - f_macro_string_dynamics_new(status, arguments, 2); + status = f_string_dynamics_resize(2, &arguments); + if (F_status_is_error(status)) return status; - if (F_status_is_error(status)) { - return status; - } - - f_macro_string_dynamic_t_new(status, arguments.array[0], firewall_chain_create_command_length); + status = f_string_dynamic_resize(firewall_chain_create_command_length, &arguments.array[0]); if (F_status_is_error(status)) { - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -908,11 +905,11 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f arguments.array[0].used = firewall_chain_create_command_length; - f_macro_string_dynamic_t_new(status, arguments.array[1], firewall_default_allocation_step); + status = f_string_dynamic_increase(&arguments.array[1]); if (F_status_is_error(status)) { arguments.used = 1; - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -992,7 +989,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f f_macro_string_dynamics_t_resize(status, data->chains, data->chains.used + firewall_default_allocation_step); if (F_status_is_error(status)) { - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -1006,16 +1003,16 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f f_macro_string_dynamic_t_resize(status, arguments.array[1], length); if (F_status_is_error(status)) { - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } } - f_macro_string_dynamic_t_new(status, data->chains.array[data->chains.used], length); + f_macro_string_dynamic_t_resize(status, data->chains.array[data->chains.used], length); if (F_status_is_error(status)) { - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -1134,7 +1131,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol_s[0]); } - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } } @@ -1145,7 +1142,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f i++; } // while - f_string_dynamics_delete(&arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -1520,7 +1517,7 @@ f_status_t firewall_delete_local_data(firewall_local_data_t *local) { local->device = 0; local->chain = 0; - f_string_dynamic_delete(&local->buffer); + f_macro_string_dynamic_t_delete_simple(local->buffer); f_macro_array_lengths_t_delete_simple(local->chain_ids); f_macro_fss_objects_t_delete_simple(local->chain_objects); f_macro_fss_contents_t_delete_simple(local->chain_contents); diff --git a/level_3/firewall/c/private-firewall.h b/level_3/firewall/c/private-firewall.h index 1193a8a..d841e7c 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -66,9 +66,9 @@ typedef struct { } #define firewall_macro_delete_fss_buffers(status, buffer, objects, contents) \ - f_string_dynamic_delete(&buffer); \ - f_macro_fss_objects_t_delete(status, objects); \ - f_macro_fss_contents_t_delete(status, contents); + f_macro_string_dynamic_t_delete_simple(buffer); \ + f_macro_fss_objects_t_delete_simple(objects); \ + f_macro_fss_contents_t_delete_simple(contents); #define firewall_macro_concat_string(destination, source, length) \ memcpy((void *)(destination), source, length); diff --git a/level_3/firewall/data/build/dependencies b/level_3/firewall/data/build/dependencies index a486b83..fcd252d 100644 --- a/level_3/firewall/data/build/dependencies +++ b/level_3/firewall/data/build/dependencies @@ -3,6 +3,7 @@ f_type f_status f_memory +f_type_array f_string f_utf f_account diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index 35e41da..a436e85 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -lcap -build_libraries-individual -lfll_error -lfll_execute -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_control_group -lfl_conversion -lfl_environment -lfl_fss -lfl_status -lfl_string -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_limit -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_string -lf_thread -lf_utf +build_libraries-individual -lfll_error -lfll_execute -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_control_group -lfl_conversion -lfl_environment -lfl_fss -lfl_status -lfl_string -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_limit -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_string -lf_thread -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library firewall.c private-firewall.c diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index ad0a0ac..f09bec7 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -455,7 +455,7 @@ extern "C" { // Clear buffers before continuing. f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (F_status_is_error_not(status) && data->remaining.used > 0) { @@ -511,13 +511,13 @@ extern "C" { // Clear buffers before repeating the loop. f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for if (F_status_is_error(status)) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } } @@ -546,7 +546,7 @@ extern "C" { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index 6ffaa73..7650e43 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c @@ -16,7 +16,7 @@ extern "C" { depth_size = data.parameters[fss_basic_list_read_parameter_depth].values.used; } - fss_basic_list_read_macro_depths_t_new(status, (*depths), depth_size); + fss_basic_list_read_macro_depths_t_resize(status, (*depths), depth_size); if (F_status_is_error(status)) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); @@ -196,7 +196,7 @@ extern "C" { else if (status == F_data_not_stop || status == F_data_not_eos) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { fprintf(data->output.stream, "0%c", f_string_eol_s[0]); @@ -209,7 +209,7 @@ extern "C" { if (F_status_is_error(status)) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); return status; } diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h index 64a8ea7..e5c6da8 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h @@ -50,8 +50,7 @@ extern "C" { structure.value_at = 0; \ f_macro_string_dynamic_t_clear(structure.value_name) - #define fss_basic_list_read_macro_depth_t_delete(status, structure) status = f_string_dynamic_delete(&structure.value_name); - #define fss_basic_list_read_macro_depth_t_delete_simple(structure) f_string_dynamic_delete(&structure.value_name); + #define fss_basic_list_read_macro_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name); #endif // _di_fss_basic_list_read_depth_t_ /** @@ -73,18 +72,6 @@ extern "C" { #define fss_basic_list_read_macro_depths_t_clear(depths) f_macro_memory_structure_clear(depths) - #define fss_basic_list_read_macro_depths_t_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_basic_list_read_depth_t, length) - - #define fss_basic_list_read_macro_depths_t_delete(status, depths) \ - status = F_none; \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - fss_basic_list_read_macro_depth_t_delete(status, depths.array[depths.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) f_macro_memory_structure_delete(depths, fss_basic_list_read_depth_t) - #define fss_basic_list_read_macro_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ @@ -98,8 +85,7 @@ extern "C" { if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - fss_basic_list_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + fss_basic_list_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_list_read_depth_t), depths.size, new_length); \ @@ -113,8 +99,7 @@ extern "C" { if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - fss_basic_list_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + fss_basic_list_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_list_read_depth_t), depths.size, new_length); \ diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index daa87ad..5e6475d 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_list_read.c private-fss_basic_list_read.c diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index 31e3772..60c312b 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -472,7 +472,7 @@ extern "C" { } } - f_string_dynamic_delete(&escaped); + f_macro_string_dynamic_t_delete_simple(escaped); // object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free(). object.string = 0; @@ -497,9 +497,9 @@ extern "C" { } } - f_string_dynamic_delete(&buffer); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); fss_basic_list_write_delete_data(data); return status; } diff --git a/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c b/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c index b546d05..6523a65 100644 --- a/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c @@ -275,9 +275,9 @@ extern "C" { status = fss_basic_list_write_process(data, output, quote, &object, &content, buffer); } - f_string_dynamic_delete(&block); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(block); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); return status; } #endif // _di_fss_basic_list_write_process_pipe_ diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index ade96c9..e664781 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_list_write.c private-fss_basic_list_write.c diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 50962be..4209f9d 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -454,7 +454,7 @@ extern "C" { // Clear buffers before continuing. f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (F_status_is_error_not(status) && data->remaining.used > 0) { @@ -510,13 +510,13 @@ extern "C" { // Clear buffers before repeating the loop. f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for if (F_status_is_error(status)) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } } @@ -544,7 +544,7 @@ extern "C" { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.c b/level_3/fss_basic_read/c/private-fss_basic_read.c index 7873dce..45bcf50 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.c +++ b/level_3/fss_basic_read/c/private-fss_basic_read.c @@ -16,7 +16,7 @@ extern "C" { depth_size = data.parameters[fss_basic_read_parameter_depth].values.used; } - fss_basic_read_macro_depths_t_new(status, (*depths), depth_size); + fss_basic_read_macro_depths_t_resize(status, (*depths), depth_size); if (F_status_is_error(status)) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); @@ -195,7 +195,7 @@ extern "C" { else if (status == F_data_not_stop || status == F_data_not_eos) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { fprintf(data->output.stream, "0%c", f_string_eol_s[0]); @@ -208,7 +208,7 @@ extern "C" { if (F_status_is_error(status)) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); return status; } diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.h b/level_3/fss_basic_read/c/private-fss_basic_read.h index 8ab2be3..7590e83 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.h +++ b/level_3/fss_basic_read/c/private-fss_basic_read.h @@ -50,8 +50,8 @@ extern "C" { structure.value_at = 0; \ f_macro_string_dynamic_t_clear(structure.value_name) - #define fss_basic_read_macro_depth_t_delete(status, structure) status = f_string_dynamic_delete(&structure.value_name); - #define fss_basic_read_macro_depth_t_delete_simple(structure) f_string_dynamic_delete(&structure.value_name); + #define fss_basic_read_macro_depth_t_delete(status, structure) status = f_macro_string_dynamic_t_delete_simple(structure.value_name); + #define fss_basic_read_macro_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name); #endif // _di_fss_basic_read_depth_t_ /** @@ -73,15 +73,13 @@ extern "C" { #define fss_basic_read_macro_depths_t_clear(depths) f_macro_memory_structure_clear(depths) - #define fss_basic_read_macro_depths_t_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_basic_read_depth_t, length) - #define fss_basic_read_macro_depths_t_delete(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ fss_basic_read_macro_depth_t_delete(status, depths.array[depths.used]); \ - if (status != F_none) break; \ + if (F_status_is_error(status)) break; \ } \ if (status == F_none) f_macro_memory_structure_delete(depths, fss_basic_read_depth_t) @@ -99,7 +97,7 @@ extern "C" { f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ fss_basic_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + if (F_status_is_error(status)) break; \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_read_depth_t), depths.size, new_length); \ @@ -114,7 +112,7 @@ extern "C" { f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ fss_basic_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + if (F_status_is_error(status)) break; \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_read_depth_t), depths.size, new_length); \ diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index a489fb5..75fde24 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_read.c private-fss_basic_read.c diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index fa8a824..4b1a765 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -471,7 +471,7 @@ extern "C" { } } - f_string_dynamic_delete(&escaped); + f_macro_string_dynamic_t_delete_simple(escaped); // object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free(). object.string = 0; @@ -496,9 +496,9 @@ extern "C" { } } - f_string_dynamic_delete(&buffer); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); fss_basic_write_delete_data(data); return status; } diff --git a/level_3/fss_basic_write/c/private-fss_basic_write.c b/level_3/fss_basic_write/c/private-fss_basic_write.c index da64540..ecc955f 100644 --- a/level_3/fss_basic_write/c/private-fss_basic_write.c +++ b/level_3/fss_basic_write/c/private-fss_basic_write.c @@ -294,9 +294,9 @@ extern "C" { status = fss_basic_write_process(data, output, quote, &object, &content, buffer); } - f_string_dynamic_delete(&block); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(block); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); return status; } #endif // _di_fss_basic_write_process_pipe_ diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index 8112ea9..20a03b4 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_write.c private-fss_basic_write.c diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c index a4234dc..1d406cb 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c @@ -441,7 +441,7 @@ extern "C" { // Clear buffers before continuing. f_macro_fss_nest_t_delete_simple(data->nest); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (F_status_is_error_not(status) && data->remaining.used > 0) { @@ -495,12 +495,12 @@ extern "C" { // Clear buffers before repeating the loop. f_macro_fss_nest_t_delete_simple(data->nest); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for if (F_status_is_error(status)) { f_macro_fss_nest_t_delete_simple(data->nest); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } } @@ -530,7 +530,7 @@ extern "C" { f_macro_fss_nest_t_delete_simple(data->nest); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c index b7307c8..fbd86a8 100644 --- a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c @@ -102,7 +102,7 @@ extern "C" { i = data.parameters[fss_embedded_list_read_parameter_depth].values.used + 1; } - fss_embedded_list_read_macro_depths_t_new(status, (*depths), i); + fss_embedded_list_read_macro_depths_t_resize(status, (*depths), i); if (F_status_is_error(status)) { fll_error_print(data.error, F_status_set_fine(status), "fss_embedded_list_read_main_preprocess_depth", F_true); @@ -234,7 +234,7 @@ extern "C" { } else if (status == F_data_not_stop || status == F_data_not_eos) { f_macro_fss_nest_t_delete_simple(data->nest); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); if (data->parameters[fss_embedded_list_read_parameter_total].result == f_console_result_found) { fprintf(data->output.stream, "0%c", f_string_eol_s[0]); @@ -246,7 +246,7 @@ extern "C" { if (F_status_is_error(status)) { f_macro_fss_nest_t_delete_simple(data->nest); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); return status; } diff --git a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h index 61550a3..e50dee5 100644 --- a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h +++ b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h @@ -50,8 +50,7 @@ extern "C" { structure.value_at = 0; \ f_macro_string_dynamic_t_clear(structure.value_name) - #define fss_embedded_list_read_macro_depth_t_delete(status, structure) status = f_string_dynamic_delete(&structure.value_name) - #define fss_embedded_list_read_macro_depth_t_delete_simple(structure) f_string_dynamic_delete(&structure.value_name) + #define fss_embedded_list_read_macro_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name) #endif // _di_fss_embedded_list_read_depth_t_ /** @@ -98,18 +97,6 @@ extern "C" { #define fss_embedded_list_read_macro_depths_t_clear(depths) f_macro_memory_structure_clear(depths) - #define fss_embedded_list_read_macro_depths_t_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_embedded_list_read_depth_t, length) - - #define fss_embedded_list_read_macro_depths_t_delete(status, depths) \ - status = F_none; \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - fss_embedded_list_read_macro_depth_t_delete(status, depths.array[depths.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) f_macro_memory_structure_delete(depths, fss_embedded_list_read_depth_t) - #define fss_embedded_list_read_macro_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ @@ -123,8 +110,7 @@ extern "C" { if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - fss_embedded_list_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + fss_embedded_list_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_embedded_list_read_depth_t), depths.size, new_length); \ @@ -138,8 +124,7 @@ extern "C" { if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - fss_embedded_list_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + fss_embedded_list_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_embedded_list_read_depth_t), depths.size, new_length); \ diff --git a/level_3/fss_embedded_list_read/data/build/settings b/level_3/fss_embedded_list_read/data/build/settings index c6bdc4c..eb2c6e7 100644 --- a/level_3/fss_embedded_list_read/data/build/settings +++ b/level_3/fss_embedded_list_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_embedded_list_read.c private-fss_embedded_list_read.c diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index c46f9fe..df15d8b 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -488,7 +488,7 @@ extern "C" { } } - f_string_dynamic_delete(&escaped); + f_macro_string_dynamic_t_delete_simple(escaped); f_macro_string_ranges_t_delete_simple(ignore); // object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free(). @@ -514,9 +514,9 @@ extern "C" { } } - f_string_dynamic_delete(&buffer); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); fss_embedded_list_write_delete_data(data); return status; } diff --git a/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c index 8a5d113..5c8090f 100644 --- a/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c @@ -314,9 +314,9 @@ extern "C" { status = fss_embedded_list_write_process(data, output, quote, &object, &content, ignore, buffer); } - f_string_dynamic_delete(&block); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(block); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); return status; } #endif // _di_fss_embedded_list_write_process_pipe_ diff --git a/level_3/fss_embedded_list_write/data/build/settings b/level_3/fss_embedded_list_write/data/build/settings index c6e934a..d392913 100644 --- a/level_3/fss_embedded_list_write/data/build/settings +++ b/level_3/fss_embedded_list_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_embedded_list_write.c private-fss_embedded_list_write.c diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index dfa0044..8c57e8f 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.c @@ -455,7 +455,7 @@ extern "C" { // Clear buffers before continuing. f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (F_status_is_error_not(status) && data->remaining.used > 0) { @@ -511,13 +511,13 @@ extern "C" { // Clear buffers before repeating the loop. f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for if (F_status_is_error(status)) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } } @@ -546,7 +546,7 @@ extern "C" { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index 150384f..892ac40 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c @@ -16,7 +16,7 @@ extern "C" { depth_size = data.parameters[fss_extended_list_read_parameter_depth].values.used; } - fss_extended_list_read_macro_depths_t_new(status, (*depths), depth_size); + fss_extended_list_read_macro_depths_t_resize(status, (*depths), depth_size); if (F_status_is_error(status)) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); @@ -196,7 +196,7 @@ extern "C" { else if (status == F_data_not_stop || status == F_data_not_eos) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { fprintf(data->output.stream, "0%c", f_string_eol_s[0]); @@ -209,7 +209,7 @@ extern "C" { if (F_status_is_error(status)) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); return status; } diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h index d852d17..9b11e3e 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h @@ -50,8 +50,7 @@ extern "C" { structure.value_at = 0; \ f_macro_string_dynamic_t_clear(structure.value_name) - #define fss_extended_list_read_macro_depth_t_delete(status, structure) status = f_string_dynamic_delete(&structure.value_name) - #define fss_extended_list_read_macro_depth_t_delete_simple(structure) f_string_dynamic_delete(&structure.value_name) + #define fss_extended_list_read_macro_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name) #endif // _di_fss_extended_list_read_depth_t_ /** @@ -73,18 +72,6 @@ extern "C" { #define fss_extended_list_read_macro_depths_t_clear(depths) f_macro_memory_structure_clear(depths) - #define fss_extended_list_read_macro_depths_t_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_extended_list_read_depth_t, length) - - #define fss_extended_list_read_macro_depths_t_delete(status, depths) \ - status = F_none; \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - fss_extended_list_read_macro_depth_t_delete(status, depths.array[depths.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) f_macro_memory_structure_delete(depths, fss_extended_list_read_depth_t) - #define fss_extended_list_read_macro_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ @@ -98,8 +85,8 @@ extern "C" { if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - fss_extended_list_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + fss_extended_list_read_macro_depth_t_delete_simple(depths.array[i]); \ + if (F_status_is_error(status)) break; \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_list_read_depth_t), depths.size, new_length); \ @@ -113,8 +100,8 @@ extern "C" { if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - fss_extended_list_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + fss_extended_list_read_macro_depth_t_delete_simple(depths.array[i]); \ + if (F_status_is_error(status)) break; \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_list_read_depth_t), depths.size, new_length); \ diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index af71054..caec2e0 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_list_read.c private-fss_extended_list_read.c diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index 9f212da..f1dbcb0 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -488,7 +488,7 @@ extern "C" { } } - f_string_dynamic_delete(&escaped); + f_macro_string_dynamic_t_delete_simple(escaped); f_macro_string_ranges_t_delete_simple(ignore); // object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free(). @@ -514,9 +514,9 @@ extern "C" { } } - f_string_dynamic_delete(&buffer); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); fss_extended_list_write_delete_data(data); return status; } diff --git a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c index 106f3ed..0c0243e 100644 --- a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c @@ -314,9 +314,9 @@ extern "C" { status = fss_extended_list_write_process(data, output, quote, &object, &content, ignore, buffer); } - f_string_dynamic_delete(&block); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(block); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); return status; } #endif // _di_fss_extended_list_write_process_pipe_ diff --git a/level_3/fss_extended_list_write/data/build/settings b/level_3/fss_extended_list_write/data/build/settings index 25b8bd6..57b285e 100644 --- a/level_3/fss_extended_list_write/data/build/settings +++ b/level_3/fss_extended_list_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_list_write.c private-fss_extended_list_write.c diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index f8c0055..fa895a0 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -455,7 +455,7 @@ extern "C" { // Clear buffers before continuing. f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (F_status_is_error_not(status) && data->remaining.used > 0) { @@ -511,13 +511,13 @@ extern "C" { // Clear buffers before repeating the loop. f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for if (F_status_is_error(status)) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } } @@ -546,7 +546,7 @@ extern "C" { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.c b/level_3/fss_extended_read/c/private-fss_extended_read.c index fc773e5..0b2cbc7 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.c +++ b/level_3/fss_extended_read/c/private-fss_extended_read.c @@ -43,7 +43,7 @@ extern "C" { depth_size = data.parameters[fss_extended_read_parameter_depth].values.used; } - fss_extended_read_macro_depths_t_new(status, (*depths), depth_size); + fss_extended_read_macro_depths_t_resize(status, (*depths), depth_size); if (F_status_is_error(status)) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); @@ -223,7 +223,7 @@ extern "C" { else if (status == F_data_not_stop || status == F_data_not_eos) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { fprintf(data->output.stream, "0%c", f_string_eol_s[0]); @@ -236,7 +236,7 @@ extern "C" { if (F_status_is_error(status)) { f_macro_fss_contents_t_delete_simple(data->contents); f_macro_fss_objects_t_delete_simple(data->objects); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); return status; } diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.h b/level_3/fss_extended_read/c/private-fss_extended_read.h index 36b5b17..4374abb 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.h +++ b/level_3/fss_extended_read/c/private-fss_extended_read.h @@ -50,8 +50,7 @@ extern "C" { structure.value_at = 0; \ f_macro_string_dynamic_t_clear(structure.value_name) - #define fss_extended_read_macro_depth_t_delete(status, structure) status = f_string_dynamic_delete(&structure.value_name) - #define fss_extended_read_macro_depth_t_delete_simple(structure) f_string_dynamic_delete(&structure.value_name) + #define fss_extended_read_macro_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name) #endif // _di_fss_extended_read_depth_t_ /** @@ -73,18 +72,6 @@ extern "C" { #define fss_extended_read_macro_depths_t_clear(depths) f_macro_memory_structure_clear(depths) - #define fss_extended_read_macro_depths_t_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_extended_read_depth_t, length) - - #define fss_extended_read_macro_depths_t_delete(status, depths) \ - status = F_none; \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - fss_extended_read_macro_depth_t_delete(status, depths.array[depths.used]); \ - if (status != F_none) break; \ - } \ - if (status == F_none) f_macro_memory_structure_delete(depths, fss_extended_read_depth_t) - #define fss_extended_read_macro_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ @@ -98,8 +85,7 @@ extern "C" { if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - fss_extended_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + fss_extended_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_read_depth_t), depths.size, new_length); \ @@ -113,8 +99,7 @@ extern "C" { if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - fss_extended_read_macro_depth_t_delete(status, depths.array[i]); \ - if (status != F_none) break; \ + fss_extended_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_read_depth_t), depths.size, new_length); \ diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index 01f1d7a..fdfd70c 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_read.c private-fss_extended_read.c diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 45428ce..0fe2d1e 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -546,7 +546,7 @@ extern "C" { } } - f_string_dynamic_delete(&escaped); + f_macro_string_dynamic_t_delete_simple(escaped); // object, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free(). object.string = 0; @@ -570,9 +570,9 @@ extern "C" { } } - f_string_dynamic_delete(&buffer); - f_string_dynamic_delete(&object); - f_string_dynamics_delete(&contents); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamics_t_delete_simple(contents); fss_extended_write_delete_data(data); return status; } diff --git a/level_3/fss_extended_write/c/private-fss_extended_write.c b/level_3/fss_extended_write/c/private-fss_extended_write.c index bcf515a..32e8096 100644 --- a/level_3/fss_extended_write/c/private-fss_extended_write.c +++ b/level_3/fss_extended_write/c/private-fss_extended_write.c @@ -324,9 +324,9 @@ extern "C" { status = fss_extended_write_process(data, output, quote, &object, &contents, buffer); } - f_string_dynamic_delete(&block); - f_string_dynamic_delete(&object); - f_string_dynamics_delete(&contents); + f_macro_string_dynamic_t_delete_simple(block); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamics_t_delete_simple(contents); return status; } #endif // _di_fss_extended_write_process_pipe_ diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index ad1d381..89b8325 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_write.c private-fss_extended_write.c diff --git a/level_3/fss_status_code/data/build/settings b/level_3/fss_status_code/data/build/settings index 1241ad4..d8d1558 100644 --- a/level_3/fss_status_code/data/build/settings +++ b/level_3/fss_status_code/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfll_status -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lfl_utf -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfll_status -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lfl_utf -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_status_code.c private-fss_status_code.c diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 278671c..2f62f11 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -400,7 +400,7 @@ extern "C" { } // Clear buffers before continuing. - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (F_status_is_fine(status) && data->remaining.used > 0) { @@ -447,7 +447,7 @@ extern "C" { if (F_status_is_error(status)) break; // Clear buffers before repeating the loop. - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for } } @@ -482,7 +482,7 @@ extern "C" { } // for f_macro_string_lengths_t_delete_simple(data->remaining); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index eba40bb..290b125 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -169,23 +169,23 @@ extern "C" { f_array_length_t used; } iki_read_substitutions_t; - #define iki_read_substitutions_t_initialize {0, 0, 0} + #define iki_read_substitutions_t_initialize { 0, 0, 0 } #define iki_read_macro_substitutions_t_clear(replacements) f_macro_memory_structure_clear(replacements) - #define iki_read_macro_substitutions_t_new(status, replacements, length) f_macro_memory_structure_new(status, replacements, iki_read_substitution_t, length) - #define iki_read_macro_substitutions_t_delete_simple(replacements) \ replacements.used = replacements.size; \ - while (replacements.used > 0) { \ + while (replacements.used) { \ replacements.used--; \ + f_macro_memory_structure_delete_simple(replacements.array[replacements.used], iki_read_substitution_t) \ } \ if (!replacements.used) f_macro_memory_structure_delete_simple(replacements, iki_read_substitution_t) #define iki_read_macro_substitutions_t_destroy_simple(replacements) \ replacements.used = replacements.size; \ - while (replacements.used > 0) { \ + while (replacements.used) { \ replacements.used--; \ + f_macro_memory_structure_delete_simple(replacements.array[replacements.used], iki_read_substitution_t) \ } \ if (!replacements.used) f_macro_memory_structure_destroy_simple(replacements, iki_read_substitution_t) @@ -194,7 +194,7 @@ extern "C" { if (new_length < replacements.size) { \ f_array_length_t i = replacements.size - new_length; \ for (; i < replacements.size; i++) { \ - if (status != F_none) break; \ + f_macro_memory_structure_delete_simple(replacements.array[i], iki_read_substitution_t) \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & replacements.array, sizeof(iki_read_substitution_t), replacements.size, new_length); \ @@ -203,12 +203,13 @@ extern "C" { if (replacements.used > replacements.size) replacements.used = new_length; \ } + // @fixme #define iki_read_macro_substitutions_t_adjust(status, replacements, new_length) \ status = F_none; \ if (new_length < replacements.size) { \ f_array_length_t i = replacements.size - new_length; \ for (; i < replacements.size; i++) { \ - if (status != F_none) break; \ + f_macro_memory_structure_delete_simple(replacements.array[i], iki_read_substitution_t) \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & replacements.array, sizeof(iki_read_substitution_t), replacements.size, new_length); \ diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index 417f717..3a7466a 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -153,7 +153,7 @@ extern "C" { iki_read_macro_substitutions_t_delete_simple(substitutionss[i]); } // for - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -178,7 +178,7 @@ extern "C" { } // for } // for - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); if (unmatched) status = F_data_not; else status = F_none; @@ -302,7 +302,7 @@ extern "C" { iki_read_macro_substitutions_t_delete_simple(substitutionss[i]); } // for - f_string_dynamics_delete(&names); + f_macro_string_dynamics_t_delete_simple(names); return status; } } @@ -383,7 +383,7 @@ extern "C" { iki_read_macro_substitutions_t_delete_simple(substitutionss[i]); } // for - f_string_dynamics_delete(&names); + f_macro_string_dynamics_t_delete_simple(names); return F_none; } #endif // _di_iki_read_process_buffer_ranges_whole_ @@ -434,7 +434,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_print(data->error, F_status_set_fine(status), "f_string_append_nulless", F_true); - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -447,7 +447,7 @@ extern "C" { } // for } // for - f_string_dynamic_delete(&name); + f_macro_string_dynamic_t_delete_simple(name); } else { total = variable->used; diff --git a/level_3/iki_read/data/build/settings b/level_3/iki_read/data/build/settings index 3312973..1940fad 100644 --- a/level_3/iki_read/data/build/settings +++ b/level_3/iki_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_iki -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_iki -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library iki_read.c private-iki_read.c diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index eb1946c..6787ceb 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -366,9 +366,9 @@ extern "C" { status = F_status_set_error(F_parameter); } - f_string_dynamic_delete(&buffer); - f_string_dynamic_delete(&object); - f_string_dynamic_delete(&content); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(object); + f_macro_string_dynamic_t_delete_simple(content); } if (F_status_is_error_not(status)) { @@ -397,7 +397,7 @@ extern "C" { } } - f_string_dynamic_delete(&escaped); + f_macro_string_dynamic_t_delete_simple(escaped); } if (data->parameters[iki_write_parameter_file].result == f_console_result_additional) { @@ -428,7 +428,7 @@ extern "C" { } // for f_macro_string_lengths_t_delete_simple(data->remaining); - f_string_dynamic_delete(&data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/iki_write/c/private-iki_write.c b/level_3/iki_write/c/private-iki_write.c index b98eff0..cbf0849 100644 --- a/level_3/iki_write/c/private-iki_write.c +++ b/level_3/iki_write/c/private-iki_write.c @@ -47,7 +47,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_print(data.error, F_status_set_fine(status), "fll_iki_content_escape", F_true); - f_string_dynamic_delete(&(*escaped)); + f_macro_string_dynamic_t_delete_simple((*escaped)); return F_status_set_error(F_failure); } diff --git a/level_3/iki_write/data/build/settings b/level_3/iki_write/data/build/settings index 6897031..b62ba53 100644 --- a/level_3/iki_write/data/build/settings +++ b/level_3/iki_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_iki -lfll_program -lfl_color -lfl_console -lfl_iki -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_iki -lfll_program -lfl_color -lfl_console -lfl_iki -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library iki_write.c private-iki_write.c diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index 8e08812..086188b 100644 --- a/level_3/init/c/init.c +++ b/level_3/init/c/init.c @@ -114,12 +114,12 @@ extern "C" { f_macro_string_lengths_t_delete_simple(data->remaining); - f_string_dynamic_delete(&data->setting_kernel.root); - f_string_dynamic_delete(&data->setting_kernel.root_group); - f_string_dynamic_delete(&data->setting_kernel.root_sub); - f_string_dynamic_delete(&data->setting_kernel.run); - f_string_dynamic_delete(&data->setting_kernel.settings); - f_string_dynamic_delete(&data->setting_kernel.settings_name); + f_macro_string_dynamic_t_delete_simple(data->setting_kernel.root); + f_macro_string_dynamic_t_delete_simple(data->setting_kernel.root_group); + f_macro_string_dynamic_t_delete_simple(data->setting_kernel.root_sub); + f_macro_string_dynamic_t_delete_simple(data->setting_kernel.run); + f_macro_string_dynamic_t_delete_simple(data->setting_kernel.settings); + f_macro_string_dynamic_t_delete_simple(data->setting_kernel.settings_name); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/init/c/private-init.c b/level_3/init/c/private-init.c index 30460f0..d20ce27 100644 --- a/level_3/init/c/private-init.c +++ b/level_3/init/c/private-init.c @@ -325,12 +325,12 @@ Consider the "*.device" files such that they are also use IKI. f_macro_iki_variable_t_delete_simple(variable); f_macro_iki_vocabulary_t_delete_simple(vocabulary); f_macro_iki_content_t_delete_simple(content); - f_string_dynamic_delete(&cache); + f_macro_string_dynamic_t_delete_simple(cache); } f_file_stream_close(F_true, &command_line); - f_string_dynamic_delete(&buffer); + f_macro_string_dynamic_t_delete_simple(buffer); return status; } diff --git a/level_3/init/data/build/settings b/level_3/init/data/build/settings index 8c706a3..c670027 100644 --- a/level_3/init/data/build/settings +++ b/level_3/init/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_program -lfll_status -lfl_color -lfl_conversion -lfl_iki -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_print -lf_signal -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_program -lfll_status -lfl_color -lfl_conversion -lfl_iki -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_print -lf_signal -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library init.c private-init.c diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index 587bc82..0afe008 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_program -lfll_status -lfl_color -lfl_console -lfl_conversion -lfl_status -lfl_string -lfl_utf -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_utf +build_libraries-individual -lfll_error -lfll_program -lfll_status -lfl_color -lfl_console -lfl_conversion -lfl_status -lfl_string -lfl_utf -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library status_code.c private-status_code.c -- 1.8.3.1