From 9657c26cd40018dca1e46dee85971d18682251df Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 7 Jan 2021 23:12:53 -0600 Subject: [PATCH] Progress: restructure string project and eventially utf project. This collapses much of the code from fl_string into f_string. I have originally wanted to keep f_string source file free to help reduce recursion but the design kept leading me to deciding to do this. The final straw was the extern const strings. This moves all of the string related functionality that does not strictly depend on f_utf into f_string. I expect that the fl_utf and fl_string will be merged together into fl_string. I also expect that following these changes and the related cleanups then I will be at a good point to update and get the UTF-8 processing code in sync with the current string processing code. That is, the f_utf_string needs to work similar to f_string types as well as have the same functions. This collapsing of the level 1 code into level 0 code will also require an update on all appropriate dependencies (header files being included, etc..). I also strived for more completeness in this and added many missing functions and macros. I did not get as far as I would like, resulting in this being a Progress commit instead of an Update commit. --- build/level_0/settings | 4 +- build/monolithic/settings | 4 +- level_0/f_memory/c/memory-common.h | 203 ++- level_0/f_string/c/private-string.c | 424 ++++++ level_0/f_string/c/private-string.h | 739 ++++++++++ level_0/f_string/c/string-common.c | 2 +- level_0/f_string/c/string-common.h | 8 + level_0/f_string/c/string.c | 883 ++++++++++- level_0/f_string/c/string.h | 935 ++++++++++++ level_0/f_string/c/string_dynamic.c | 276 ++++ level_0/f_string/c/string_dynamic.h | 330 ++++- level_0/f_string/c/string_map.c | 151 ++ level_0/f_string/c/string_map.h | 189 ++- level_0/f_string/c/string_quantity.c | 151 ++ level_0/f_string/c/string_quantity.h | 189 +++ level_0/f_string/c/string_range.c | 151 ++ level_0/f_string/c/string_range.h | 189 +++ level_0/f_string/c/string_triple.c | 151 ++ level_0/f_string/c/string_triple.h | 185 ++- level_0/f_string/data/build/settings | 4 +- level_1/fl_string/c/private-string.c | 222 --- level_1/fl_string/c/private-string.h | 300 ---- level_1/fl_string/c/string.c | 1182 +-------------- level_1/fl_string/c/string.h | 1534 ++------------------ level_1/fl_utf/c/private-utf.c | 18 +- level_1/fl_utf/c/private-utf.h | 40 +- level_1/fl_utf/c/utf.c | 148 +- level_1/fl_utf/c/utf.h | 136 +- level_2/fll_environment/c/environment.c | 8 +- level_2/fll_environment/c/environment.h | 16 +- level_2/fll_execute/c/execute.c | 16 +- level_2/fll_execute/c/execute.h | 138 +- level_2/fll_execute/c/private-execute.c | 36 +- level_2/fll_execute/c/private-execute.h | 34 +- level_2/fll_fss/c/fss.c | 68 +- level_2/fll_fss/c/fss.h | 36 +- level_2/fll_fss/c/fss_basic.c | 2 +- level_2/fll_fss/c/fss_basic.h | 2 +- level_2/fll_fss/c/fss_basic_list.h | 2 +- level_2/fll_fss/c/fss_embedded_list.h | 2 +- level_2/fll_fss/c/fss_extended.h | 2 +- level_2/fll_fss/c/fss_extended_list.h | 2 +- level_2/fll_iki/c/iki.h | 8 +- level_2/fll_iki/c/private-iki.c | 14 +- level_2/fll_iki/c/private-iki.h | 4 +- level_2/fll_path/c/path.c | 8 +- level_2/fll_path/c/path.h | 6 +- level_2/fll_program/c/program.c | 12 +- level_2/fll_program/c/program.h | 12 +- level_3/controller/c/controller.c | 16 +- level_3/controller/c/private-common.h | 42 +- level_3/controller/c/private-controller.c | 34 +- level_3/controller/c/private-controller.h | 36 +- level_3/controller/c/private-entry.c | 12 +- level_3/controller/c/private-entry.h | 24 +- level_3/controller/c/private-rule.c | 206 +-- level_3/controller/c/private-rule.h | 50 +- level_3/fake/c/fake.c | 108 +- level_3/fake/c/private-build.c | 256 ++-- level_3/fake/c/private-build.h | 96 +- level_3/fake/c/private-fake.c | 34 +- level_3/fake/c/private-make.c | 308 ++-- level_3/fake/c/private-make.h | 30 +- level_3/fake/c/private-skeleton.c | 4 +- level_3/firewall/c/firewall.c | 8 +- level_3/firewall/c/private-firewall.c | 62 +- level_3/firewall/c/private-firewall.h | 2 +- .../fss_basic_list_read/c/fss_basic_list_read.c | 8 +- .../c/private-fss_basic_list_read.c | 8 +- .../c/private-fss_basic_list_read.h | 4 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 8 +- .../c/private-fss_basic_list_write.c | 18 +- level_3/fss_basic_read/c/fss_basic_read.c | 8 +- level_3/fss_basic_read/c/private-fss_basic_read.c | 8 +- level_3/fss_basic_read/c/private-fss_basic_read.h | 4 +- level_3/fss_basic_write/c/fss_basic_write.c | 8 +- .../fss_basic_write/c/private-fss_basic_write.c | 18 +- .../c/fss_embedded_list_read.c | 8 +- .../c/private-fss_embedded_list_read.c | 8 +- .../c/private-fss_embedded_list_read.h | 4 +- .../c/fss_embedded_list_write.c | 8 +- .../c/private-fss_embedded_list_write.c | 18 +- .../c/fss_extended_list_read.c | 8 +- .../c/private-fss_extended_list_read.c | 8 +- .../c/private-fss_extended_list_read.h | 4 +- .../c/fss_extended_list_write.c | 8 +- .../c/private-fss_extended_list_write.c | 18 +- level_3/fss_extended_read/c/fss_extended_read.c | 8 +- .../c/private-fss_extended_read.c | 8 +- .../c/private-fss_extended_read.h | 4 +- level_3/fss_extended_write/c/fss_extended_write.c | 20 +- .../c/private-fss_extended_write.c | 26 +- level_3/iki_read/c/iki_read.c | 6 +- level_3/iki_read/c/private-iki_read.c | 24 +- level_3/iki_write/c/iki_write.c | 18 +- level_3/iki_write/c/private-iki_write.c | 2 +- level_3/init/c/init.c | 12 +- level_3/init/c/private-init.c | 8 +- 98 files changed, 6528 insertions(+), 4296 deletions(-) create mode 100644 level_0/f_string/c/private-string.c create mode 100644 level_0/f_string/c/private-string.h create mode 100644 level_0/f_string/c/string_dynamic.c create mode 100644 level_0/f_string/c/string_map.c create mode 100644 level_0/f_string/c/string_quantity.c create mode 100644 level_0/f_string/c/string_range.c create mode 100644 level_0/f_string/c/string_triple.c diff --git a/build/level_0/settings b/build/level_0/settings index 3da3373..071a55c 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 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 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 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-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 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 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 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-level thread.h thread-common.h build_sources_script build_sources_setting diff --git a/build/monolithic/settings b/build/monolithic/settings index 7dc676f..bef5671 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/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/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/environment.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/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/environment.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/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/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/environment.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/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/environment.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/level_0/f_memory/c/memory-common.h b/level_0/f_memory/c/memory-common.h index 5e17694..a53b00c 100644 --- a/level_0/f_memory/c/memory-common.h +++ b/level_0/f_memory/c/memory-common.h @@ -266,18 +266,18 @@ extern "C" { /** * Resize a generic memory structures. * - * status: the status to return. - * structures: the structures to operate on. - * type_stucture: the structure type. - * type_stuctures: the structures type. - * length: the new size of the array. - * length_variable: the data type of the length variable. + * status: the status to return. + * structures: the structures to operate on. + * type_stucture: the structure type. + * type_stuctures: the structures type. + * length: the new size of the array. + * type_length: the data type of the length variable type. */ #ifndef _di_f_macro_memory_structures_resize_ - #define f_macro_memory_structures_resize(status, structures, type_structure, type_structures, length, length_variable) \ + #define f_macro_memory_structures_resize(status, structures, type_structure, type_structures, length, type_length) \ status = F_none; \ if (length < structures.size) { \ - for (length_variable _macro__i = structures.size - length; _macro__i < structures.size; ++_macro__i) { \ + 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; \ } \ @@ -292,18 +292,18 @@ extern "C" { /** * Adjust a generic memory structures. * - * status: the status to return. - * structures: the structures to operate on. - * type_stucture: the structure type. - * type_stuctures: the structures type. - * length: the new size of the array. - * length_variable: the data type of the length variable. + * status: the status to return. + * structures: the structures to operate on. + * type_stucture: the structure type. + * type_stuctures: the structures type. + * length: the new size of the array. + * type_length: the data type of the length variable type. */ #ifndef _di_f_macro_memory_structures_adjust_ - #define f_macro_memory_structures_adjust(status, structures, type_structure, type_structures, length, length_variable) \ + #define f_macro_memory_structures_adjust(status, structures, type_structure, type_structures, length, type_length) \ status = F_none; \ if (length < structures.size) { \ - for (length_variable _macro__i = structures.size - length; _macro__i < structures.size; ++_macro__i) { \ + 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; \ } \ @@ -394,6 +394,177 @@ extern "C" { #endif // _di_f_macro_memory_structures_destroy_simple_ /** + * Increase a generic memory structures by 1. + * + * This only increases if the structure.used + 1 is greater than structure.size. + * + * status: the status to return. + * structures: the structures to operate on. + * type_stuctures: the structures type. + * type_length: the data type of the length variable type. + */ +#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; \ + } +#endif // _di_f_macro_memory_structures_increase_ + +/** + * Decrease a generic memory structures by 1. + * + * status: the status to return. + * structures: the structures to operate on. + * type_stucture: the structure type. + * type_stuctures: the structures type. + */ +#ifndef _di_f_macro_memory_structures_decrease_ + #define f_macro_memory_structures_decrease(status, structures, type_structure, type_structures) \ + status = F_none; \ + if (structures.size) { \ + f_macro_memory_structure_delete(status, structures.array[structures.size - 1], type_structure); \ + if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(type_structures), structures.size, structures.size - 1); \ + if (status == F_none) { \ + structures.size--; \ + if (structures.used > structures.size) structures.used = structures.size; \ + } \ + } \ + else { \ + status = F_data_not; \ + } +#endif // _di_f_macro_memory_structures_decrease_ + +/** + * Decimate a generic memory structures by 1. + * + * status: the status to return. + * structures: the structures to operate on. + * type_stucture: the structure type. + * type_stuctures: the structures type. + */ +#ifndef _di_f_macro_memory_structures_decimate_ + #define f_macro_memory_structures_decimate(status, structures, type_structure, type_structures) \ + status = F_none; \ + if (structures.size) { \ + f_macro_memory_structure_destroy(status, structures.array[structures.size - 1], type_structure); \ + if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(type_structures), structures.size, structures.size - 1); \ + if (status == F_none) { \ + structures.size--; \ + if (structures.used > structures.size) structures.used = structures.size; \ + } \ + } \ + else { \ + status = F_data_not; \ + } +#endif // _di_f_macro_memory_structures_decimate_ + +/** + * Increase a generic memory structures by the given amount. + * + * This only increases if the structure.used + amount is greater than structure.size. + * + * status: the status to return. + * structures: the structures to operate on. + * type_stuctures: the structures type. + * type_length: the data type of the length variable type. + * amount: the amount to increase by. + */ +#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; \ + } +#endif // _di_f_macro_memory_structures_increase_by_ + +/** + * Decrease a generic memory structures by the given amount. + * + * status: the status to return. + * 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. + */ +#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; \ + } \ + } \ + } \ + else { \ + status = F_data_not; \ + } +#endif // _di_f_macro_memory_structures_decrease_by_ + +/** + * Decimate a generic memory structures by the given amount. + * + * status: the status to return. + * 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. + */ +#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; \ + } \ + } \ + } \ + else { \ + status = F_data_not; \ + } +#endif // _di_f_macro_memory_structures_decimate_by_ + +/** * Provide a macro for calling other macros for incrementing a buffer. * * If the used + step is greater than size, then increase by step_default. diff --git a/level_0/f_string/c/private-string.c b/level_0/f_string/c/private-string.c new file mode 100644 index 0000000..b3fa01b --- /dev/null +++ b/level_0/f_string/c/private-string.c @@ -0,0 +1,424 @@ +#include "string.h" +#include "private-string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_f_string_dynamic_adjust_) + 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_macro_string_dynamic_t_adjust(status, (*string), length); + + return status; + } +#endif // !defined(_di_f_string_dynamic_adjust_) + +#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); + if (F_status_is_error(status)) return status; + } + + memcpy(destination->string + destination->used, source, length); + destination->used = destination->used + length; + + return F_none; + } +#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_mash_) + +#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_) + f_status_t private_f_string_append_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + + if (destination->used + length > f_string_length_t_size) { + return F_status_set_error(F_string_too_large); + } + + f_status_t status = F_none; + + f_string_length_t i = 0; + f_string_length_t first = 0; + f_string_length_t size = 0; + + for (; i < length; i++) { + + if (source[i]) continue; + + if (i && i > first) { + size = i - first; + + if (destination->used + size > destination->size) { + status = private_f_string_dynamic_increase_by(size, destination); + if (F_status_is_error(status)) return status; + } + + memcpy(destination->string + destination->used, source + first, size); + destination->used = destination->used + size; + } + + while (i + 1 < length && !source[i + 1]) { + i++; + } // while + + first = i + 1; + } // for + + if (i > first) { + size = i - first; + + if (destination->used + size > destination->size) { + status = private_f_string_dynamic_increase_by(size, destination); + if (F_status_is_error(status)) return status; + } + + memcpy(destination->string + destination->used, source + first, size); + destination->used = destination->used + size; + } + + return F_none; + } +#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_) || !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_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_delete_) + +#if !defined(_di_f_string_dynamic_decimate_) || !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_) || !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) { + + if (string->used + amount > string->size) { + if (string->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 F_none; + } +#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_) || !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_macro_string_dynamic_t_resize(status, (*string), length); + + return status; + } +#endif // !defined(_di_f_string_dynamic_decrease_) || !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_) + f_status_t private_f_string_dynamics_adjust(const f_string_length_t length, f_string_dynamics_t *strings) { + f_status_t status = F_none; + + f_macro_string_dynamics_t_adjust(status, (*strings), length); + + return status; + } +#endif // !defined(_di_f_string_dynamics_adjust_) + +#if !defined(_di_f_string_dynamics_decrease_) || !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; + + f_macro_string_dynamics_t_delete(status, (*string)); + + return status; + } +#endif // !defined(_di_f_string_dynamics_decrease_) || !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_delete_) + +#if !defined(_di_f_string_dynamics_decimate_) || !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) { + f_status_t status = F_none; + + f_macro_string_dynamics_t_destroy(status, (*string)); + + return status; + } +#endif // !defined(_di_f_string_dynamics_decimate_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_dynamics_destroy_) + +#if !defined(_di_f_string_dynamics_decrease_) || !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(_di_fl_string_dynamics_terminate_) || !defined(_di_fl_string_dynamics_terminate_after_) + 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; + + f_macro_string_dynamics_t_resize(status, (*strings), length); + + return status; + } +#endif // !defined(_di_f_string_dynamics_decrease_) || !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(_di_fl_string_dynamics_terminate_) || !defined(_di_fl_string_dynamics_terminate_after_) + +#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) { + f_status_t status = F_none; + + f_macro_string_maps_t_adjust(status, (*maps), length); + + return status; + } +#endif // !defined(_di_f_string_maps_adjust_) + +#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) { + f_status_t status = F_none; + + f_macro_string_maps_t_delete(status, (*maps)); + + return status; + } +#endif // !defined(f_string_maps_decrease) || !defined(f_string_maps_decrease_by) || !defined(_di_f_string_maps_delete_) + +#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) { + f_status_t status = F_none; + + f_macro_string_maps_t_destroy(status, (*maps)); + + return status; + } +#endif // !defined(f_string_maps_decimate) || !defined(f_string_maps_decimate_by) || !defined(_di_f_string_maps_destroy_) + +#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_) + 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); + + 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_) + +#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) { + + if (destination->used + length > f_string_length_t_size) { + return F_status_set_error(F_string_too_large); + } + + if (destination->used + length > destination->size) { + const f_status_t status = private_f_string_dynamic_increase_by(length, destination); + if (F_status_is_error(status)) return status; + } + + if (destination->used) { + memmove(destination->string + length, destination->string, destination->used); + memcpy(destination->string, source, length); + } + else { + memcpy(destination->string, source, length); + } + + destination->used = destination->used + length; + return F_none; + } +#endif // !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_) + +#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_) + f_status_t private_f_string_prepend_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + + if (destination->used + length > f_string_length_t_size) { + return F_status_set_error(F_string_too_large); + } + + f_status_t status = F_none; + + f_string_length_t first = 0; + f_string_length_t offset = 0; + + f_string_length_t size = 0; + + for (f_string_length_t i = 0; i <= length; i++) { + + if (i == length) { + if (i > first) { + size = i - first; + + if (destination->used + size > destination->size) { + status = private_f_string_dynamic_increase_by(size, destination); + if (F_status_is_error(status)) return status; + } + + memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); + memcpy(destination->string + offset, source + first, size); + + destination->used = destination->used + size; + offset += size; + } + + break; + } + + if (!source[i]) { + if (i > 0) { + if (i > first) { + size = i - first; + + if (destination->used + size > destination->size) { + status = private_f_string_dynamic_increase_by(size, destination); + if (F_status_is_error(status)) return status; + } + + memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); + memcpy(destination->string + offset, source + first, size); + + destination->used = destination->used + size; + offset += size; + } + } + + while (i + 1 < length && !source[i + 1]) { + i++; + } // while + + first = i + 1; + continue; + } + } // for + + return F_none; + } +#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_) + 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); + + return status; + } +#endif // !defined(_di_f_string_quantitys_adjust_) + +#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; + + f_macro_string_quantitys_t_delete(status, (*quantitys)); + + return status; + } +#endif // !defined(f_string_quantitys_decrease) || !defined(f_string_quantitys_decrease_by) || !defined(_di_f_string_quantitys_delete_) + +#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) { + f_status_t status = F_none; + + f_macro_string_quantitys_t_destroy(status, (*quantitys)); + + return status; + } +#endif // !defined(f_string_quantitys_decimate) || !defined(f_string_quantitys_decimate_by) || !defined(_di_f_string_quantitys_destroy_) + +#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; + + f_macro_string_quantitys_t_resize(status, (*quantitys), 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_) + +#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) { + f_status_t status = F_none; + + f_macro_string_ranges_t_adjust(status, (*ranges), length); + + return status; + } +#endif // !defined(_di_f_string_ranges_adjust_) + +#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; + + f_macro_string_ranges_t_delete(status, (*ranges)); + + return status; + } +#endif // !defined(f_string_ranges_decrease) || !defined(f_string_ranges_decrease_by) || !defined(_di_f_string_ranges_delete_) + +#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; + + f_macro_string_ranges_t_destroy(status, (*ranges)); + + return status; + } +#endif // !defined(f_string_ranges_decimate) || !defined(f_string_ranges_decimate_by) || !defined(_di_f_string_ranges_destroy_) + +#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); + + 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) { + f_status_t status = F_none; + + f_macro_string_triples_t_adjust(status, (*triples), length); + + return status; + } +#endif // !defined(_di_f_string_triples_adjust_) + +#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) { + f_status_t status = F_none; + + f_macro_string_triples_t_delete(status, (*triples)); + + return status; + } +#endif // !defined(f_string_triples_decrease) || !defined(f_string_triples_decrease_by) || !defined(_di_f_string_triples_delete_) + +#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) { + f_status_t status = F_none; + + f_macro_string_triples_t_destroy(status, (*triples)); + + return status; + } +#endif // !defined(f_string_triples_decimate) || !defined(f_string_triples_decimate_by) || !defined(_di_f_string_triples_destroy_) + +#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); + + return status; + } +#endif // !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_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_string/c/private-string.h b/level_0/f_string/c/private-string.h new file mode 100644 index 0000000..0751985 --- /dev/null +++ b/level_0/f_string/c/private-string.h @@ -0,0 +1,739 @@ +/** + * FLL - Level 0 + * + * Project: String + * 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_string_h +#define _PRIVATE_F_string_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Private implementation for resizing. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The new size to use. + * @param string + * The string to adjust. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_dynamic_t_adjust(). + * + * @see f_macro_string_dynamic_t_adjust() + * @see f_string_dynamic_adjust() + */ +#if !defined(_di_f_string_dynamic_adjust_) + extern f_status_t private_f_string_dynamic_adjust(const f_string_length_t length, f_string_dynamic_t *string) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_dynamic_adjust_) + +/** + * Private implementation of f_string_append(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param source + * The source string to append. + * @param length + * Length of source to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * + * @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() + */ +#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; +#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_mash_) + +/** + * Private implementation of f_string_append_nulless(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param source + * The source string to append. + * @param length + * Length of source to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * + * @see memcpy() + * + * @see f_macro_string_dynamic_t_resize() + * @see f_string_append_nulless() + * @see f_string_dynamic_append_nulless() + * @see f_string_dynamic_mash_nulless() + * @see f_string_mash_nulless() + */ +#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() + * @see f_string_dynamic_decrease_by() + * @see f_string_dynamic_delete() + */ +#if !defined(_di_f_string_dynamic_decrease_) || !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_) || !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() + * @see f_string_dynamic_decimate_by() + * @see f_string_dynamic_destroy() + */ +#if !defined(_di_f_string_dynamic_decimate_) || !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_) || !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. + * + * @param amount + * A positive number representing how much to increase the size by. + * @param string + * The string to resize. + * + * @return + * 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(). + * + * @see memcpy() + * + * @see f_string_append() + * @see f_string_append_mash() + * @see f_string_append_nulless() + * @see f_string_dynamic_append() + * @see f_string_dynamic_append_nulless() + * @see f_string_dynamic_increase_by() + * @see f_string_dynamic_mash() + * @see f_string_dynamic_mash_nulless() + * @see f_string_dynamic_prepend() + * @see f_string_dynamic_prepend_nulless() + * @see f_string_mash_nulless() + * @see f_string_prepend() + * @see f_string_prepend_nulless() + */ +#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_) + extern f_status_t private_f_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *string) f_gcc_attribute_visibility_internal; +#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_) + +/** + * Private implementation for resizing. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The new size to use. + * @param string + * The string to resize. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * + * @see f_macro_string_dynamic_t_resize() + * @see f_string_dynamic_decrease() + * @see f_string_dynamic_decrease_by() + * @see f_string_dynamic_increase() + * @see f_string_dynamic_increase_by() + * @see f_string_dynamic_terminate() + * @see f_string_dynamic_terminate_after() + */ +#if !defined(_di_f_string_dynamic_decrease_) || !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_) + extern f_status_t private_f_string_dynamic_resize(const f_string_length_t length, f_string_dynamic_t *string) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_f_string_dynamic_decrease_) || !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_) + +/** + * Private implementation for resizing. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The new size to use. + * @param strings + * The strings to adjust. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_dynamics_t_adjust(). + * + * @see f_macro_string_dynamics_t_adjust() + * @see f_string_dynamics_adjust() + */ +#if !defined(_di_f_string_dynamics_adjust_) + 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_) + +/** + * 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() + * @see f_string_dynamics_decrease_by() + * @see f_string_dynamics_delete() + */ +#if !defined(_di_f_string_dynamics_decrease_) || !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_) || !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() + * @see f_string_dynamics_decimate_by() + * @see f_string_dynamics_destroy() + */ +#if !defined(_di_f_string_dynamics_decimate_) || !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_) || !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. + * + * @param length + * The new size to use. + * @param strings + * The strings to resize. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_dynamics_t_resize(). + * + * @see f_macro_string_dynamics_t_resize() + * @see f_string_dynamics_decrease() + * @see f_string_dynamics_decrease_by() + * @see f_string_dynamics_increase() + * @see f_string_dynamics_increase_by() + * @see fl_string_dynamics_terminate() + * @see fl_string_dynamics_terminate_after() + */ +#if !defined(_di_f_string_dynamics_decrease_) || !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(_di_fl_string_dynamics_terminate_) || !defined(_di_fl_string_dynamics_terminate_after_) + 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; +#endif // !defined(_di_f_string_dynamics_decrease_) || !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(_di_fl_string_dynamics_terminate_) || !defined(_di_fl_string_dynamics_terminate_after_) + +/** + * 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 adjust. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_maps_t_adjust(). + * + * @see f_macro_string_maps_t_adjust() + * @see f_string_maps_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_) + +/** + * Private implementation of f_string_maps_delete(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param maps + * The maps to delete. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_maps_t_delete(). + * + * @see f_string_maps_decrease() + * @see f_string_maps_decrease_by() + * @see f_string_maps_delete() + */ +#if !defined(f_string_maps_decrease) || !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) || !defined(f_string_maps_decrease_by) || !defined(_di_f_string_maps_delete_) + +/** + * Private implementation of f_string_maps_destroy(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param maps + * The maps to destroy. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_maps_t_destroy(). + * + * @see f_string_maps_decimate() + * @see f_string_maps_decimate_by() + * @see f_string_maps_destroy() + */ +#if !defined(f_string_maps_decimate) || !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) || !defined(f_string_maps_decimate_by) || !defined(_di_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 resize. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_maps_t_resize(). + * + * @see f_macro_string_dynamic_t_resize() + * @see f_string_maps_decrease() + * @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() + */ +#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_) + 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; +#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_) + +/** + * Private implementation of f_string_prepend(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param source + * The source string to prepend. + * @param length + * Length of source to append. + * @param destination + * The destination string the source and glue are prepended onto. + * + * @return + * 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(). + * + * @see memcopy() + * @see memmove() + * + * @see f_string_dynamic_mish() + * @see f_string_dynamic_partial_mish() + * @see f_string_dynamic_partial_prepend_assure() + * @see f_string_dynamic_partial_prepend() + * @see f_string_dynamic_prepend_assure() + * @see f_string_dynamic_prepend() + * @see f_string_mish() + * @see f_string_prepend_assure() + * @see f_string_prepend() + */ +#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; +#endif // !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_) + +/** + * Private implementation of f_string_prepend_nulless(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param source + * The source string to prepend. + * @param length + * Length of source to append. + * @param destination + * The destination string the source and glue are prepended onto. + * + * @return + * 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(). + * + * @see memcopy() + * @see memmove() + * + * @see f_string_dynamic_mish_nulless() + * @see f_string_dynamic_partial_mish_nulless() + * @see f_string_dynamic_partial_prepend_assure_nulless() + * @see f_string_dynamic_partial_prepend_nulless() + * @see f_string_dynamic_prepend_assure_nulless() + * @see f_string_dynamic_prepend_nulless() + * @see f_string_mish_nulless() + * @see f_string_prepend_assure_nulless() + * @see f_string_prepend_nulless() + */ +#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; +#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_) + +/** + * Private implementation for resizing. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The new size to use. + * @param quantitys + * The quantitys to adjust. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_quantitys_t_adjust(). + * + * @see f_macro_string_quantitys_t_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() + * @see f_string_quantitys_decrease_by() + * @see f_string_quantitys_delete() + */ +#if !defined(f_string_quantitys_decrease) || !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) || !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() + * @see f_string_quantitys_decimate_by() + * @see f_string_quantitys_destroy() + */ +#if !defined(f_string_quantitys_decimate) || !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) || !defined(f_string_quantitys_decimate_by) || !defined(_di_f_string_quantitys_destroy_) + +/** + * Private implementation for resizing. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The new size to use. + * @param quantitys + * The quantitys to resize. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_quantitys_t_resize(). + * + * @see f_macro_string_dynamic_t_resize() + * @see f_string_quantitys_decrease() + * @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() + */ +#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_) + 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; +#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_) + +/** + * 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 adjust. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_ranges_t_adjust(). + * + * @see f_macro_string_ranges_t_adjust() + * @see f_string_ranges_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_) + +/** + * Private implementation of f_string_ranges_delete(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param ranges + * The ranges to delete. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_ranges_t_delete(). + * + * @see f_string_ranges_decrease() + * @see f_string_ranges_decrease_by() + * @see f_string_ranges_delete() + */ +#if !defined(f_string_ranges_decrease) || !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) || !defined(f_string_ranges_decrease_by) || !defined(_di_f_string_ranges_delete_) + +/** + * Private implementation of f_string_ranges_destroy(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param ranges + * The ranges to destroy. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_ranges_t_destroy(). + * + * @see f_string_ranges_decimate() + * @see f_string_ranges_decimate_by() + * @see f_string_ranges_destroy() + */ +#if !defined(f_string_ranges_decimate) || !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) || !defined(f_string_ranges_decimate_by) || !defined(_di_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 resize. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_ranges_t_resize(). + * + * @see f_macro_string_dynamic_t_resize() + * @see f_string_ranges_decrease() + * @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() + */ +#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_) + 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; +#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_) + +/** + * 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 adjust. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_triples_t_adjust(). + * + * @see f_macro_string_triples_t_adjust() + * @see f_string_triples_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_) + +/** + * Private implementation of f_string_triples_delete(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param triples + * The triples to delete. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_triples_t_delete(). + * + * @see f_string_triples_decrease() + * @see f_string_triples_decrease_by() + * @see f_string_triples_delete() + */ +#if !defined(f_string_triples_decrease) || !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) || !defined(f_string_triples_decrease_by) || !defined(_di_f_string_triples_delete_) + +/** + * Private implementation of f_string_triples_destroy(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param triples + * The triples to destroy. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_triples_t_destroy(). + * + * @see f_string_triples_decimate() + * @see f_string_triples_decimate_by() + * @see f_string_triples_destroy() + */ +#if !defined(f_string_triples_decimate) || !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) || !defined(f_string_triples_decimate_by) || !defined(_di_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 resize. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_macro_string_triples_t_resize(). + * + * @see f_macro_string_dynamic_t_resize() + * @see f_string_triples_decrease() + * @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() + */ +#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_) + 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; +#endif // !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_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_F_string_h diff --git a/level_0/f_string/c/string-common.c b/level_0/f_string/c/string-common.c index 0fac8ca..9e0987b 100644 --- a/level_0/f_string/c/string-common.c +++ b/level_0/f_string/c/string-common.c @@ -1,4 +1,5 @@ #include "string.h" +#include "private-string.h" #ifdef __cplusplus extern "C" { @@ -114,7 +115,6 @@ extern "C" { const f_string_t f_string_ascii_slash_forward_s = f_string_ascii_slash_forward; const f_string_t f_string_ascii_slash_backward_s = f_string_ascii_slash_backward; const f_string_t f_string_ascii_tilde_s = f_string_ascii_tilde; - #endif // _di_string_ascii_s_ #ifdef __cplusplus diff --git a/level_0/f_string/c/string-common.h b/level_0/f_string/c/string-common.h index a3d0d26..89d9639 100644 --- a/level_0/f_string/c/string-common.h +++ b/level_0/f_string/c/string-common.h @@ -124,6 +124,14 @@ extern "C" { #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_decrease(status, string_lengths) f_macro_memory_structures_decrease(status, string_lengths, f_string_length_t, f_string_lengths_t); + #define f_macro_string_lengthss_t_decimate(status, string_lengths) f_macro_memory_structures_decimate(status, string_lengths, f_string_length_t, f_string_lengths_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.c b/level_0/f_string/c/string.c index fe3d96b..3579cc6 100644 --- a/level_0/f_string/c/string.c +++ b/level_0/f_string/c/string.c @@ -1,12 +1,889 @@ #include "string.h" +#include "private-string.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_f_string_static_empty_s_ - const f_string_static_t f_string_static_empty_s = f_macro_string_static_t_initialize("", 0); -#endif // _di_f_string_static_empty_s_ +#ifndef _di_f_string_append_ + f_status_t f_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + return private_f_string_append(source, length, destination); + } +#endif // _di_f_string_append_ + +#ifndef _di_f_string_append_assure_ + f_status_t f_string_append_assure(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + if (destination->used < length) return private_f_string_append(source, length, destination); + + f_string_length_t i = 1; + f_string_length_t j = 1; + + while (i <= length && j <= destination->used) { + if (!source[length - i]) { + i++; + continue; + } + + if (!destination->string[destination->used - j]) { + j++; + continue; + } + + if (source[length - i] != destination->string[destination->used - j]) { + return private_f_string_append(source, length, destination); + } + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_append_assure_ + +#ifndef _di_f_string_append_assure_nulless_ + f_status_t f_string_append_assure_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + if (destination->used < length) { + return private_f_string_append_nulless(source, length, destination); + } + + f_string_length_t i = 1; + f_string_length_t j = 1; + + while (i <= length && j <= destination->used) { + if (!source[length - i]) { + i++; + continue; + } + + if (!destination->string[destination->used - j]) { + j++; + continue; + } + + if (source[length - i] != destination->string[destination->used - j]) { + return private_f_string_append_nulless(source, length, destination); + } + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_append_assure_nulless_ + +#ifndef _di_f_string_append_nulless_ + f_status_t f_string_append_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + return private_f_string_append_nulless(source, length, destination); + } +#endif // _di_f_string_append_nulless_ + +#ifndef _di_f_string_dynamic_append_ + f_status_t f_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + return private_f_string_append(source.string, source.used, destination); + } +#endif // _di_f_string_dynamic_append_ + +#ifndef _di_f_string_dynamic_append_assure_ + f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + if (destination->used < source.used) { + return private_f_string_append(source.string, source.used, destination); + } + + f_string_length_t i = 1; + f_string_length_t j = 1; + + while (i <= source.used && j <= destination->used) { + if (!source.string[source.used - i]) { + i++; + continue; + } + + if (!destination->string[destination->used - j]) { + j++; + continue; + } + + if (source.string[source.used - i] != destination->string[destination->used - j]) { + return private_f_string_append(source.string, source.used, destination); + } + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_dynamic_append_assure_ + +#ifndef _di_f_string_dynamic_append_assure_nulless_ + f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + if (destination->used < source.used) { + return private_f_string_append_nulless(source.string, source.used, destination); + } + + f_string_length_t i = 1; + f_string_length_t j = 1; + + while (i <= source.used && j <= destination->used) { + if (!source.string[source.used - i]) { + i++; + continue; + } + + if (!destination->string[destination->used - j]) { + j++; + continue; + } + + if (source.string[source.used - i] != destination->string[destination->used - j]) { + return private_f_string_append_nulless(source.string, source.used, destination); + } + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_dynamic_append_assure_nulless_ + +#ifndef _di_f_string_dynamic_append_nulless_ + f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + return private_f_string_append_nulless(source.string, source.used, destination); + } +#endif // _di_f_string_dynamic_append_nulless_ + +#ifndef _di_f_string_dynamic_mash_ + f_status_t f_string_dynamic_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + if (glue_length && destination->used) { + const f_status_t status = private_f_string_append(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_append(source.string, source.used, destination); + } +#endif // _di_f_string_dynamic_mash_ + +#ifndef _di_f_string_dynamic_mash_nulless_ + f_status_t f_string_dynamic_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + if (glue_length && destination->used) { + const f_status_t status = private_f_string_append_nulless(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_append_nulless(source.string, source.used, destination); + } +#endif // _di_f_string_dynamic_mash_nulless_ + +#ifndef _di_f_string_dynamic_mish_ + f_status_t f_string_dynamic_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + if (glue_length && destination->used) { + const f_status_t status = private_f_string_prepend(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_prepend(source.string, source.used, destination); + } +#endif // _di_f_string_dynamic_mish_ + +#ifndef _di_f_string_dynamic_mish_nulless_ + f_status_t f_string_dynamic_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + if (glue_length && destination->used) { + const f_status_t status = private_f_string_prepend_nulless(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_prepend_nulless(source.string, source.used, destination); + } +#endif // _di_f_string_dynamic_mish_nulless_ + +#ifndef _di_f_string_dynamic_partial_append_ + f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + return private_f_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); + } +#endif // _di_f_string_dynamic_partial_append_ + +#ifndef _di_f_string_dynamic_partial_append_assure_ + f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + const f_string_length_t length = (range.stop - range.start) + 1; + + if (destination->used < length) { + return private_f_string_append(source.string + range.start, length, destination); + } + + f_string_length_t i = 1; + f_string_length_t j = 1; + + while (i <= length && j <= destination->used) { + if (!source.string[range.stop - i]) { + i++; + continue; + } + + if (!destination->string[destination->used - j]) { + j++; + continue; + } + + if (source.string[range.stop - i] != destination->string[destination->used - j]) { + return private_f_string_append(source.string + range.start, length, destination); + } + + i++; + j++; + } // while + } +#endif // _di_f_string_dynamic_partial_append_assure_ + +#ifndef _di_f_string_dynamic_partial_append_assure_nulless_ + f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + const f_string_length_t length = (range.stop - range.start) + 1; + + if (destination->used < length) { + return private_f_string_append_nulless(source.string + range.start, length, destination); + } + + f_string_length_t i = 1; + f_string_length_t j = 1; + + while (i <= length && j <= destination->used) { + if (!source.string[range.stop - i]) { + i++; + continue; + } + + if (!destination->string[destination->used - j]) { + j++; + continue; + } + + if (source.string[range.stop - i] != destination->string[destination->used - j]) { + return private_f_string_append_nulless(source.string + range.start, length, destination); + } + + i++; + j++; + } // while + } +#endif // _di_f_string_dynamic_append_assure_nulless_ + +#ifndef _di_f_string_dynamic_partial_append_nulless_ + f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + return private_f_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); + } +#endif // _di_f_string_dynamic_partial_append_nulless_ + +#ifndef _di_f_string_dynamic_partial_mash_ + f_status_t f_string_dynamic_partial_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + if (glue_length && destination->used) { + f_status_t status = private_f_string_append(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); + } +#endif // _di_f_string_dynamic_partial_mash_ + +#ifndef _di_f_string_dynamic_partial_mash_nulless_ + f_status_t f_string_dynamic_partial_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + if (glue_length && destination->used) { + f_status_t status = private_f_string_append_nulless(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); + } +#endif // _di_f_string_dynamic_partial_mash_nulless_ + +#ifndef _di_f_string_dynamic_partial_mish_ + f_status_t fl_string_partial_dynamic_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + if (glue_length && destination->used) { + f_status_t status = private_f_string_prepend(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination); + } +#endif // _di_f_string_dynamic_partial_mish_ + +#ifndef _di_f_string_dynamic_partial_mish_nulless_ + f_status_t f_string_dynamic_partial_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + if (glue_length && destination->used) { + f_status_t status = private_f_string_prepend_nulless(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); + } +#endif // _di_f_string_dynamic_partial_mish_nulless_ + +#ifndef _di_f_string_dynamic_partial_prepend_ + f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + return private_f_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination); + } +#endif // _di_f_string_dynamic_partial_prepend_ + +#ifndef _di_f_string_dynamic_partial_prepend_assure_ + f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + const f_string_length_t length = (range.stop - range.start) + 1; + + if (destination->used < length) { + return private_f_string_prepend(source.string + range.start, length, destination); + } + + f_string_length_t i = 0; + f_string_length_t j = 0; + + while (i < length && j < destination->used) { + if (!source.string[i + range.start]) { + i++; + continue; + } + + if (!destination->string[j]) { + j++; + continue; + } + + if (source.string[i + range.start] != destination->string[i]) { + return private_f_string_prepend(source.string + range.start, length, destination); + } + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_dynamic_partial_prepend_assure_ + +#ifndef _di_f_string_dynamic_partial_prepend_assure_nulless_ + f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + const f_string_length_t length = (range.stop - range.start) + 1; + + if (destination->used < length) { + return private_f_string_prepend_nulless(source.string + range.start, length, destination); + } + + f_string_length_t i = 0; + f_string_length_t j = 0; + + while (i < length && j < destination->used) { + if (!source.string[i + range.start]) { + i++; + continue; + } + + if (!destination->string[j]) { + j++; + continue; + } + + if (source.string[i + range.start] != destination->string[i]) { + return private_f_string_prepend_nulless(source.string + range.start, length, destination); + } + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_dynamic_partial_prepend_assure_nulless + +#ifndef _di_f_string_dynamic_partial_prepend_nulless_ + f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; + + return private_f_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); + } +#endif // _di_f_string_dynamic_partial_prepend_nulless + +#ifndef _di_f_string_dynamic_prepend_ + f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + return private_f_string_prepend(source.string, source.used, destination); + } +#endif // _di_f_string_dynamic_prepend_ + +#ifndef _di_f_string_dynamic_prepend_assure_ + f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + if (destination->used < source.used) { + return private_f_string_prepend(source.string, source.used, destination); + } + + f_string_length_t i = 0; + f_string_length_t j = 0; + + while (i < source.used && j < destination->used) { + if (!source.string[i]) { + i++; + continue; + } + + if (!destination->string[j]) { + j++; + continue; + } + + if (source.string[i] != destination->string[i]) { + return private_f_string_prepend(source.string, source.used, destination); + } + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_dynamic_prepend_assure_ + +#ifndef _di_f_string_dynamic_prepend_assure_nulless_ + f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + if (destination->used < source.used) { + return private_f_string_prepend_nulless(source.string, source.used, destination); + } + + f_string_length_t i = 0; + f_string_length_t j = 0; + + while (i < source.used && j < destination->used) { + if (!source.string[i]) { + i++; + continue; + } + + if (!destination->string[j]) { + j++; + continue; + } + + if (source.string[i] != destination->string[i]) { + return private_f_string_prepend_nulless(source.string, source.used, destination); + } + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_dynamic_prepend_assure_nulless_ + +#ifndef _di_f_string_dynamic_prepend_nulless_ + f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!source.used) return F_data_not_eos; + + return private_f_string_prepend_nulless(source.string, source.used, destination); + } +#endif // _di_f_string_dynamic_prepend_nulless_ + +#ifndef _di_f_string_dynamic_terminate_ + f_status_t f_string_dynamic_terminate(f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + if (destination->used > destination->size) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!destination->used && destination->size && !destination->string[destination->used - 1]) { + return F_none; + } + + if (destination->used == f_string_length_t_size) { + return F_status_set_error(F_string_too_large); + } + + const f_string_length_t total = destination->used + 1; + + if (total > destination->size) { + const f_status_t status = private_f_string_dynamic_resize(total, destination); + if (F_status_is_error(status)) return status; + } + + destination->string[destination->used] = 0; + destination->used = total; + + return F_none; + } +#endif // _di_f_string_dynamic_terminate_ + +#ifndef _di_f_string_dynamic_terminate_after_ + f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + if (destination->used > destination->size) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (destination->used) { + for (; destination->used; destination->used--) { + if (!destination->string[destination->used - 1]) continue; + break; + } // for + } + + if (destination->used == f_string_length_t_size) { + return F_status_set_error(F_string_too_large); + } + + const f_string_length_t total = destination->used + 1; + + if (total > destination->size) { + const f_status_t status = private_f_string_dynamic_resize(total, destination); + if (F_status_is_error(status)) return status; + } + + destination->string[destination->used] = 0; + destination->used = total - 1; + + return F_none; + } +#endif // _di_f_string_dynamic_terminate_after_ + +#ifndef _di_f_string_mash_ + f_status_t f_string_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + if (glue_length && destination->used) { + f_status_t status = private_f_string_append(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_append(source, length, destination); + } +#endif // _di_f_string_mash_ + +#ifndef _di_f_string_mash_nulless_ + f_status_t f_string_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + if (glue_length && destination->used) { + f_status_t status = private_f_string_append_nulless(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_append_nulless(source, length, destination); + } +#endif // _di_f_string_mash_nulless_ + +#ifndef _di_f_string_mish_ + f_status_t f_string_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + if (glue_length && destination->used) { + f_status_t status = private_f_string_prepend(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_prepend(source, length, destination); + } +#endif // _di_f_string_mish_ + +#ifndef _di_f_string_mish_nulless_ + f_status_t f_string_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + if (glue_length && destination->used) { + f_status_t status = private_f_string_prepend_nulless(glue, glue_length, destination); + if (F_status_is_error(status)) return status; + } + + return private_f_string_prepend_nulless(source, length, destination); + } +#endif // _di_f_string_mish_nulless_ + +#ifndef _di_f_string_prepend_ + f_status_t f_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + return private_f_string_prepend(source, length, destination); + } +#endif // _di_f_string_prepend_ + +#ifndef _di_f_string_prepend_assure_ + f_status_t f_string_prepend_assure(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + if (destination->used < length) return private_f_string_prepend(source, length, destination); + + f_string_length_t i = 0; + f_string_length_t j = 0; + + while (i < length && j < destination->used) { + if (!source[i]) { + i++; + continue; + } + + if (!destination->string[j]) { + j++; + continue; + } + + if (source[i] != destination->string[i]) return private_f_string_prepend(source, length, destination); + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_prepend_assure_ + +#ifndef _di_f_string_prepend_assure_nulless_ + f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + if (destination->used < length) return private_f_string_prepend_nulless(source, length, destination); + + f_string_length_t i = 0; + f_string_length_t j = 0; + + while (i < length && j < destination->used) { + if (!source[i]) { + i++; + continue; + } + + if (!destination->string[j]) { + j++; + continue; + } + + if (source[i] != destination->string[i]) return private_f_string_prepend_nulless(source, length, destination); + + i++; + j++; + } // while + + return F_none; + } +#endif // _di_f_string_prepend_assure_nulless_ + +#ifndef _di_f_string_prepend_nulless_ + f_status_t f_string_prepend_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { + #ifndef _di_level_1_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ + + if (!length) return F_data_not_eos; + + return private_f_string_prepend_nulless(source, length, destination); + } +#endif // _di_f_string_prepend_nulless_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string.h b/level_0/f_string/c/string.h index 0c9a0d8..2389d49 100644 --- a/level_0/f_string/c/string.h +++ b/level_0/f_string/c/string.h @@ -33,6 +33,941 @@ extern "C" { #endif +/** + * Append the source string onto the destination. + * + * @param source + * The source string to append. + * @param length + * The length of source to append. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_append_ + extern f_status_t f_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_append_ + +/** + * Append the source string onto the destination, but only if the string is not already at the end. + * + * This ignores NULL characters when comparing both the source and the destination. + * + * @param source + * The source string to append. + * @param length + * The length of source to append. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_append_assure_ + extern f_status_t f_string_append_assure(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_append_assure_ + +/** + * Append the source string onto the destination, but only if the string is not already at the end. + * + * This ignores NULL characters when comparing both the source and the destination. + * Skips over NULL characters from source when appending. + * + * @param source + * The source string to append. + * @param length + * The length of source to append. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_append_assure_nulless_ + extern f_status_t f_string_append_assure_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_append_assure_nulless_ + +/** + * Append the source string onto the destination. + * + * Skips over NULL characters from source when appending. + * + * @param source + * The source string to append. + * @param length + * The length of source to append. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_append_nulless_ + extern f_status_t f_string_append_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_append_nulless_ + +/** + * Append the source string onto the destination. + * + * @param source + * The source string to append. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_dynamic_append_ + extern f_status_t f_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_append_ + +/** + * Append the source string onto the destination. + * + * @param source + * The source string to append. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_dynamic_append_assure_ + extern f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_append_assure_ + +/** + * Append the source string onto the destination. + * + * Skips over NULL characters from source when appending. + * + * @param source + * The source string to append. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_dynamic_append_assure_nulless_ + extern f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_append_assure_nulless_ + +/** + * Append the source string onto the destination. + * + * Skips over NULL characters from source when appending. + * + * @param source + * The source string to append. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_dynamic_append_nulless_ + extern f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_append_nulless_ + +/** + * Append the source string onto the destination with the glue in between. + * + * If the destination string is empty, then no glue is appended. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_dynamic_mash_ + extern f_status_t f_string_dynamic_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_mash_ + +/** + * Append the source string onto the destination with the glue in between. + * + * If the destination string is empty, then no glue is appended. + * + * Skips over NULL characters from glue and source when appending. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_dynamic_mash_nulless_ + extern f_status_t f_string_dynamic_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_mash_nulless_ + +/** + * Prepend the source string onto the destination with the glue in between. + * + * If the destination string is empty, then no glue is appended. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_dynamic_mish_ + extern f_status_t f_string_dynamic_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_mish_ + +/** + * Prepend the source string onto the destination with the glue in between. + * + * If the destination string is empty, then no glue is appended. + * + * Skips over NULL characters from glue and source when appending. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_dynamic_mish_nulless_ + extern f_status_t f_string_dynamic_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_mish_nulless_ + +/** + * Append the source string onto the destination, but restricted to the given range. + * + * @param source + * The source string to append. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_append_ + extern f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_append_ + +/** + * Append the source string onto the destination, but only if the string is not already at the end and restricted to the given range + * + * This ignores NULL characters when comparing both the source and the destination. + * + * @param source + * The source string to append. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_append_assure_ + extern f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_append_assure_ + +/** + * Append the source string onto the destination, but only if the string is not already at the end and restricted to the given range + * + * This ignores NULL characters when comparing both the source and the destination. + * + * Skips over NULL characters from source when appending. + * + * @param source + * The source string to append. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_append_assure_nulless_ + extern f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_append_assure_nulless_ + +/** + * Append the source string onto the destination, but restricted to the given range. + * + * Skips over NULL characters from source when appending. + * + * @param source + * The source string to append. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source is appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_append_nulless_ + extern f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_append_nulless_ + +/** + * Append the source string onto the destination with the glue in between, but restricted to the given range. + * + * If the destination string is empty, then no glue is appended. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_mash_ + extern f_status_t f_string_dynamic_partial_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_mash_ + +/** + * Append the source string onto the destination with the glue in between, but restricted to the given range. + * + * If the destination string is empty, then no glue is appended. + * + * Skips over NULL characters from glue and source when appending. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_mash_nulless_ + extern f_status_t f_string_dynamic_partial_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_mash_nulless_ + +/** + * Prepend the source string onto the destination with the glue in between, but restricted to the given range. + * + * If the destination string is empty, then no glue is appended. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_mish_ + extern f_status_t f_string_dynamic_partial_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_mish_ + +/** + * Prepend the source string onto the destination with the glue in between, but restricted to the given range. + * + * If the destination string is empty, then no glue is appended. + * + * Skips over NULL characters from glue and source when appending. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_mish_nulless_ + extern f_status_t f_string_dynamic_partial_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_mish_nulless_ + +/** + * Prepend the source string onto the destination, but restricted to the given range. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * @param source + * The source string to prepend. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_prepend_ + extern f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_prepend_ + +/** + * Prepend the source string onto the destination, but only if the string is not already at the end and restricted to the given range + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * This ignores NULL characters when comparing both the source and the destination. + * + * @param source + * The source string to prepend. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_prepend_assure_ + extern f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_prepend_assure_ + +/** + * Prepend the source string onto the destination, but only if the string is not already at the end and restricted to the given range + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * This ignores NULL characters when comparing both the source and the destination. + * + * @param source + * The source string to prepend. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_prepend_assure_nulless_ + extern f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_prepend_assure_nulless_ + +/** + * Prepend the source string onto the destination, but restricted to the given range. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * @param source + * The source string to prepend. + * @param range + * A range within the source to restrict the copy from. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_partial_prepend_nulless_ + extern f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_partial_prepend_nulless_ + +/** + * Prepend the source string onto the destination. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * @param source + * The source string to prepend. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_prepend_ + extern f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_prepend_ + +/** + * Prepend the source string onto the destination, but only if the string is not already at the beginning. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * This ignores NULL characters when comparing both the source and the destination. + * + * @param source + * The source string to prepend. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_prepend_assure_ + extern f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_prepend_assure_ + +/** + * Prepend the source string onto the destination, but only if the string is not already at the beginning. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * This ignores NULL characters when comparing both the source and the destination. + * + * @param source + * The source string to prepend. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_prepend_assure_nulless_ + extern f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_prepend_assure_nulless_ + +/** + * Prepend the source string onto the destination. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * @param source + * The source string to prepend. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_data_not_stop if range.start > range.stop. + * 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_prepend_nulless_ + extern f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_prepend_nulless_ + +/** + * Guarantee that an end of string (NULL) exists at the end of the string. + * + * This is intended to be used for anything requiring NULL terminated strings. + * This will reallocate more space if necessary. + * + * If destination size is 0, then it will be reallocated and have the NULL assigned at index 0. + * + * @param destination + * The new string, which will be allocated or reallocated as necessary. + * + * @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_string_too_large (with error bit) if string is too large to fit into the buffer. + */ +#ifndef _di_f_string_dynamic_terminate_ + extern f_status_t f_string_dynamic_terminate(f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_terminate_ + +/** + * Guarantee that an end of string (NULL) exists at the end of the string. + * + * This ensures that the terminating NULL not only exists but is not counted in destination.used. + * + * This is intended to be used for anything requiring NULL terminated strings whose used length cannot be counted. + * This will reallocate more space if necessary. + * + * If destination size is 0, then it will be reallocated and have the NULL assigned at index 0. + * + * @param destination + * The new string, which will be allocated or reallocated as necessary. + * + * @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_string_too_large (with error bit) if string is too large to fit into the buffer. + */ +#ifndef _di_f_string_dynamic_terminate_after_ + extern f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t *destination); +#endif // _di_f_string_dynamic_terminate_after_ + +/** + * Append the source string onto the destination with the glue in between. + * + * If the destination string is empty, then no glue is appended. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param length + * The length of source to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_mash_ + extern f_status_t f_string_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_mash_ + +/** + * Append the source string onto the destination with the glue in between. + * + * If the destination string is empty, then no glue is appended. + * + * Skips over NULL characters from glue and source when appending. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param length + * The length of source to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_mash_nulless_ + extern f_status_t f_string_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_mash_nulless_ + +/** + * Prepend the source string onto the destination with the glue in between. + * + * If the destination string is empty, then no glue is appended. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param length + * The length of source to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_mish_ + extern f_status_t f_string_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_mish_ + +/** + * Prepend the source string onto the destination with the glue in between. + * + * If the destination string is empty, then no glue is appended. + * + * Skips over NULL characters from glue and source when appending. + * + * @param glue + * A string to append between the source and destination, such as a space: ' '. + * @param glue_length + * The number of bytes the glue takes up. + * @param source + * The source string to append. + * @param length + * The length of source to append. + * @param destination + * The destination string the source and glue are appended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_mish_nulless_ + extern f_status_t f_string_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_mish_nulless_ + +/** + * Prepend the source string onto the destination. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * @param source + * The source string to prepend. + * @param length + * The length of source to append. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_prepend_ + extern f_status_t f_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_prepend_ + +/** + * Prepend the source string onto the destination, but only if the string is not already at the beginning. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * This ignores NULL characters when comparing both the source and the destination. + * + * @param source + * The source string to prepend. + * @param length + * The length of source to append. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_prepend_assure_ + extern f_status_t f_string_prepend_assure(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_prepend_assure_ + +/** + * Prepend the source string onto the destination, but only if the string is not already at the beginning. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * This ignores NULL characters when comparing both the source and the destination. + * Skips over NULL characters from source when prepending. + * + * @param source + * The source string to prepend. + * @param length + * The length of source to append. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_prepend_assure_nulless_ + extern f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_prepend_assure_nulless_ + +/** + * Prepend the source string onto the destination, but only if the string is not already at the beginning. + * + * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * + * This ignores NULL characters when comparing both the source and the destination. + * Skips over NULL characters from source when prepending. + * + * @param source + * The source string to prepend. + * @param length + * The length of source to append. + * @param destination + * The destination string the source is prepended onto. + * + * @return + * F_none on success. + * F_data_not_eos if source length is 0. + * F_memory_not (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if the combined string is too large. + */ +#ifndef _di_f_string_prepend_nulless_ + extern f_status_t f_string_prepend_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_f_string_prepend_nulless_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string_dynamic.c b/level_0/f_string/c/string_dynamic.c new file mode 100644 index 0000000..1c21c93 --- /dev/null +++ b/level_0/f_string/c/string_dynamic.c @@ -0,0 +1,276 @@ +#include "string.h" +#include "private-string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_f_string_static_empty_s_ + const f_string_static_t f_string_static_empty_s = f_macro_string_static_t_initialize("", 0); +#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) { + #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_adjust(length, string); + } +#endif // _di_f_string_dynamic_adjust_ + +#ifndef _di_f_string_dynamic_decimate_ + f_status_t f_string_dynamic_decimate(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_ + + if (string->size > 1) { + return private_f_string_dynamic_adjust(string->size - 1, string); + } + + return private_f_string_dynamic_destroy(string); + } +#endif // _di_f_string_dynamic_decimate_ + +#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) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!string) 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); + } + + return private_f_string_dynamic_destroy(string); + } +#endif // _di_f_string_dynamic_decimate_by_ + +#ifndef _di_f_string_dynamic_decrease_ + f_status_t f_string_dynamic_decrease(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_ + + if (string->size > 1) { + return private_f_string_dynamic_resize(string->size - 1, string); + } + + return private_f_string_dynamic_delete(string); + } +#endif // _di_f_string_dynamic_decrease_ + +#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) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!string) 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); + } + + return private_f_string_dynamic_delete(string); + } +#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) { + #ifndef _di_level_0_parameter_checking_ + if (!string) 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 (size > f_string_length_t_size) { + if (string->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 F_none; + } +#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) { + #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_increase_by(amount, string); + } +#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) { + #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_resize(length, string); + } +#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) { + #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_adjust(length, strings); + } +#endif // _di_f_string_dynamics_adjust_ + +#ifndef _di_f_string_dynamics_decimate_ + f_status_t f_string_dynamics_decimate(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_ + + if (strings->size > 1) { + return private_f_string_dynamics_adjust(strings->size - 1, strings); + } + + return private_f_string_dynamics_destroy(strings); + } +#endif // _di_f_string_dynamics_decimate_ + +#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) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!strings) 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); + } + + return private_f_string_dynamics_destroy(strings); + } +#endif // _di_f_string_dynamics_decimate_by_ + +#ifndef _di_f_string_dynamics_decrease_ + f_status_t f_string_dynamics_decrease(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_ + + if (strings->size > 1) { + return private_f_string_dynamics_resize(strings->size - 1, strings); + } + + return private_f_string_dynamics_delete(strings); + } +#endif // _di_f_string_dynamics_decrease_ + +#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) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!strings) 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); + } + + return private_f_string_dynamics_delete(strings); + } +#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) { + #ifndef _di_level_0_parameter_checking_ + if (!strings) 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 (size > f_array_length_t_size) { + if (strings->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 F_none; + } +#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) { + #ifndef _di_level_0_parameter_checking_ + if (!strings) 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) { + return F_status_set_error(F_array_too_large); + } + + return private_f_string_dynamics_resize(strings->used + amount, strings); + } + + return F_none; + } +#endif // _di_f_string_dynamics_increase_by_ + +#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 e282c86..4968bf4 100644 --- a/level_0/f_string/c/string_dynamic.h +++ b/level_0/f_string/c/string_dynamic.h @@ -174,7 +174,7 @@ extern "C" { 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], f_string_dynamic_t); \ + f_macro_string_dynamic_t_destroy(status, dynamics.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ @@ -223,12 +223,340 @@ extern "C" { } \ 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 #endif // _di_f_string_dynamics_t_ #ifndef _di_f_string_static_empty_s_ const extern f_string_static_t f_string_static_empty_s; #endif // _di_f_string_static_empty_s_ +/** + * Resize the dynamic string. + * + * @param length + * The new size to use. + * @param string + * 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); +#endif // _di_f_string_dynamic_adjust_ + +/** + * Resize the dynamic string to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param string + * 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_decrease_ + extern f_status_t f_string_dynamic_decrease(f_string_dynamic_t *string); +#endif // _di_f_string_dynamic_decrease_ + +/** + * Resize the dynamic string to a smaller size. + * + * This will resize making the string smaller based on (size - given length). + * If the given length is too small, then the resize will fail. + * This will not shrink the size to less than 0. + * + * @param amount + * A positive number representing how much to decrease the size by. + * @param string + * 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_decrease_by_ + extern f_status_t f_string_dynamic_decrease_by(const f_string_length_t amount, f_string_dynamic_t *string); +#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. + * If the given length is too large for the buffer, then attempt to set max buffer size (f_string_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 string + * 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. + * 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); +#endif // _di_f_string_dynamic_increase_ + +/** + * Resize the dynamic string 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_string_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 string + * 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. + * 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); +#endif // _di_f_string_dynamic_increase_by_ + +/** + * Resize the dynamic string. + * + * @param length + * The new size to use. + * @param string + * 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); +#endif // _di_f_string_dynamic_resize_ + +/** + * Resize the dynamic string array. + * + * @param length + * The new size to use. + * @param strings + * 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); +#endif // _di_f_string_dynamics_adjust_ + +/** + * Resize the dynamic string array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param strings + * 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_decimate_ + extern f_status_t f_string_dynamics_decimate(f_string_dynamics_t *strings); +#endif // _di_f_string_dynamics_decimate_ + +/** + * Resize the dynamic string array to a smaller size. + * + * This will resize making the array smaller based on (size - given length). + * If the given length is too small, then the resize will fail. + * This will not shrink the size to less than 0. + * + * @param amount + * A positive number representing how much to decimate the size by. + * @param strings + * 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_decimate_by_ + extern f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *strings); +#endif // _di_f_string_dynamics_decimate_by_ + +/** + * Resize the dynamic string array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param strings + * 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_decrease_ + extern f_status_t f_string_dynamics_decrease(f_string_dynamics_t *strings); +#endif // _di_f_string_dynamics_decrease_ + +/** + * Resize the dynamic string array to a smaller size. + * + * This will resize making the array smaller based on (size - given length). + * If the given length is too small, then the resize will fail. + * This will not shrink the size to less than 0. + * + * @param amount + * A positive number representing how much to decrease the size by. + * @param strings + * 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_decrease_by_ + extern f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *strings); +#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 + * 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. + * 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); +#endif // _di_f_string_dynamics_increase_ + +/** + * Resize the dynamic string 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 strings + * 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. + * 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); +#endif // _di_f_string_dynamics_increase_by_ + +/** + * Resize the dynamic string array. + * + * @param length + * The new size to use. + * @param strings + * 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); +#endif // _di_f_string_dynamics_resize_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string_map.c b/level_0/f_string/c/string_map.c new file mode 100644 index 0000000..b02fcfd --- /dev/null +++ b/level_0/f_string/c/string_map.c @@ -0,0 +1,151 @@ +#include "string.h" +#include "private-string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#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_ + if (!maps) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_string_maps_adjust(length, maps); + } +#endif // _di_f_string_maps_adjust_ + +#ifndef _di_f_string_maps_decimate_ + f_status_t f_string_maps_decimate(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_ + + if (maps->size > 1) { + return private_f_string_maps_adjust(maps->size - 1, maps); + } + + return private_f_string_maps_destroy(maps); + } +#endif // _di_f_string_maps_decimate_ + +#ifndef _di_f_string_maps_decimate_by_ + f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t *maps) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!maps) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (maps->size - amount > 0) { + return private_f_string_maps_adjust(maps->size - amount, maps); + } + + return private_f_string_maps_destroy(maps); + } +#endif // _di_f_string_maps_decimate_by_ + +#ifndef _di_f_string_maps_decrease_ + f_status_t f_string_maps_decrease(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_ + + if (maps->size > 1) { + return private_f_string_maps_resize(maps->size - 1, maps); + } + + return private_f_string_maps_delete(maps); + } +#endif // _di_f_string_maps_decrease_ + +#ifndef _di_f_string_maps_decrease_by_ + f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!maps) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (maps->size - amount > 0) { + return private_f_string_maps_resize(maps->size - amount, maps); + } + + return private_f_string_maps_delete(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_ + if (!maps) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (maps->used + 1 > maps->size) { + f_array_length_t size = maps->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (maps->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_maps_resize(size, maps); + } + + return F_none; + } +#endif // _di_f_string_maps_increase_ + +#ifndef _di_f_string_maps_increase_by_ + f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!maps) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (maps->used + amount > maps->size) { + if (maps->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_string_maps_resize(maps->used + amount, maps); + } + + return F_none; + } +#endif // _di_f_string_maps_increase_by_ + +#ifndef _di_f_string_maps_resize_ + f_status_t f_string_maps_resize(const f_string_length_t length, 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_resize(length, maps); + } +#endif // _di_f_string_maps_resize_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_string/c/string_map.h b/level_0/f_string/c/string_map.h index 46a189a..96431c2 100644 --- a/level_0/f_string/c/string_map.h +++ b/level_0/f_string/c/string_map.h @@ -107,7 +107,7 @@ extern "C" { 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], f_string_map_t); \ + f_macro_string_map_t_destroy(status, maps.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ @@ -158,6 +158,8 @@ extern "C" { maps.size = 0; #endif // _di_f_string_maps_t_ +// @todo increase, decrease, decimate, increase_by, decrease_by, decimate_by + /** * A string map consisting of a name and multiple values. * @@ -242,7 +244,7 @@ extern "C" { 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], f_string_map_multi_t); \ + f_macro_string_map_multi_t_destroy(status, maps.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ @@ -293,6 +295,189 @@ extern "C" { maps.size = 0; #endif // _di_f_string_map_multis_t_ +// @todo increase, decrease, decimate, increase_by, decrease_by, decimate_by + +/** + * 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_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_ + +/** + * Resize the string maps array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @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_decimate_ + extern f_status_t f_string_maps_decimate(f_string_maps_t *maps); +#endif // _di_f_string_maps_decimate_ + +/** + * 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 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_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_ + +/** + * Resize the string maps array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @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_ + extern f_status_t f_string_maps_decrease(f_string_maps_t *maps); +#endif // _di_f_string_maps_decrease_ + +/** + * 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 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_ + +/** + * Delete the array of string maps. + * + * @param maps + * The maps to delete. + * + * @return + * F_none on success. + * 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_ + +/** + * Delete the array of string maps. + * + * @param maps + * The maps to destroy. + * + * @return + * F_none on success. + * 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_ + +/** + * Increase the size of the string maps 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 maps + * The string maps 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_maps_increase_ + extern f_status_t f_string_maps_increase(f_string_maps_t *maps); +#endif // _di_f_string_maps_increase_ + +/** + * Resize the string maps 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 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. + * F_array_too_large (with error bit) if the new array length is too large. + */ +#ifndef _di_f_string_maps_increase_by_ + extern f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps); +#endif // _di_f_string_maps_increase_by_ + +/** + * Resize the string maps array. + * + * @param length + * The new size to use. + * @param maps + * The string maps 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_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_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string_quantity.c b/level_0/f_string/c/string_quantity.c new file mode 100644 index 0000000..9b7c600 --- /dev/null +++ b/level_0/f_string/c/string_quantity.c @@ -0,0 +1,151 @@ +#include "string.h" +#include "private-string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_f_string_quantitys_adjust_ + f_status_t f_string_quantitys_adjust(const f_string_length_t length, 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_adjust(length, quantitys); + } +#endif // _di_f_string_quantitys_adjust_ + +#ifndef _di_f_string_quantitys_decimate_ + f_status_t f_string_quantitys_decimate(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_ + + if (quantitys->size > 1) { + return private_f_string_quantitys_adjust(quantitys->size - 1, quantitys); + } + + return private_f_string_quantitys_destroy(quantitys); + } +#endif // _di_f_string_quantitys_decimate_ + +#ifndef _di_f_string_quantitys_decimate_by_ + f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!quantitys) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (quantitys->size - amount > 0) { + return private_f_string_quantitys_adjust(quantitys->size - amount, quantitys); + } + + return private_f_string_quantitys_destroy(quantitys); + } +#endif // _di_f_string_quantitys_decimate_by_ + +#ifndef _di_f_string_quantitys_decrease_ + f_status_t f_string_quantitys_decrease(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_ + + if (quantitys->size > 1) { + return private_f_string_quantitys_resize(quantitys->size - 1, quantitys); + } + + return private_f_string_quantitys_delete(quantitys); + } +#endif // _di_f_string_quantitys_decrease_ + +#ifndef _di_f_string_quantitys_decrease_by_ + f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!quantitys) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (quantitys->size - amount > 0) { + return private_f_string_quantitys_resize(quantitys->size - amount, quantitys); + } + + return private_f_string_quantitys_delete(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_ + if (!quantitys) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (quantitys->used + 1 > quantitys->size) { + f_array_length_t size = quantitys->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (quantitys->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_quantitys_resize(size, quantitys); + } + + return F_none; + } +#endif // _di_f_string_quantitys_increase_ + +#ifndef _di_f_string_quantitys_increase_by_ + f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!quantitys) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (quantitys->used + amount > quantitys->size) { + if (quantitys->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_string_quantitys_resize(quantitys->used + amount, quantitys); + } + + return F_none; + } +#endif // _di_f_string_quantitys_increase_by_ + +#ifndef _di_f_string_quantitys_resize_ + f_status_t f_string_quantitys_resize(const f_string_length_t length, 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_resize(length, quantitys); + } +#endif // _di_f_string_quantitys_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 f1bf5bb..58d9580 100644 --- a/level_0/f_string/c/string_quantity.h +++ b/level_0/f_string/c/string_quantity.h @@ -105,8 +105,197 @@ extern "C" { #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_decrease(status, string_quantitys) f_macro_memory_structures_decrease(status, string_quantitys, f_string_quantity_t, f_string_quantity_t); + #define f_macro_string_quantityss_t_decimate(status, string_quantitys) f_macro_memory_structures_decimate(status, string_quantitys, f_string_quantity_t, f_string_quantity_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); #endif // _di_f_string_quantityss_t_ +/** + * Resize the string quantitys array. + * + * @param length + * The new size to use. + * @param quantitys + * 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. + */ +#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_ + +/** + * Resize the string quantitys array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param quantitys + * 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. + */ +#ifndef _di_f_string_quantitys_decimate_ + extern f_status_t f_string_quantitys_decimate(f_string_quantitys_t *quantitys); +#endif // _di_f_string_quantitys_decimate_ + +/** + * Resize the string quantitys 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 quantitys + * 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. + */ +#ifndef _di_f_string_quantitys_decimate_by_ + extern f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t *quantitys); +#endif // _di_f_string_quantitys_decimate_by_ + +/** + * Resize the string quantitys array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param quantitys + * 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. + */ +#ifndef _di_f_string_quantitys_decrease_ + extern f_status_t f_string_quantitys_decrease(f_string_quantitys_t *quantitys); +#endif // _di_f_string_quantitys_decrease_ + +/** + * Resize the string quantitys 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 quantitys + * 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. + */ +#ifndef _di_f_string_quantitys_decrease_by_ + extern f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t *quantitys); +#endif // _di_f_string_quantitys_decrease_by_ + +/** + * Delete the array of string quantitys. + * + * @param quantitys + * The quantitys to delete. + * + * @return + * F_none on success. + * 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_ + +/** + * Delete the array of string quantitys. + * + * @param quantitys + * The quantitys to destroy. + * + * @return + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + */ +#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_ + +/** + * 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 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_increase_ + extern f_status_t f_string_quantitys_increase(f_string_quantitys_t *quantitys); +#endif // _di_f_string_quantitys_increase_ + +/** + * 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 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_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_ + +/** + * 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_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_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string_range.c b/level_0/f_string/c/string_range.c new file mode 100644 index 0000000..5001f9f --- /dev/null +++ b/level_0/f_string/c/string_range.c @@ -0,0 +1,151 @@ +#include "string.h" +#include "private-string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_f_string_ranges_adjust_ + f_status_t f_string_ranges_adjust(const f_string_length_t length, 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_adjust(length, ranges); + } +#endif // _di_f_string_ranges_adjust_ + +#ifndef _di_f_string_ranges_decimate_ + f_status_t f_string_ranges_decimate(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_ + + if (ranges->size > 1) { + return private_f_string_ranges_adjust(ranges->size - 1, ranges); + } + + return private_f_string_ranges_destroy(ranges); + } +#endif // _di_f_string_ranges_decimate_ + +#ifndef _di_f_string_ranges_decimate_by_ + f_status_t f_string_ranges_decimate_by(const f_array_length_t amount, f_string_ranges_t *ranges) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!ranges) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (ranges->size - amount > 0) { + return private_f_string_ranges_adjust(ranges->size - amount, ranges); + } + + return private_f_string_ranges_destroy(ranges); + } +#endif // _di_f_string_ranges_decimate_by_ + +#ifndef _di_f_string_ranges_decrease_ + f_status_t f_string_ranges_decrease(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_ + + if (ranges->size > 1) { + return private_f_string_ranges_resize(ranges->size - 1, ranges); + } + + return private_f_string_ranges_delete(ranges); + } +#endif // _di_f_string_ranges_decrease_ + +#ifndef _di_f_string_ranges_decrease_by_ + f_status_t f_string_ranges_decrease_by(const f_array_length_t amount, f_string_ranges_t *ranges) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!ranges) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (ranges->size - amount > 0) { + return private_f_string_ranges_resize(ranges->size - amount, ranges); + } + + return private_f_string_ranges_delete(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_ + if (!ranges) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (ranges->used + 1 > ranges->size) { + f_array_length_t size = ranges->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (ranges->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_ranges_resize(size, ranges); + } + + return F_none; + } +#endif // _di_f_string_ranges_increase_ + +#ifndef _di_f_string_ranges_increase_by_ + f_status_t f_string_ranges_increase_by(const f_array_length_t amount, f_string_ranges_t *ranges) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!ranges) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (ranges->used + amount > ranges->size) { + if (ranges->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_string_ranges_resize(ranges->used + amount, ranges); + } + + return F_none; + } +#endif // _di_f_string_ranges_increase_by_ + +#ifndef _di_f_string_ranges_resize_ + f_status_t f_string_ranges_resize(const f_string_length_t length, 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_resize(length, ranges); + } +#endif // _di_f_string_ranges_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 8ce7cd5..6a1f44e 100644 --- a/level_0/f_string/c/string_range.h +++ b/level_0/f_string/c/string_range.h @@ -111,8 +111,197 @@ extern "C" { #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_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_decrease(status, string_ranges) f_macro_memory_structures_decrease(status, string_ranges, f_string_range_t, f_string_range_t); + #define f_macro_string_rangess_t_decimate(status, string_ranges) f_macro_memory_structures_decimate(status, string_ranges, f_string_range_t, f_string_range_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); #endif // _di_f_string_rangess_t_ +/** + * Resize the string ranges array. + * + * @param length + * The new size to use. + * @param ranges + * The string ranges 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_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_ + +/** + * Resize the string ranges array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param ranges + * The string ranges 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_ranges_decimate_ + extern f_status_t f_string_ranges_decimate(f_string_ranges_t *ranges); +#endif // _di_f_string_ranges_decimate_ + +/** + * Resize the string ranges 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 ranges + * The string ranges 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_ranges_decimate_by_ + extern f_status_t f_string_ranges_decimate_by(const f_array_length_t amount, f_string_ranges_t *ranges); +#endif // _di_f_string_ranges_decimate_by_ + +/** + * Resize the string ranges array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param ranges + * The string ranges 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_ranges_decrease_ + extern f_status_t f_string_ranges_decrease(f_string_ranges_t *ranges); +#endif // _di_f_string_ranges_decrease_ + +/** + * Resize the string ranges 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 ranges + * The string ranges 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_ranges_decrease_by_ + extern f_status_t f_string_ranges_decrease_by(const f_array_length_t amount, f_string_ranges_t *ranges); +#endif // _di_f_string_ranges_decrease_by_ + +/** + * Delete the array of string ranges. + * + * @param ranges + * The ranges to delete. + * + * @return + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + */ +#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_ + +/** + * Delete the array of string ranges. + * + * @param ranges + * The ranges to destroy. + * + * @return + * F_none on success. + * 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_ + +/** + * 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. + * + * @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 string ranges 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_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_ + +/** + * Resize the string ranges array. + * + * @param length + * The new size to use. + * @param ranges + * 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_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_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string_triple.c b/level_0/f_string/c/string_triple.c new file mode 100644 index 0000000..7c4295d --- /dev/null +++ b/level_0/f_string/c/string_triple.c @@ -0,0 +1,151 @@ +#include "string.h" +#include "private-string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_f_string_triples_adjust_ + f_status_t f_string_triples_adjust(const f_string_length_t length, 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_adjust(length, triples); + } +#endif // _di_f_string_triples_adjust_ + +#ifndef _di_f_string_triples_decimate_ + f_status_t f_string_triples_decimate(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_ + + if (triples->size > 1) { + return private_f_string_triples_adjust(triples->size - 1, triples); + } + + return private_f_string_triples_destroy(triples); + } +#endif // _di_f_string_triples_decimate_ + +#ifndef _di_f_string_triples_decimate_by_ + f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t *triples) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!triples) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (triples->size - amount > 0) { + return private_f_string_triples_adjust(triples->size - amount, triples); + } + + return private_f_string_triples_destroy(triples); + } +#endif // _di_f_string_triples_decimate_by_ + +#ifndef _di_f_string_triples_decrease_ + f_status_t f_string_triples_decrease(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_ + + if (triples->size > 1) { + return private_f_string_triples_resize(triples->size - 1, triples); + } + + return private_f_string_triples_delete(triples); + } +#endif // _di_f_string_triples_decrease_ + +#ifndef _di_f_string_triples_decrease_by_ + f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t *triples) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!triples) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (triples->size - amount > 0) { + return private_f_string_triples_resize(triples->size - amount, triples); + } + + return private_f_string_triples_delete(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_ + if (!triples) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (triples->used + 1 > triples->size) { + f_array_length_t size = triples->used + f_memory_default_allocation_step; + + if (size > f_array_length_t_size) { + if (triples->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_triples_resize(size, triples); + } + + return F_none; + } +#endif // _di_f_string_triples_increase_ + +#ifndef _di_f_string_triples_increase_by_ + f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t *triples) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!triples) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (triples->used + amount > triples->size) { + if (triples->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_string_triples_resize(triples->used + amount, triples); + } + + return F_none; + } +#endif // _di_f_string_triples_increase_by_ + +#ifndef _di_f_string_triples_resize_ + f_status_t f_string_triples_resize(const f_string_length_t length, 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_resize(length, triples); + } +#endif // _di_f_string_triples_resize_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_string/c/string_triple.h b/level_0/f_string/c/string_triple.h index a41e93f..175c9b9 100644 --- a/level_0/f_string/c/string_triple.h +++ b/level_0/f_string/c/string_triple.h @@ -120,7 +120,7 @@ extern "C" { 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], f_string_triple_t); \ + f_macro_string_triple_t_destroy(status, triples.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ @@ -171,6 +171,189 @@ extern "C" { triples.size = 0; #endif // _di_f_string_triples_t_ +// @todo increase, decrease, decimate, increase_by, decrease_by, decimate_by + +/** + * Resize the string triples array. + * + * @param length + * The new size to use. + * @param triples + * The string triples 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_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_ + +/** + * Resize the string triples array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param triples + * The string triples 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_triples_decimate_ + extern f_status_t f_string_triples_decimate(f_string_triples_t *triples); +#endif // _di_f_string_triples_decimate_ + +/** + * Resize the string triples 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 triples + * The string triples 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_triples_decimate_by_ + extern f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t *triples); +#endif // _di_f_string_triples_decimate_by_ + +/** + * Resize the string triples array to a smaller size, by 1. + * + * This will shrink the size by size - 1. + * This will not shrink the size to less than 0. + * + * @param triples + * The string triples 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_triples_decrease_ + extern f_status_t f_string_triples_decrease(f_string_triples_t *triples); +#endif // _di_f_string_triples_decrease_ + +/** + * Resize the string triples 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 triples + * The string triples 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_triples_decrease_by_ + extern f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t *triples); +#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). + * If already set to the maximum buffer size, then the resize will fail. + * + * @param triples + * The string triples 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_triples_increase_ + extern f_status_t f_string_triples_increase(f_string_triples_t *triples); +#endif // _di_f_string_triples_increase_ + +/** + * Resize the string triples 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 triples + * The string triples 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_triples_increase_by_ + extern f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t *triples); +#endif // _di_f_string_triples_increase_by_ + +/** + * Resize the string triples array. + * + * @param length + * The new size to use. + * @param triples + * The string triples 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_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_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/data/build/settings b/level_0/f_string/data/build/settings index 3bd1a83..c3146b2 100644 --- a/level_0/f_string/data/build/settings +++ b/level_0/f_string/data/build/settings @@ -20,9 +20,9 @@ build_indexer ar build_language c build_libraries -lc build_libraries-individual -lf_memory -build_sources_library string.c string-common.c +build_sources_library string.c string-common.c private-string.c string_dynamic.c string_map.c string_quantity.c string_range.c string_triple.c build_sources_program -build_sources_headers string.h string-common.h string_dynamic.h string_map.h string_quantity.h string_range.h string_triple.h +build_sources_headers string.h string-common.h private-string.h string_dynamic.h string_map.h string_quantity.h string_range.h string_triple.h build_sources_script build_sources_setting build_script yes diff --git a/level_1/fl_string/c/private-string.c b/level_1/fl_string/c/private-string.c index 2705be2..5bc1995 100644 --- a/level_1/fl_string/c/private-string.c +++ b/level_1/fl_string/c/private-string.c @@ -5,74 +5,6 @@ extern "C" { #endif -#if !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_dynamic_mash_) || !defined(_di_fl_string_mash_) - f_status_t private_fl_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_fl_string_dynamic_increase_by(length, destination); - if (F_status_is_error(status)) return status; - } - - memcpy(destination->string + destination->used, source, length); - destination->used = destination->used + length; - - return F_none; - } -#endif // !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_dynamic_mash_) || !defined(_di_fl_string_mash_) - -#if !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) || !defined(_di_fl_string_mash_nulless_) - f_status_t private_fl_string_append_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - - if (destination->used + length > f_string_length_t_size) { - return F_status_set_error(F_string_too_large); - } - - f_status_t status = F_none; - - f_string_length_t i = 0; - f_string_length_t first = 0; - f_string_length_t size = 0; - - for (; i < length; i++) { - - if (source[i]) continue; - - if (i && i > first) { - size = i - first; - - if (destination->used + size > destination->size) { - status = private_fl_string_dynamic_increase_by(size, destination); - if (F_status_is_error(status)) return status; - } - - memcpy(destination->string + destination->used, source + first, size); - destination->used = destination->used + size; - } - - while (i + 1 < length && !source[i + 1]) { - i++; - } // while - - first = i + 1; - } // for - - if (i > first) { - size = i - first; - - if (destination->used + size > destination->size) { - status = private_fl_string_dynamic_increase_by(size, destination); - if (F_status_is_error(status)) return status; - } - - memcpy(destination->string + destination->used, source + first, size); - destination->used = destination->used + size; - } - - return F_none; - } -#endif // !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) || !defined(_di_fl_string_mash_nulless_) - #if !defined(_di_fl_string_compare_) || !defined(_di_fl_string_dynamic_compare_) || !defined(_di_fl_string_dynamic_partial_compare_) f_status_t private_fl_string_compare(const f_string_t string1, const f_string_t string2, const f_string_length_t offset1, const f_string_length_t offset2, const f_string_length_t stop1, const f_string_length_t stop2) { f_string_length_t i1 = offset1; @@ -525,160 +457,6 @@ extern "C" { } #endif // !defined(_di_fl_string_compare_trim_) || !defined(_di_fl_string_dynamic_compare_trim_) || !defined(_di_fl_string_dynamic_partial_compare_trim_) -#if !defined(_di_fl_string_dynamic_decrease_) || !defined(_di_fl_string_dynamic_decrease_by_) || !defined(_di_fl_string_dynamic_delete_) - void private_fl_string_dynamic_delete(f_string_dynamic_t *string) { - f_macro_string_dynamic_t_delete_simple((*string)); - } -#endif // !defined(_di_fl_string_dynamic_decrease_) || !defined(_di_fl_string_dynamic_decrease_by_) || !defined(_di_fl_string_dynamic_delete_) - -#if !defined(_di_fl_string_dynamic_increase_by_) || !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_) || !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_mash_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) || !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) - f_status_t private_fl_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *string) { - - if (string->used + amount > string->size) { - if (string->used + amount > f_string_length_t_size) { - return F_status_set_error(F_string_too_large); - } - - return private_fl_string_dynamic_resize(string->used + amount, string); - } - - return F_none; - } -#endif // !defined(_di_fl_string_dynamic_increase_by_) || !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_) || !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_mash_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) || !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) - -#if !defined(_di_fl_string_dynamic_decrease_) || !defined(_di_fl_string_dynamic_decrease_by_) || !defined(_di_fl_string_dynamic_increase_) || !defined(_di_fl_string_dynamic_increase_by_) || !defined(_di_fl_string_dynamic_terminate_) || !defined(_di_fl_string_dynamic_terminate_after_) - f_status_t private_fl_string_dynamic_resize(const f_string_length_t length, f_string_dynamic_t *string) { - f_status_t status = F_none; - - f_macro_string_dynamic_t_resize(status, (*string), length); - - return status; - } -#endif // !defined(_di_fl_string_dynamic_decrease_) || !defined(_di_fl_string_dynamic_decrease_by_) || !defined(_di_fl_string_dynamic_increase_) || !defined(_di_fl_string_dynamic_increase_by_) || !defined(_di_fl_string_dynamic_terminate_) || !defined(_di_fl_string_dynamic_terminate_after_) - -#if !defined(_di_fl_string_dynamics_decrease_) || !defined(_di_fl_string_dynamics_decrease_by_) || !defined(_di_fl_string_dynamics_delete_) - void private_fl_string_dynamics_delete(f_string_dynamics_t *string) { - f_macro_string_dynamics_t_delete_simple((*string)); - } -#endif // !defined(_di_fl_string_dynamics_decrease_) || !defined(_di_fl_string_dynamics_decrease_by_) || !defined(_di_fl_string_dynamics_delete_) - -#if !defined(_di_fl_string_dynamics_decrease_) || !defined(_di_fl_string_dynamics_decrease_by_) || !defined(_di_fl_string_dynamics_increase_) || !defined(_di_fl_string_dynamics_increase_by_) || !defined(_di_fl_string_dynamics_terminate_) || !defined(_di_fl_string_dynamics_terminate_after_) - f_status_t private_fl_string_dynamics_resize(const f_string_length_t length, f_string_dynamics_t *strings) { - f_status_t status = F_none; - - f_macro_string_dynamics_t_resize(status, (*strings), length); - - return status; - } -#endif // !defined(_di_fl_string_dynamics_decrease_) || !defined(_di_fl_string_dynamics_decrease_by_) || !defined(_di_fl_string_dynamics_increase_) || !defined(_di_fl_string_dynamics_increase_by_) || !defined(_di_fl_string_dynamics_terminate_) || !defined(_di_fl_string_dynamics_terminate_after_) - -#if !defined(fl_string_maps_decrease) || !defined(fl_string_maps_decrease_by) || !defined(_di_fl_string_maps_delete_) - void private_fl_string_maps_delete(f_string_maps_t *maps) { - f_macro_string_maps_t_delete_simple((*maps)); - } -#endif // !defined(fl_string_maps_decrease) || !defined(fl_string_maps_decrease_by) || !defined(_di_fl_string_maps_delete_) - -#if !defined(_di_fl_string_maps_decrease_) || !defined(_di_fl_string_maps_decrease_by_) || !defined(_di_fl_string_maps_increase_) || !defined(_di_fl_string_maps_increase_by_) || !defined(_di_fl_string_maps_terminate_) || !defined(_di_fl_string_maps_terminate_after_) - f_status_t private_fl_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); - - return status; - } -#endif // !defined(_di_fl_string_maps_decrease_) || !defined(_di_fl_string_maps_decrease_by_) || !defined(_di_fl_string_maps_increase_) || !defined(_di_fl_string_maps_increase_by_) || !defined(_di_fl_string_maps_terminate_) || !defined(_di_fl_string_maps_terminate_after_) - -#if !defined(_di_fl_string_dynamic_mish_) || !defined(_di_fl_string_dynamic_partial_mish_) || !defined(_di_fl_string_dynamic_partial_prepend_assure_) || !defined(_di_fl_string_dynamic_partial_prepend_) || !defined(_di_fl_string_dynamic_prepend_assure_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_mish_) || !defined(_di_fl_string_prepend_assure_) || !defined(_di_fl_string_prepend_) - f_status_t private_fl_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - - if (destination->used + length > f_string_length_t_size) { - return F_status_set_error(F_string_too_large); - } - - if (destination->used + length > destination->size) { - const f_status_t status = private_fl_string_dynamic_increase_by(length, destination); - if (F_status_is_error(status)) return status; - } - - if (destination->used) { - memmove(destination->string + length, destination->string, destination->used); - memcpy(destination->string, source, length); - } - else { - memcpy(destination->string, source, length); - } - - destination->used = destination->used + length; - return F_none; - } -#endif // !defined(_di_fl_string_dynamic_mish_) || !defined(_di_fl_string_dynamic_partial_mish_) || !defined(_di_fl_string_dynamic_partial_prepend_assure_) || !defined(_di_fl_string_dynamic_partial_prepend_) || !defined(_di_fl_string_dynamic_prepend_assure_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_mish_) || !defined(_di_fl_string_prepend_assure_) || !defined(_di_fl_string_prepend_) - -#if !defined(_di_fl_string_dynamic_mish_nulless_) || !defined(_di_fl_string_dynamic_partial_mish_nulless_) || !defined(_di_fl_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_fl_string_dynamic_partial_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_assure_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) || !defined(_di_fl_string_mish_nulless_) || !defined(_di_fl_string_prepend_assure_nulless_) || !defined(_di_fl_string_prepend_nulless_) - f_status_t private_fl_string_prepend_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - - if (destination->used + length > f_string_length_t_size) { - return F_status_set_error(F_string_too_large); - } - - f_status_t status = F_none; - - f_string_length_t first = 0; - f_string_length_t offset = 0; - - f_string_length_t size = 0; - - for (f_string_length_t i = 0; i <= length; i++) { - - if (i == length) { - if (i > first) { - size = i - first; - - if (destination->used + size > destination->size) { - status = private_fl_string_dynamic_increase_by(size, destination); - if (F_status_is_error(status)) return status; - } - - memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); - memcpy(destination->string + offset, source + first, size); - - destination->used = destination->used + size; - offset += size; - } - - break; - } - - if (!source[i]) { - if (i > 0) { - if (i > first) { - size = i - first; - - if (destination->used + size > destination->size) { - status = private_fl_string_dynamic_increase_by(size, destination); - if (F_status_is_error(status)) return status; - } - - memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); - memcpy(destination->string + offset, source + first, size); - - destination->used = destination->used + size; - offset += size; - } - } - - while (i + 1 < length && !source[i + 1]) { - i++; - } // while - - first = i + 1; - continue; - } - } // for - - return F_none; - } -#endif // !defined(_di_fl_string_dynamic_mish_nulless_) || !defined(_di_fl_string_dynamic_partial_mish_nulless_) || !defined(_di_fl_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_fl_string_dynamic_partial_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_assure_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) || !defined(_di_fl_string_mish_nulless_) || !defined(_di_fl_string_prepend_assure_nulless_) || !defined(_di_fl_string_prepend_nulless_) - #if !defined(_di_fl_string_rip_) || !defined(_di_fl_string_dynamic_rip_) || !defined(_di_fl_string_rip_nulless_) || !defined(_di_fl_string_dynamic_rip_nulless_) f_status_t private_fl_string_rip_find_range(const f_string_t source, f_string_length_t *start, f_string_length_t *stop) { const f_string_length_t stop_original = *stop; diff --git a/level_1/fl_string/c/private-string.h b/level_1/fl_string/c/private-string.h index 60bce30..ad22c6a 100644 --- a/level_1/fl_string/c/private-string.h +++ b/level_1/fl_string/c/private-string.h @@ -16,71 +16,6 @@ extern "C" { #endif /** - * Private implementation of fl_string_append(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param source - * The source string to append. - * @param length - * Length of source to append. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * - * @see memcpy() - * - * @see f_macro_string_dynamic_t_resize() - * @see fl_string_append() - * @see fl_string_dynamic_append() - * @see fl_string_dynamic_mash() - * @see fl_string_mash() - */ -#if !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_dynamic_mash_) || !defined(_di_fl_string_mash_) - extern f_status_t private_fl_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_dynamic_mash_) || !defined(_di_fl_string_mash_) - -/** - * Private implementation of fl_string_append_nulless(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param source - * The source string to append. - * @param length - * Length of source to append. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * - * @see memcpy() - * - * @see f_macro_string_dynamic_t_resize() - * @see fl_string_append_nulless() - * @see fl_string_dynamic_append_nulless() - * @see fl_string_dynamic_mash_nulless() - * @see fl_string_mash_nulless() - */ -#if !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) || !defined(_di_fl_string_mash_nulless_) - extern f_status_t private_fl_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_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) || !defined(_di_fl_string_mash_nulless_) - -/** * Private implementation of fl_string_compare(). * * Intended to be shared to each of the different implementation variations. @@ -221,241 +156,6 @@ extern "C" { #endif // !defined(_di_fl_string_compare_trim_) || !defined(_di_fl_string_dynamic_compare_trim_) || !defined(_di_fl_string_dynamic_partial_compare_trim_) /** - * Private implementation of fl_string_dynamic_delete(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param string - * The string to delete. - * - * @see fl_string_dynamic_decrease() - * @see fl_string_dynamic_decrease_by() - * @see fl_string_dynamic_delete() - */ -#if !defined(_di_fl_string_dynamic_decrease_) || !defined(_di_fl_string_dynamic_decrease_by_) || !defined(_di_fl_string_dynamic_delete_) - extern void private_fl_string_dynamic_delete(f_string_dynamic_t *string) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_dynamic_decrease_) || !defined(_di_fl_string_dynamic_decrease_by_) || !defined(_di_fl_string_dynamic_delete_) - -/** - * Private implementation of fl_string_dynamic_increase_by(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param amount - * A positive number representing how much to increase the size by. - * @param string - * The string to resize. - * - * @return - * 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(). - * - * @see memcpy() - * - * @see fl_string_append() - * @see fl_string_append_mash() - * @see fl_string_append_nulless() - * @see fl_string_dynamic_append() - * @see fl_string_dynamic_append_nulless() - * @see fl_string_dynamic_increase_by() - * @see fl_string_dynamic_mash() - * @see fl_string_dynamic_mash_nulless() - * @see fl_string_dynamic_prepend() - * @see fl_string_dynamic_prepend_nulless() - * @see fl_string_mash_nulless() - * @see fl_string_prepend() - * @see fl_string_prepend_nulless() - */ -#if !defined(_di_fl_string_dynamic_increase_by_) || !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_) || !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_mash_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) || !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) - extern f_status_t private_fl_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *string) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_dynamic_increase_by_) || !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_) || !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_mash_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) || !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param string - * The string to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * - * @see f_macro_string_dynamic_t_resize() - * @see fl_string_dynamic_decrease() - * @see fl_string_dynamic_decrease_by() - * @see fl_string_dynamic_increase() - * @see fl_string_dynamic_increase_by() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamic_terminate_after() - */ -#if !defined(_di_fl_string_dynamic_decrease_) || !defined(_di_fl_string_dynamic_decrease_by_) || !defined(_di_fl_string_dynamic_increase_) || !defined(_di_fl_string_dynamic_increase_by_) || !defined(_di_fl_string_dynamic_terminate_) || !defined(_di_fl_string_dynamic_terminate_after_) - extern f_status_t private_fl_string_dynamic_resize(const f_string_length_t length, f_string_dynamic_t *string) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_dynamic_decrease_) || !defined(_di_fl_string_dynamic_decrease_by_) || !defined(_di_fl_string_dynamic_increase_) || !defined(_di_fl_string_dynamic_increase_by_) || !defined(_di_fl_string_dynamic_terminate_) || !defined(_di_fl_string_dynamic_terminate_after_) - -/** - * Private implementation of fl_string_dynamics_delete(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param strings - * The strings to delete. - * - * @see fl_string_dynamics_decrease() - * @see fl_string_dynamics_decrease_by() - * @see fl_string_dynamics_delete() - */ -#if !defined(_di_fl_string_dynamics_decrease_) || !defined(_di_fl_string_dynamics_decrease_by_) || !defined(_di_fl_string_dynamics_delete_) - extern void private_fl_string_dynamics_delete(f_string_dynamics_t *strings) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_dynamics_decrease_) || !defined(_di_fl_string_dynamics_decrease_by_) || !defined(_di_fl_string_dynamics_delete_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param strings - * The strings to resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_dynamics_t_resize(). - * - * @see f_macro_string_dynamics_t_resize() - * @see fl_string_dynamics_decrease() - * @see fl_string_dynamics_decrease_by() - * @see fl_string_dynamics_increase() - * @see fl_string_dynamics_increase_by() - * @see fl_string_dynamics_terminate() - * @see fl_string_dynamics_terminate_after() - */ -#if !defined(_di_fl_string_dynamics_decrease_) || !defined(_di_fl_string_dynamics_decrease_by_) || !defined(_di_fl_string_dynamics_increase_) || !defined(_di_fl_string_dynamics_increase_by_) || !defined(_di_fl_string_dynamics_terminate_) || !defined(_di_fl_string_dynamics_terminate_after_) - extern f_status_t private_fl_string_dynamics_resize(const f_string_length_t length, f_string_dynamics_t *strings) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_dynamics_decrease_) || !defined(_di_fl_string_dynamics_decrease_by_) || !defined(_di_fl_string_dynamics_increase_) || !defined(_di_fl_string_dynamics_increase_by_) || !defined(_di_fl_string_dynamics_terminate_) || !defined(_di_fl_string_dynamics_terminate_after_) - -/** - * Private implementation of fl_string_maps_delete(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param maps - * The maps to delete. - * - * @see fl_string_maps_decrease() - * @see fl_string_maps_decrease_by() - * @see fl_string_maps_delete() - */ -#if !defined(fl_string_maps_decrease) || !defined(fl_string_maps_decrease_by) || !defined(_di_fl_string_maps_delete_) - extern void private_fl_string_maps_delete(f_string_maps_t *maps) f_gcc_attribute_visibility_internal; -#endif // !defined(fl_string_maps_decrease) || !defined(fl_string_maps_decrease_by) || !defined(_di_fl_string_maps_delete_) - -/** - * 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 resize. - * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_macro_string_maps_t_resize(). - * - * @see f_macro_string_dynamic_t_resize() - * @see fl_string_maps_decrease() - * @see fl_string_maps_decrease_by() - * @see fl_string_maps_increase() - * @see fl_string_maps_increase_by() - * @see fl_string_maps_terminate() - * @see fl_string_maps_terminate_after() - */ -#if !defined(_di_fl_string_maps_decrease_) || !defined(_di_fl_string_maps_decrease_by_) || !defined(_di_fl_string_maps_increase_) || !defined(_di_fl_string_maps_increase_by_) || !defined(_di_fl_string_maps_terminate_) || !defined(_di_fl_string_maps_terminate_after_) - extern f_status_t private_fl_string_maps_resize(const f_string_length_t length, f_string_maps_t *maps) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_maps_decrease_) || !defined(_di_fl_string_maps_decrease_by_) || !defined(_di_fl_string_maps_increase_) || !defined(_di_fl_string_maps_increase_by_) || !defined(_di_fl_string_maps_terminate_) || !defined(_di_fl_string_maps_terminate_after_) - -/** - * Private implementation of fl_string_prepend(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param source - * The source string to prepend. - * @param length - * Length of source to append. - * @param destination - * The destination string the source and glue are prepended onto. - * - * @return - * 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(). - * - * @see memcopy() - * @see memmove() - * - * @see fl_string_dynamic_mish() - * @see fl_string_dynamic_partial_mish() - * @see fl_string_dynamic_partial_prepend_assure() - * @see fl_string_dynamic_partial_prepend() - * @see fl_string_dynamic_prepend_assure() - * @see fl_string_dynamic_prepend() - * @see fl_string_mish() - * @see fl_string_prepend_assure() - * @see fl_string_prepend() - */ -#if !defined(_di_fl_string_dynamic_mish_) || !defined(_di_fl_string_dynamic_partial_mish_) || !defined(_di_fl_string_dynamic_partial_prepend_assure_) || !defined(_di_fl_string_dynamic_partial_prepend_) || !defined(_di_fl_string_dynamic_prepend_assure_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_mish_) || !defined(_di_fl_string_prepend_assure_) || !defined(_di_fl_string_prepend_) - extern f_status_t private_fl_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_dynamic_mish_) || !defined(_di_fl_string_dynamic_partial_mish_) || !defined(_di_fl_string_dynamic_partial_prepend_assure_) || !defined(_di_fl_string_dynamic_partial_prepend_) || !defined(_di_fl_string_dynamic_prepend_assure_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_mish_) || !defined(_di_fl_string_prepend_assure_) || !defined(_di_fl_string_prepend_) - -/** - * Private implementation of fl_string_prepend_nulless(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param source - * The source string to prepend. - * @param length - * Length of source to append. - * @param destination - * The destination string the source and glue are prepended onto. - * - * @return - * 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(). - * - * @see memcopy() - * @see memmove() - * - * @see fl_string_dynamic_mish_nulless() - * @see fl_string_dynamic_partial_mish_nulless() - * @see fl_string_dynamic_partial_prepend_assure_nulless() - * @see fl_string_dynamic_partial_prepend_nulless() - * @see fl_string_dynamic_prepend_assure_nulless() - * @see fl_string_dynamic_prepend_nulless() - * @see fl_string_mish_nulless() - * @see fl_string_prepend_assure_nulless() - * @see fl_string_prepend_nulless() - */ -#if !defined(_di_fl_string_dynamic_mish_nulless_) || !defined(_di_fl_string_dynamic_partial_mish_nulless_) || !defined(_di_fl_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_fl_string_dynamic_partial_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_assure_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) || !defined(_di_fl_string_mish_nulless_) || !defined(_di_fl_string_prepend_assure_nulless_) || !defined(_di_fl_string_prepend_nulless_) - extern f_status_t private_fl_string_prepend_nulless(const f_string_t source, f_string_length_t length, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_string_dynamic_mish_nulless_) || !defined(_di_fl_string_dynamic_partial_mish_nulless_) || !defined(_di_fl_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_fl_string_dynamic_partial_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_assure_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) || !defined(_di_fl_string_mish_nulless_) || !defined(_di_fl_string_prepend_assure_nulless_) || !defined(_di_fl_string_prepend_nulless_) - -/** * Private implementation of fl_string_rip(), but only the part for finding the start/stop range. * * Intended to be shared to each of the different implementation variations. diff --git a/level_1/fl_string/c/string.c b/level_1/fl_string/c/string.c index 22e34eb..31af4a9 100644 --- a/level_1/fl_string/c/string.c +++ b/level_1/fl_string/c/string.c @@ -5,103 +5,6 @@ extern "C" { #endif -#ifndef _di_fl_string_append_ - f_status_t fl_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - return private_fl_string_append(source, length, destination); - } -#endif // _di_fl_string_append_ - -#ifndef _di_fl_string_append_assure_ - f_status_t fl_string_append_assure(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - if (destination->used < length) return private_fl_string_append(source, length, destination); - - f_string_length_t i = 1; - f_string_length_t j = 1; - - while (i <= length && j <= destination->used) { - if (!source[length - i]) { - i++; - continue; - } - - if (!destination->string[destination->used - j]) { - j++; - continue; - } - - if (source[length - i] != destination->string[destination->used - j]) { - return private_fl_string_append(source, length, destination); - } - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_append_assure_ - -#ifndef _di_fl_string_append_assure_nulless_ - f_status_t fl_string_append_assure_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - if (destination->used < length) { - return private_fl_string_append_nulless(source, length, destination); - } - - f_string_length_t i = 1; - f_string_length_t j = 1; - - while (i <= length && j <= destination->used) { - if (!source[length - i]) { - i++; - continue; - } - - if (!destination->string[destination->used - j]) { - j++; - continue; - } - - if (source[length - i] != destination->string[destination->used - j]) { - return private_fl_string_append_nulless(source, length, destination); - } - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_append_assure_nulless_ - -#ifndef _di_fl_string_append_nulless_ - f_status_t fl_string_append_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - return private_fl_string_append_nulless(source, length, destination); - } -#endif // _di_fl_string_append_nulless_ - #ifndef _di_fl_string_compare_ f_status_t fl_string_compare(const f_string_t string1, const f_string_t string2, const f_string_length_t length1, const f_string_length_t length2) { return private_fl_string_compare(string1, string2, 0, 0, length1, length2); @@ -126,106 +29,6 @@ extern "C" { } #endif // _di_fl_string_compare_trim_ -#ifndef _di_fl_string_dynamic_append_ - f_status_t fl_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - return private_fl_string_append(source.string, source.used, destination); - } -#endif // _di_fl_string_dynamic_append_ - -#ifndef _di_fl_string_dynamic_append_assure_ - f_status_t fl_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - if (destination->used < source.used) { - return private_fl_string_append(source.string, source.used, destination); - } - - f_string_length_t i = 1; - f_string_length_t j = 1; - - while (i <= source.used && j <= destination->used) { - if (!source.string[source.used - i]) { - i++; - continue; - } - - if (!destination->string[destination->used - j]) { - j++; - continue; - } - - if (source.string[source.used - i] != destination->string[destination->used - j]) { - return private_fl_string_append(source.string, source.used, destination); - } - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_dynamic_append_assure_ - -#ifndef _di_fl_string_dynamic_append_assure_nulless_ - f_status_t fl_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - if (destination->used < source.used) { - return private_fl_string_append_nulless(source.string, source.used, destination); - } - - f_string_length_t i = 1; - f_string_length_t j = 1; - - while (i <= source.used && j <= destination->used) { - if (!source.string[source.used - i]) { - i++; - continue; - } - - if (!destination->string[destination->used - j]) { - j++; - continue; - } - - if (source.string[source.used - i] != destination->string[destination->used - j]) { - return private_fl_string_append_nulless(source.string, source.used, destination); - } - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_dynamic_append_assure_nulless_ - -#ifndef _di_fl_string_dynamic_append_nulless_ - f_status_t fl_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - return private_fl_string_append_nulless(source.string, source.used, destination); - } -#endif // _di_fl_string_dynamic_append_nulless_ - #ifndef _di_fl_string_dynamic_compare_ f_status_t fl_string_dynamic_compare(const f_string_static_t string1, const f_string_static_t string2) { return private_fl_string_compare(string1.string, string2.string, 0, 0, string1.used, string2.used); @@ -274,227 +77,6 @@ extern "C" { } #endif // _di_fl_string_dynamic_compare_trim_string_ -#ifndef _di_fl_string_dynamic_decrease_ - f_status_t fl_string_dynamic_decrease(f_string_dynamic_t *string) { - #ifndef _di_level_1_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (string->size > 1) { - return private_fl_string_dynamic_resize(string->size - 1, string); - } - - private_fl_string_dynamic_delete(string); - - return F_none; - } -#endif // _di_fl_string_dynamic_decrease_ - -#ifndef _di_fl_string_dynamic_decrease_by_ - f_status_t fl_string_dynamic_decrease_by(const f_string_length_t amount, f_string_dynamic_t *string) { - #ifndef _di_level_1_parameter_checking_ - if (!amount) return F_status_set_error(F_parameter); - if (!string) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (string->size - amount > 0) { - return private_fl_string_dynamic_resize(string->size - amount, string); - } - - private_fl_string_dynamic_delete(string); - - return F_none; - } -#endif // _di_fl_string_dynamic_decrease_by_ - -#ifndef _di_fl_string_dynamic_delete_ - f_status_t fl_string_dynamic_delete(f_string_dynamic_t *string) { - #ifndef _di_level_1_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_string_dynamic_delete(string); - - return F_none; - } -#endif // _di_fl_string_dynamic_delete_ - -#ifndef _di_fl_string_dynamic_mash_ - f_status_t fl_string_dynamic_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - if (glue_length && destination->used) { - const f_status_t status = private_fl_string_append(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_append(source.string, source.used, destination); - } -#endif // _di_fl_string_dynamic_mash_ - -#ifndef _di_fl_string_dynamic_mash_nulless_ - f_status_t fl_string_dynamic_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - if (glue_length && destination->used) { - const f_status_t status = private_fl_string_append_nulless(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_append_nulless(source.string, source.used, destination); - } -#endif // _di_fl_string_dynamic_mash_nulless_ - -#ifndef _di_fl_string_dynamic_mish_ - f_status_t fl_string_dynamic_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - if (glue_length && destination->used) { - const f_status_t status = private_fl_string_prepend(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_prepend(source.string, source.used, destination); - } -#endif // _di_fl_string_dynamic_mish_ - -#ifndef _di_fl_string_dynamic_mish_nulless_ - f_status_t fl_string_dynamic_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - if (glue_length && destination->used) { - const f_status_t status = private_fl_string_prepend_nulless(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_prepend_nulless(source.string, source.used, destination); - } -#endif // _di_fl_string_dynamic_mish_nulless_ - -#ifndef _di_fl_string_dynamic_partial_append_ - f_status_t fl_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - return private_fl_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); - } -#endif // _di_fl_string_dynamic_partial_append_ - -#ifndef _di_fl_string_dynamic_partial_append_assure_ - f_status_t fl_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - const f_string_length_t length = (range.stop - range.start) + 1; - - if (destination->used < length) { - return private_fl_string_append(source.string + range.start, length, destination); - } - - f_string_length_t i = 1; - f_string_length_t j = 1; - - while (i <= length && j <= destination->used) { - if (!source.string[range.stop - i]) { - i++; - continue; - } - - if (!destination->string[destination->used - j]) { - j++; - continue; - } - - if (source.string[range.stop - i] != destination->string[destination->used - j]) { - return private_fl_string_append(source.string + range.start, length, destination); - } - - i++; - j++; - } // while - } -#endif // _di_fl_string_dynamic_partial_append_assure_ - -#ifndef _di_fl_string_dynamic_partial_append_assure_nulless_ - f_status_t fl_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - const f_string_length_t length = (range.stop - range.start) + 1; - - if (destination->used < length) { - return private_fl_string_append_nulless(source.string + range.start, length, destination); - } - - f_string_length_t i = 1; - f_string_length_t j = 1; - - while (i <= length && j <= destination->used) { - if (!source.string[range.stop - i]) { - i++; - continue; - } - - if (!destination->string[destination->used - j]) { - j++; - continue; - } - - if (source.string[range.stop - i] != destination->string[destination->used - j]) { - return private_fl_string_append_nulless(source.string + range.start, length, destination); - } - - i++; - j++; - } // while - } -#endif // _di_fl_string_dynamic_append_assure_nulless_ - -#ifndef _di_fl_string_dynamic_partial_append_nulless_ - f_status_t fl_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - return private_fl_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); - } -#endif // _di_fl_string_dynamic_partial_append_nulless_ - #ifndef _di_fl_string_dynamic_partial_compare_ f_status_t fl_string_dynamic_partial_compare(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2) { #ifndef _di_level_1_parameter_checking_ @@ -586,326 +168,38 @@ extern "C" { return private_fl_string_compare_except_trim(string1, string2.string, 0, range2.start, length1, range2.stop + 1, except1, except2); } -#endif // _di_fl_string_dynamic_partial_compare_except_trim_string_ - -#ifndef _di_fl_string_dynamic_partial_compare_trim_ - f_status_t fl_string_dynamic_partial_compare_trim(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2) { - #ifndef _di_level_1_parameter_checking_ - if (string1.used <= range1.stop) return F_status_set_error(F_parameter); - if (string2.used <= range2.stop) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - return private_fl_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); - } -#endif // _di_fl_string_dynamic_partial_compare_trim_ - -#ifndef _di_fl_string_dynamic_partial_compare_trim_dynamic_ - f_status_t fl_string_dynamic_partial_compare_trim_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2) { - #ifndef _di_level_1_parameter_checking_ - if (string2.used <= range2.stop) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - return private_fl_string_compare_trim(string1.string, string2.string, 0, range2.start, string1.used, range2.stop + 1); - } -#endif // _di_fl_string_dynamic_partial_compare_trim_dynamic_ - -#ifndef _di_fl_string_dynamic_partial_compare_trim_string_ - f_status_t fl_string_dynamic_partial_compare_trim_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1, const f_string_range_t range2) { - #ifndef _di_level_1_parameter_checking_ - if (string2.used <= range2.stop) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - return private_fl_string_compare_trim(string1, string2.string, 0, range2.start, length1, range2.stop + 1); - } -#endif // _di_fl_string_dynamic_partial_compare_trim_string_ - -#ifndef _di_fl_string_dynamic_partial_mash_ - f_status_t fl_string_dynamic_partial_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - if (glue_length && destination->used) { - f_status_t status = private_fl_string_append(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); - } -#endif // _di_fl_string_dynamic_partial_mash_ - -#ifndef _di_fl_string_dynamic_partial_mash_nulless_ - f_status_t fl_string_dynamic_partial_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - if (glue_length && destination->used) { - f_status_t status = private_fl_string_append_nulless(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); - } -#endif // _di_fl_string_dynamic_partial_mash_nulless_ - -#ifndef _di_fl_string_dynamic_partial_mish_ - f_status_t fl_string_partial_dynamic_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - if (glue_length && destination->used) { - f_status_t status = private_fl_string_prepend(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination); - } -#endif // _di_fl_string_dynamic_partial_mish_ - -#ifndef _di_fl_string_dynamic_partial_mish_nulless_ - f_status_t fl_string_dynamic_partial_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - if (glue_length && destination->used) { - f_status_t status = private_fl_string_prepend_nulless(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); - } -#endif // _di_fl_string_dynamic_partial_mish_nulless_ - -#ifndef _di_fl_string_dynamic_partial_prepend_ - f_status_t fl_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - return private_fl_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination); - } -#endif // _di_fl_string_dynamic_partial_prepend_ - -#ifndef _di_fl_string_dynamic_partial_prepend_assure_ - f_status_t fl_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - const f_string_length_t length = (range.stop - range.start) + 1; - - if (destination->used < length) { - return private_fl_string_prepend(source.string + range.start, length, destination); - } - - f_string_length_t i = 0; - f_string_length_t j = 0; - - while (i < length && j < destination->used) { - if (!source.string[i + range.start]) { - i++; - continue; - } - - if (!destination->string[j]) { - j++; - continue; - } - - if (source.string[i + range.start] != destination->string[i]) { - return private_fl_string_prepend(source.string + range.start, length, destination); - } - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_dynamic_partial_prepend_assure_ - -#ifndef _di_fl_string_dynamic_partial_prepend_assure_nulless_ - f_status_t fl_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - const f_string_length_t length = (range.stop - range.start) + 1; - - if (destination->used < length) { - return private_fl_string_prepend_nulless(source.string + range.start, length, destination); - } - - f_string_length_t i = 0; - f_string_length_t j = 0; - - while (i < length && j < destination->used) { - if (!source.string[i + range.start]) { - i++; - continue; - } - - if (!destination->string[j]) { - j++; - continue; - } - - if (source.string[i + range.start] != destination->string[i]) { - return private_fl_string_prepend_nulless(source.string + range.start, length, destination); - } - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_dynamic_partial_prepend_assure_nulless - -#ifndef _di_fl_string_dynamic_partial_prepend_nulless_ - f_status_t fl_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return F_status_set_error(F_parameter); - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - if (range.start > range.stop) return F_data_not_stop; - - return private_fl_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); - } -#endif // _di_fl_string_dynamic_partial_prepend_nulless - -#ifndef _di_fl_string_dynamic_prepend_ - f_status_t fl_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - return private_fl_string_prepend(source.string, source.used, destination); - } -#endif // _di_fl_string_dynamic_prepend_ - -#ifndef _di_fl_string_dynamic_prepend_assure_ - f_status_t fl_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!source.used) return F_data_not_eos; - - if (destination->used < source.used) { - return private_fl_string_prepend(source.string, source.used, destination); - } - - f_string_length_t i = 0; - f_string_length_t j = 0; - - while (i < source.used && j < destination->used) { - if (!source.string[i]) { - i++; - continue; - } - - if (!destination->string[j]) { - j++; - continue; - } - - if (source.string[i] != destination->string[i]) { - return private_fl_string_prepend(source.string, source.used, destination); - } - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_dynamic_prepend_assure_ +#endif // _di_fl_string_dynamic_partial_compare_except_trim_string_ -#ifndef _di_fl_string_dynamic_prepend_assure_nulless_ - f_status_t fl_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { +#ifndef _di_fl_string_dynamic_partial_compare_trim_ + f_status_t fl_string_dynamic_partial_compare_trim(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2) { #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); + if (string1.used <= range1.stop) return F_status_set_error(F_parameter); + if (string2.used <= range2.stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!source.used) return F_data_not_eos; - - if (destination->used < source.used) { - return private_fl_string_prepend_nulless(source.string, source.used, destination); - } - - f_string_length_t i = 0; - f_string_length_t j = 0; - - while (i < source.used && j < destination->used) { - if (!source.string[i]) { - i++; - continue; - } - - if (!destination->string[j]) { - j++; - continue; - } - - if (source.string[i] != destination->string[i]) { - return private_fl_string_prepend_nulless(source.string, source.used, destination); - } + return private_fl_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); + } +#endif // _di_fl_string_dynamic_partial_compare_trim_ - i++; - j++; - } // while +#ifndef _di_fl_string_dynamic_partial_compare_trim_dynamic_ + f_status_t fl_string_dynamic_partial_compare_trim_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2) { + #ifndef _di_level_1_parameter_checking_ + if (string2.used <= range2.stop) return F_status_set_error(F_parameter); + #endif // _di_level_1_parameter_checking_ - return F_none; + return private_fl_string_compare_trim(string1.string, string2.string, 0, range2.start, string1.used, range2.stop + 1); } -#endif // _di_fl_string_dynamic_prepend_assure_nulless_ +#endif // _di_fl_string_dynamic_partial_compare_trim_dynamic_ -#ifndef _di_fl_string_dynamic_prepend_nulless_ - f_status_t fl_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { +#ifndef _di_fl_string_dynamic_partial_compare_trim_string_ + f_status_t fl_string_dynamic_partial_compare_trim_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1, const f_string_range_t range2) { #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); + if (string2.used <= range2.stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!source.used) return F_data_not_eos; - - return private_fl_string_prepend_nulless(source.string, source.used, destination); + return private_fl_string_compare_trim(string1, string2.string, 0, range2.start, length1, range2.stop + 1); } -#endif // _di_fl_string_dynamic_prepend_nulless_ +#endif // _di_fl_string_dynamic_partial_compare_trim_string_ #ifndef _di_fl_string_dynamic_rip_ f_status_t fl_string_dynamic_rip(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { @@ -929,7 +223,7 @@ extern "C" { if (!source.used) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - return private_fl_string_append(source.string + begin, (end - begin) + 1, destination); + return f_string_append(source.string + begin, (end - begin) + 1, destination); } #endif // _di_fl_string_dynamic_rip_ @@ -955,44 +249,10 @@ extern "C" { if (!source.used) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - return private_fl_string_append_nulless(source.string + begin, (end - begin) + 1, destination); + return f_string_append_nulless(source.string + begin, (end - begin) + 1, destination); } #endif // _di_fl_string_dynamic_rip_nulless_ -#ifndef _di_fl_string_dynamic_increase_ - f_status_t fl_string_dynamic_increase(f_string_dynamic_t *string) { - #ifndef _di_level_1_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (string->used + 1 > string->size) { - f_array_length_t size = string->used + f_memory_default_allocation_step; - - if (size > f_string_length_t_size) { - if (string->used + 1 > f_string_length_t_size) { - return F_status_set_error(F_string_too_large); - } - - size = f_string_length_t_size; - } - - return private_fl_string_dynamic_resize(size, string); - } - - return F_none; - } -#endif // _di_fl_string_dynamic_increase_ - -#ifndef _di_fl_string_dynamic_increase_by_ - f_status_t fl_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *string) { - #ifndef _di_level_1_parameter_checking_ - if (!string) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - return private_fl_string_dynamic_increase_by(amount, string); - } -#endif // _di_fl_string_dynamic_increase_by_ - #ifndef _di_fl_string_dynamic_seek_line_ f_status_t fl_string_dynamic_seek_line(const f_string_t string, f_string_range_t *range) { #ifndef _di_level_1_parameter_checking_ @@ -1251,400 +511,6 @@ extern "C" { } #endif // _di_fl_string_dynamic_seek_to_utf_character_ -#ifndef _di_fl_string_dynamic_terminate_ - f_status_t fl_string_dynamic_terminate(f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - if (destination->used > destination->size) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!destination->used && destination->size && !destination->string[destination->used - 1]) { - return F_none; - } - - if (destination->used == f_string_length_t_size) { - return F_status_set_error(F_string_too_large); - } - - const f_string_length_t total = destination->used + 1; - - if (total > destination->size) { - const f_status_t status = private_fl_string_dynamic_resize(total, destination); - if (F_status_is_error(status)) return status; - } - - destination->string[destination->used] = 0; - destination->used = total; - - return F_none; - } -#endif // _di_fl_string_dynamic_terminate_ - -#ifndef _di_fl_string_dynamic_terminate_after_ - f_status_t fl_string_dynamic_terminate_after(f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - if (destination->used > destination->size) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (destination->used) { - for (; destination->used; destination->used--) { - if (!destination->string[destination->used - 1]) continue; - break; - } // for - } - - if (destination->used == f_string_length_t_size) { - return F_status_set_error(F_string_too_large); - } - - const f_string_length_t total = destination->used + 1; - - if (total > destination->size) { - const f_status_t status = private_fl_string_dynamic_resize(total, destination); - if (F_status_is_error(status)) return status; - } - - destination->string[destination->used] = 0; - destination->used = total - 1; - - return F_none; - } -#endif // _di_fl_string_dynamic_terminate_after_ - -#ifndef _di_fl_string_dynamics_decrease_ - f_status_t fl_string_dynamics_decrease(f_string_dynamics_t *strings) { - #ifndef _di_level_1_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (strings->size > 1) { - return private_fl_string_dynamics_resize(strings->size - 1, strings); - } - - private_fl_string_dynamics_delete(strings); - - return F_none; - } -#endif // _di_fl_string_dynamics_decrease_ - -#ifndef _di_fl_string_dynamics_decrease_by_ - f_status_t fl_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *strings) { - #ifndef _di_level_1_parameter_checking_ - if (!amount) return F_status_set_error(F_parameter); - if (!strings) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (strings->size - amount > 0) { - return private_fl_string_dynamics_resize(strings->size - amount, strings); - } - - private_fl_string_dynamics_delete(strings); - - return F_none; - } -#endif // _di_fl_string_dynamics_decrease_by_ - -#ifndef _di_fl_string_dynamics_delete_ - f_status_t fl_string_dynamics_delete(f_string_dynamics_t *strings) { - #ifndef _di_level_1_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_string_dynamics_delete(strings); - - return F_none; - } -#endif // _di_fl_string_dynamics_delete_ - -#ifndef _di_fl_string_dynamics_increase_ - f_status_t fl_string_dynamics_increase(f_string_dynamics_t *strings) { - #ifndef _di_level_1_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (strings->used + 1 > strings->size) { - f_array_length_t size = strings->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (strings->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - return private_fl_string_dynamics_resize(size, strings); - } - - return F_none; - } -#endif // _di_fl_string_dynamics_increase_ - -#ifndef _di_fl_string_dynamics_increase_by_ - f_status_t fl_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *strings) { - #ifndef _di_level_1_parameter_checking_ - if (!strings) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (strings->used + amount > strings->size) { - if (strings->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - return private_fl_string_dynamics_resize(strings->used + amount, strings); - } - - return F_none; - } -#endif // _di_fl_string_dynamics_increase_by_ - -#ifndef _di_fl_string_maps_decrease_ - f_status_t fl_string_maps_decrease(f_string_maps_t *maps) { - #ifndef _di_level_1_parameter_checking_ - if (!maps) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (maps->size > 1) { - return private_fl_string_maps_resize(maps->size - 1, maps); - } - - private_fl_string_maps_delete(maps); - - return F_none; - } -#endif // _di_fl_string_maps_decrease_ - -#ifndef _di_fl_string_maps_decrease_by_ - f_status_t fl_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps) { - #ifndef _di_level_1_parameter_checking_ - if (!amount) return F_status_set_error(F_parameter); - if (!maps) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (maps->size - amount > 0) { - return private_fl_string_maps_resize(maps->size - amount, maps); - } - - private_fl_string_maps_delete(maps); - - return F_none; - } -#endif // _di_fl_string_maps_decrease_by_ - -#ifndef _di_fl_string_maps_delete_ - f_status_t fl_string_maps_delete(f_string_maps_t *maps) { - #ifndef _di_level_1_parameter_checking_ - if (!maps) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - private_fl_string_maps_delete(maps); - - return F_none; - } -#endif // _di_fl_string_maps_delete_ - -#ifndef _di_fl_string_maps_increase_ - f_status_t fl_string_maps_increase(f_string_maps_t *maps) { - #ifndef _di_level_1_parameter_checking_ - if (!maps) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (maps->used + 1 > maps->size) { - f_array_length_t size = maps->used + f_memory_default_allocation_step; - - if (size > f_array_length_t_size) { - if (maps->used + 1 > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - size = f_array_length_t_size; - } - - return private_fl_string_maps_resize(size, maps); - } - - return F_none; - } -#endif // _di_fl_string_maps_increase_ - -#ifndef _di_fl_string_maps_increase_by_ - f_status_t fl_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps) { - #ifndef _di_level_1_parameter_checking_ - if (!amount) return F_status_set_error(F_parameter); - if (!maps) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (maps->used + amount > maps->size) { - if (maps->used + amount > f_array_length_t_size) { - return F_status_set_error(F_array_too_large); - } - - return private_fl_string_maps_resize(maps->used + amount, maps); - } - - return F_none; - } -#endif // _di_fl_string_maps_increase_by_ - -#ifndef _di_fl_string_mash_ - f_status_t fl_string_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - if (glue_length && destination->used) { - f_status_t status = private_fl_string_append(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_append(source, length, destination); - } -#endif // _di_fl_string_mash_ - -#ifndef _di_fl_string_mash_nulless_ - f_status_t fl_string_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - if (glue_length && destination->used) { - f_status_t status = private_fl_string_append_nulless(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_append_nulless(source, length, destination); - } -#endif // _di_fl_string_mash_nulless_ - -#ifndef _di_fl_string_mish_ - f_status_t fl_string_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - if (glue_length && destination->used) { - f_status_t status = private_fl_string_prepend(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_prepend(source, length, destination); - } -#endif // _di_fl_string_mish_ - -#ifndef _di_fl_string_mish_nulless_ - f_status_t fl_string_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - if (glue_length && destination->used) { - f_status_t status = private_fl_string_prepend_nulless(glue, glue_length, destination); - if (F_status_is_error(status)) return status; - } - - return private_fl_string_prepend_nulless(source, length, destination); - } -#endif // _di_fl_string_mish_nulless_ - -#ifndef _di_fl_string_prepend_ - f_status_t fl_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - return private_fl_string_prepend(source, length, destination); - } -#endif // _di_fl_string_prepend_ - -#ifndef _di_fl_string_prepend_assure_ - f_status_t fl_string_prepend_assure(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - if (destination->used < length) return private_fl_string_prepend(source, length, destination); - - f_string_length_t i = 0; - f_string_length_t j = 0; - - while (i < length && j < destination->used) { - if (!source[i]) { - i++; - continue; - } - - if (!destination->string[j]) { - j++; - continue; - } - - if (source[i] != destination->string[i]) return private_fl_string_prepend(source, length, destination); - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_prepend_assure_ - -#ifndef _di_fl_string_prepend_assure_nulless_ - f_status_t fl_string_prepend_assure_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - if (destination->used < length) return private_fl_string_prepend_nulless(source, length, destination); - - f_string_length_t i = 0; - f_string_length_t j = 0; - - while (i < length && j < destination->used) { - if (!source[i]) { - i++; - continue; - } - - if (!destination->string[j]) { - j++; - continue; - } - - if (source[i] != destination->string[i]) return private_fl_string_prepend_nulless(source, length, destination); - - i++; - j++; - } // while - - return F_none; - } -#endif // _di_fl_string_prepend_assure_nulless_ - -#ifndef _di_fl_string_prepend_nulless_ - f_status_t fl_string_prepend_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_1_parameter_checking_ - if (!destination) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (!length) return F_data_not_eos; - - return private_fl_string_prepend_nulless(source, length, destination); - } -#endif // _di_fl_string_prepend_nulless_ - #ifndef _di_fl_string_rip_ f_status_t fl_string_rip(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ @@ -1661,7 +527,7 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_data_not) return status; - return private_fl_string_append(source + begin, (end - begin) + 1, destination); + return f_string_append(source + begin, (end - begin) + 1, destination); } #endif // _di_fl_string_rip_ @@ -1681,7 +547,7 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_data_not) return status; - return private_fl_string_append_nulless(source + begin, (end - begin) + 1, destination); + return f_string_append_nulless(source + begin, (end - begin) + 1, destination); } #endif // _di_fl_string_rip_nulless_ diff --git a/level_1/fl_string/c/string.h b/level_1/fl_string/c/string.h index 6950dd5..3b0fbed 100644 --- a/level_1/fl_string/c/string.h +++ b/level_1/fl_string/c/string.h @@ -35,97 +35,6 @@ extern "C" { #endif /** - * Append the source string onto the destination. - * - * @param source - * The source string to append. - * @param length - * The length of source to append. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_append_ - extern f_status_t fl_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_append_ - -/** - * Append the source string onto the destination, but only if the string is not already at the end. - * - * This ignores NULL characters when comparing both the source and the destination. - * - * @param source - * The source string to append. - * @param length - * The length of source to append. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_append_assure_ - extern f_status_t fl_string_append_assure(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_append_assure_ - -/** - * Append the source string onto the destination, but only if the string is not already at the end. - * - * This ignores NULL characters when comparing both the source and the destination. - * Skips over NULL characters from source when appending. - * - * @param source - * The source string to append. - * @param length - * The length of source to append. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_append_assure_nulless_ - extern f_status_t fl_string_append_assure_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_append_assure_nulless_ - -/** - * Append the source string onto the destination. - * - * Skips over NULL characters from source when appending. - * - * @param source - * The source string to append. - * @param length - * The length of source to append. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_append_nulless_ - extern f_status_t fl_string_append_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_append_nulless_ - -/** * Compare two strings, similar to strncmp(). * * This does not stop on NULL. @@ -246,86 +155,6 @@ extern "C" { #endif // _di_fl_string_compare_trim_ /** - * Append the source string onto the destination. - * - * @param source - * The source string to append. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_dynamic_append_ - extern f_status_t fl_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_append_ - -/** - * Append the source string onto the destination. - * - * @param source - * The source string to append. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_dynamic_append_assure_ - extern f_status_t fl_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_append_assure_ - -/** - * Append the source string onto the destination. - * - * Skips over NULL characters from source when appending. - * - * @param source - * The source string to append. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_dynamic_append_assure_nulless_ - extern f_status_t fl_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_append_assure_nulless_ - -/** - * Append the source string onto the destination. - * - * Skips over NULL characters from source when appending. - * - * @param source - * The source string to append. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_dynamic_append_nulless_ - extern f_status_t fl_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_append_nulless_ - -/** * Compare two strings, similar to strncmp(). * * This does not stop on NULL. @@ -560,413 +389,160 @@ extern "C" { #endif // _di_fl_string_dynamic_compare_trim_string_ /** - * Resize the dynamic string to a smaller size, by 1. + * Compare two strings, similar to strncmp(), but restricted to the given ranges. * - * This will shrink the size by size - 1. - * This will not shrink the size to less than 0. + * This does not stop on NULL. + * NULL characters are ignored. * - * @param string - * The string to resize. + * @param string1 + * String to compare. + * @param string2 + * String to compare. + * @param range1 + * A range within the string1 to restrict the comparison to. + * @param range2 + * A range within the string2 to restrict the comparison to. * * @return - * F_none on success. - * F_memory_not (with error bit) on out of memory. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_fl_string_dynamic_decrease_ - extern f_status_t fl_string_dynamic_decrease(f_string_dynamic_t *string); -#endif // _di_fl_string_dynamic_decrease_ +#ifndef _di_fl_string_dynamic_partial_compare_ + extern f_status_t fl_string_dynamic_partial_compare(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2); +#endif // _di_fl_string_dynamic_partial_compare_ /** - * Resize the dynamic string to a smaller size. + * Compare two strings, similar to strncmp(), but restricted to the given ranges. * - * This will resize making the string smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not stop on NULL. + * NULL characters are ignored. + * All 1-byte characters in except1 and except2 are ignored. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param string - * The string to resize. + * @param string1 + * String to compare. + * @param string2 + * String to compare. + * @param range1 + * A range within the string1 to restrict the comparison to. + * @param range2 + * A range within the string2 to restrict the comparison to. + * @param except1 + * A set of locations within string1 to ignore. + * This assumes/requires that the locations be in linear order. + * @param except2 + * A set of locations within string2 to ignore. + * This assumes/requires that the locations be in linear order. * * @return - * F_none on success. - * F_memory_not (with error bit) on out of memory. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_fl_string_dynamic_decrease_by_ - extern f_status_t fl_string_dynamic_decrease_by(const f_string_length_t amount, f_string_dynamic_t *string); -#endif // _di_fl_string_dynamic_decrease_by_ +#ifndef _di_fl_string_dynamic_partial_compare_except_ + extern f_status_t fl_string_dynamic_partial_compare_except(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2, const f_string_lengths_t except1, const f_string_lengths_t except2); +#endif // _di_fl_string_dynamic_partial_compare_except_ /** - * Delete the dynamic string. + * Compare two strings, similar to strncmp(), but restricted to the given range for the second string. * - * @param string - * The string to delete. + * This does not stop on NULL. + * NULL characters are ignored. + * All 1-byte characters in except1 and except2 are ignored. + * + * @param string1 + * String to compare. + * @param string2 + * String to compare. + * @param range2 + * A range within the string2 to restrict the comparison to. + * @param except1 + * A set of locations within string1 to ignore. + * This assumes/requires that the locations be in linear order. + * @param except2 + * A set of locations within string2 to ignore. + * This assumes/requires that the locations be in linear order. * * @return - * F_none on success. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_fl_string_dynamic_delete_ - extern f_status_t fl_string_dynamic_delete(f_string_dynamic_t *string); -#endif // _di_fl_string_dynamic_delete_ +#ifndef _di_fl_string_dynamic_partial_compare_except_dynamic_ + extern f_status_t fl_string_dynamic_partial_compare_except_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2, const f_string_lengths_t except1, const f_string_lengths_t except2); +#endif // _di_fl_string_dynamic_partial_compare_except_dynamic_ /** - * Append the source string onto the destination with the glue in between. + * Compare two strings, similar to strncmp(), but restricted to the given range for the second string. + * + * This operates with the first string being a traditional string. * - * If the destination string is empty, then no glue is appended. + * This does not stop on NULL. + * NULL characters are ignored. + * All 1-byte characters in except1 and except2 are ignored. * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param destination - * The destination string the source and glue are appended onto. + * @param string1 + * String to compare. + * @param string2 + * String to compare. + * @param length1 + * The length of string1. + * @param range2 + * A range within the string2 to restrict the comparison to. + * @param except1 + * A set of locations within string1 to ignore. + * This assumes/requires that the locations be in linear order. + * @param except2 + * A set of locations within string2 to ignore. + * This assumes/requires that the locations be in linear order. * * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. * 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_fl_string_dynamic_mash_ - extern f_status_t fl_string_dynamic_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_mash_ +#ifndef _di_fl_string_dynamic_partial_compare_except_string_ + extern f_status_t fl_string_dynamic_partial_compare_except_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1, const f_string_range_t range2, const f_string_lengths_t except1, const f_string_lengths_t except2); +#endif // _di_fl_string_dynamic_partial_compare_except_string_ /** - * Append the source string onto the destination with the glue in between. - * - * If the destination string is empty, then no glue is appended. + * Compare two strings, similar to strncmp(), but restricted to the given range for the second string. * - * Skips over NULL characters from glue and source when appending. + * This does not stop on NULL. + * NULL characters are ignored. + * Ignores leading and trailing whitespace. + * All 1-byte characters in except1 and except2 are ignored. * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param destination - * The destination string the source and glue are appended onto. + * @param string1 + * String to compare. + * @param string2 + * String to compare. + * @param range2 + * A range within the string2 to restrict the comparison to. + * @param except1 + * A set of locations within string1 to ignore. + * This assumes/requires that the locations be in linear order. + * @param except2 + * A set of locations within string2 to ignore. + * This assumes/requires that the locations be in linear order. * * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. + * + * Errors (with error bit) from: f_utf_is_whitespace(). + * + * @see f_utf_is_whitespace() */ -#ifndef _di_fl_string_dynamic_mash_nulless_ - extern f_status_t fl_string_dynamic_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_mash_nulless_ +#ifndef _di_fl_string_dynamic_partial_compare_except_trim_dynamic_ + extern f_status_t fl_string_dynamic_partial_compare_except_trim_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2, const f_string_lengths_t except1, const f_string_lengths_t except2); +#endif // _di_fl_string_dynamic_partial_compare_except_trim_dynamic_ /** - * Prepend the source string onto the destination with the glue in between. + * Compare two strings, similar to strncmp(), but restricted to the given range for the second string. * - * If the destination string is empty, then no glue is appended. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_dynamic_mish_ - extern f_status_t fl_string_dynamic_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_mish_ - -/** - * Prepend the source string onto the destination with the glue in between. - * - * If the destination string is empty, then no glue is appended. - * - * Skips over NULL characters from glue and source when appending. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_dynamic_mish_nulless_ - extern f_status_t fl_string_dynamic_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_mish_nulless_ - -/** - * Append the source string onto the destination, but restricted to the given range. - * - * @param source - * The source string to append. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_append_ - extern f_status_t fl_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_append_ - -/** - * Append the source string onto the destination, but only if the string is not already at the end and restricted to the given range - * - * This ignores NULL characters when comparing both the source and the destination. - * - * @param source - * The source string to append. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_append_assure_ - extern f_status_t fl_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_append_assure_ - -/** - * Append the source string onto the destination, but only if the string is not already at the end and restricted to the given range - * - * This ignores NULL characters when comparing both the source and the destination. - * - * Skips over NULL characters from source when appending. - * - * @param source - * The source string to append. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_append_assure_nulless_ - extern f_status_t fl_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_append_assure_nulless_ - -/** - * Append the source string onto the destination, but restricted to the given range. - * - * Skips over NULL characters from source when appending. - * - * @param source - * The source string to append. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source is appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_append_nulless_ - extern f_status_t fl_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_append_nulless_ - -/** - * Compare two strings, similar to strncmp(), but restricted to the given ranges. - * - * This does not stop on NULL. - * NULL characters are ignored. - * - * @param string1 - * String to compare. - * @param string2 - * String to compare. - * @param range1 - * A range within the string1 to restrict the comparison to. - * @param range2 - * A range within the string2 to restrict the comparison to. - * - * @return - * F_equal_to when both strings equal. - * F_equal_to_not when both strings do not equal. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_string_dynamic_partial_compare_ - extern f_status_t fl_string_dynamic_partial_compare(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2); -#endif // _di_fl_string_dynamic_partial_compare_ - -/** - * Compare two strings, similar to strncmp(), but restricted to the given ranges. - * - * This does not stop on NULL. - * NULL characters are ignored. - * All 1-byte characters in except1 and except2 are ignored. - * - * @param string1 - * String to compare. - * @param string2 - * String to compare. - * @param range1 - * A range within the string1 to restrict the comparison to. - * @param range2 - * A range within the string2 to restrict the comparison to. - * @param except1 - * A set of locations within string1 to ignore. - * This assumes/requires that the locations be in linear order. - * @param except2 - * A set of locations within string2 to ignore. - * This assumes/requires that the locations be in linear order. - * - * @return - * F_equal_to when both strings equal. - * F_equal_to_not when both strings do not equal. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_string_dynamic_partial_compare_except_ - extern f_status_t fl_string_dynamic_partial_compare_except(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2, const f_string_lengths_t except1, const f_string_lengths_t except2); -#endif // _di_fl_string_dynamic_partial_compare_except_ - -/** - * Compare two strings, similar to strncmp(), but restricted to the given range for the second string. - * - * This does not stop on NULL. - * NULL characters are ignored. - * All 1-byte characters in except1 and except2 are ignored. - * - * @param string1 - * String to compare. - * @param string2 - * String to compare. - * @param range2 - * A range within the string2 to restrict the comparison to. - * @param except1 - * A set of locations within string1 to ignore. - * This assumes/requires that the locations be in linear order. - * @param except2 - * A set of locations within string2 to ignore. - * This assumes/requires that the locations be in linear order. - * - * @return - * F_equal_to when both strings equal. - * F_equal_to_not when both strings do not equal. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_string_dynamic_partial_compare_except_dynamic_ - extern f_status_t fl_string_dynamic_partial_compare_except_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2, const f_string_lengths_t except1, const f_string_lengths_t except2); -#endif // _di_fl_string_dynamic_partial_compare_except_dynamic_ - -/** - * Compare two strings, similar to strncmp(), but restricted to the given range for the second string. - * - * This operates with the first string being a traditional string. - * - * This does not stop on NULL. - * NULL characters are ignored. - * All 1-byte characters in except1 and except2 are ignored. - * - * @param string1 - * String to compare. - * @param string2 - * String to compare. - * @param length1 - * The length of string1. - * @param range2 - * A range within the string2 to restrict the comparison to. - * @param except1 - * A set of locations within string1 to ignore. - * This assumes/requires that the locations be in linear order. - * @param except2 - * A set of locations within string2 to ignore. - * This assumes/requires that the locations be in linear order. - * - * @return - * F_equal_to when both strings equal. - * F_equal_to_not when both strings do not equal. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_string_dynamic_partial_compare_except_string_ - extern f_status_t fl_string_dynamic_partial_compare_except_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1, const f_string_range_t range2, const f_string_lengths_t except1, const f_string_lengths_t except2); -#endif // _di_fl_string_dynamic_partial_compare_except_string_ - -/** - * Compare two strings, similar to strncmp(), but restricted to the given range for the second string. - * - * This does not stop on NULL. - * NULL characters are ignored. - * Ignores leading and trailing whitespace. - * All 1-byte characters in except1 and except2 are ignored. - * - * @param string1 - * String to compare. - * @param string2 - * String to compare. - * @param range2 - * A range within the string2 to restrict the comparison to. - * @param except1 - * A set of locations within string1 to ignore. - * This assumes/requires that the locations be in linear order. - * @param except2 - * A set of locations within string2 to ignore. - * This assumes/requires that the locations be in linear order. - * - * @return - * F_equal_to when both strings equal. - * F_equal_to_not when both strings do not equal. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_utf_is_whitespace(). - * - * @see f_utf_is_whitespace() - */ -#ifndef _di_fl_string_dynamic_partial_compare_except_trim_dynamic_ - extern f_status_t fl_string_dynamic_partial_compare_except_trim_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2, const f_string_lengths_t except1, const f_string_lengths_t except2); -#endif // _di_fl_string_dynamic_partial_compare_except_trim_dynamic_ - -/** - * Compare two strings, similar to strncmp(), but restricted to the given range for the second string. - * - * This operates with the first string being a traditional string. + * This operates with the first string being a traditional string. * * This does not stop on NULL. * NULL characters are ignored. @@ -1173,20 +749,18 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_compare_trim_ /** - * Append the source string onto the destination with the glue in between, but restricted to the given range. + * Allocate a new string from the provided range in the buffer. * - * If the destination string is empty, then no glue is appended. + * Ignores leading and trailing whitespace. + * Ignores leading and trailing NULL characters. + * As a result, resulting size may be smaller than requested range. * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. * @param source - * The source string to append. + * The buffer to rip from. * @param range - * A range within the source to restrict the copy from. + * A range within the buffer representing the string to rip. * @param destination - * The destination string the source and glue are appended onto. + * The new string, which will be allocated or reallocated as necessary. * * @return * F_none on success. @@ -1196,277 +770,25 @@ extern "C" { * 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_fl_string_dynamic_partial_mash_ - extern f_status_t fl_string_dynamic_partial_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_mash_ - -/** - * Append the source string onto the destination with the glue in between, but restricted to the given range. - * - * If the destination string is empty, then no glue is appended. - * - * Skips over NULL characters from glue and source when appending. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_mash_nulless_ - extern f_status_t fl_string_dynamic_partial_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_mash_nulless_ - -/** - * Prepend the source string onto the destination with the glue in between, but restricted to the given range. - * - * If the destination string is empty, then no glue is appended. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_mish_ - extern f_status_t fl_string_dynamic_partial_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_mish_ - -/** - * Prepend the source string onto the destination with the glue in between, but restricted to the given range. - * - * If the destination string is empty, then no glue is appended. - * - * Skips over NULL characters from glue and source when appending. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_mish_nulless_ - extern f_status_t fl_string_dynamic_partial_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_mish_nulless_ - -/** - * Prepend the source string onto the destination, but restricted to the given range. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * @param source - * The source string to prepend. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_prepend_ - extern f_status_t fl_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_prepend_ - -/** - * Prepend the source string onto the destination, but only if the string is not already at the end and restricted to the given range - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * This ignores NULL characters when comparing both the source and the destination. - * - * @param source - * The source string to prepend. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_prepend_assure_ - extern f_status_t fl_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_prepend_assure_ +#ifndef _di_fl_string_dynamic_rip_ + extern f_status_t fl_string_dynamic_rip(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_fl_string_dynamic_rip_ /** - * Prepend the source string onto the destination, but only if the string is not already at the end and restricted to the given range - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * This ignores NULL characters when comparing both the source and the destination. - * - * @param source - * The source string to prepend. - * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source is prepended onto. + * Allocate a new string from the provided range in the buffer. * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_prepend_assure_nulless_ - extern f_status_t fl_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_prepend_assure_nulless_ - -/** - * Prepend the source string onto the destination, but restricted to the given range. + * Ignores leading and trailing whitespace. + * Ignores leading and trailing NULL characters. + * As a result, resulting size may be smaller than requested range. * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. + * Skips over NULL characters from source when appending. * * @param source - * The source string to prepend. + * The string to rip from. * @param range - * A range within the source to restrict the copy from. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_partial_prepend_nulless_ - extern f_status_t fl_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_partial_prepend_nulless_ - -/** - * Prepend the source string onto the destination. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * @param source - * The source string to prepend. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_prepend_ - extern f_status_t fl_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_prepend_ - -/** - * Prepend the source string onto the destination, but only if the string is not already at the beginning. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * This ignores NULL characters when comparing both the source and the destination. - * - * @param source - * The source string to prepend. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_prepend_assure_ - extern f_status_t fl_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_prepend_assure_ - -/** - * Prepend the source string onto the destination, but only if the string is not already at the beginning. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * This ignores NULL characters when comparing both the source and the destination. - * - * @param source - * The source string to prepend. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. - * 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_fl_string_dynamic_prepend_assure_nulless_ - extern f_status_t fl_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_prepend_assure_nulless_ - -/** - * Prepend the source string onto the destination. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * @param source - * The source string to prepend. + * A range within the buffer representing the string to rip. * @param destination - * The destination string the source is prepended onto. + * The new string, which will be allocated or reallocated as necessary. * * @return * F_none on success. @@ -1474,108 +796,68 @@ extern "C" { * F_data_not_stop if range.start > range.stop. * 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_fl_string_dynamic_prepend_nulless_ - extern f_status_t fl_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_prepend_nulless_ +#ifndef _di_fl_string_dynamic_rip_nulless_ + extern f_status_t fl_string_dynamic_rip_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); +#endif // _di_fl_string_dynamic_rip_nulless_ /** - * Allocate a new string from the provided range in the buffer. + * Allocate a new string from the provided range in the string. * * Ignores leading and trailing whitespace. * Ignores leading and trailing NULL characters. - * As a result, resulting size may be smaller than requested range. + * As a result, resulting size may be smaller than requested length. * * @param source - * The buffer to rip from. - * @param range - * A range within the buffer representing the string to rip. + * The string to rip from. + * @param length + * The length of source to append. * @param destination * The new string, which will be allocated or reallocated as necessary. * * @return * F_none on success. * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. * 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. + * + * Errors (with error bit) from: f_utf_is_whitespace(). + * + * @see f_utf_is_whitespace() */ -#ifndef _di_fl_string_dynamic_rip_ - extern f_status_t fl_string_dynamic_rip(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_rip_ +#ifndef _di_fl_string_rip_ + extern f_status_t fl_string_rip(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_fl_string_rip_ /** - * Allocate a new string from the provided range in the buffer. + * Allocate a new string from the provided range in the string. * * Ignores leading and trailing whitespace. * Ignores leading and trailing NULL characters. - * As a result, resulting size may be smaller than requested range. + * As a result, resulting size may be smaller than requested length. * - * Skips over NULL characters from source when appending. + * Skips over NULL characters from source when ripping. * * @param source * The string to rip from. - * @param range - * A range within the buffer representing the string to rip. + * @param length + * The length of source to append. * @param destination * The new string, which will be allocated or reallocated as necessary. * * @return * F_none on success. * F_data_not_eos if source length is 0. - * F_data_not_stop if range.start > range.stop. * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_string_dynamic_rip_nulless_ - extern f_status_t fl_string_dynamic_rip_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_rip_nulless_ - -/** - * Resize the dynamic string 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_string_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 string - * 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. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_dynamic_increase_ - extern f_status_t fl_string_dynamic_increase(f_string_dynamic_t *string); -#endif // _di_fl_string_dynamic_increase_ - -/** - * Resize the dynamic string 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_string_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 string - * The string to resize. + * Errors (with error bit) from: f_utf_is_whitespace(). * - * @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_string_too_large (with error bit) if the combined string is too large. + * @see f_utf_is_whitespace() */ -#ifndef _di_fl_string_dynamic_increase_by_ - extern f_status_t fl_string_dynamic_increase_by(const f_string_length_t amount, f_string_dynamic_t *string); -#endif // _di_fl_string_dynamic_increase_by_ +#ifndef _di_fl_string_rip_nulless_ + extern f_status_t fl_string_rip_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); +#endif // _di_fl_string_rip_nulless_ /** * Seek the buffer location forward until EOL is reached. @@ -1762,508 +1044,6 @@ extern "C" { #endif // _di_fl_string_dynamic_seek_to_utf_character_ /** - * Guarantee that an end of string (NULL) exists at the end of the string. - * - * This is intended to be used for anything requiring NULL terminated strings. - * This will reallocate more space if necessary. - * - * If destination size is 0, then it will be reallocated and have the NULL assigned at index 0. - * - * @param destination - * The new string, which will be allocated or reallocated as necessary. - * - * @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_string_too_large (with error bit) if string is too large to fit into the buffer. - */ -#ifndef _di_fl_string_dynamic_terminate_ - extern f_status_t fl_string_dynamic_terminate(f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_terminate_ - -/** - * Guarantee that an end of string (NULL) exists at the end of the string. - * - * This ensures that the terminating NULL not only exists but is not counted in destination.used. - * - * This is intended to be used for anything requiring NULL terminated strings whose used length cannot be counted. - * This will reallocate more space if necessary. - * - * If destination size is 0, then it will be reallocated and have the NULL assigned at index 0. - * - * @param destination - * The new string, which will be allocated or reallocated as necessary. - * - * @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_string_too_large (with error bit) if string is too large to fit into the buffer. - */ -#ifndef _di_fl_string_dynamic_terminate_after_ - extern f_status_t fl_string_dynamic_terminate_after(f_string_dynamic_t *destination); -#endif // _di_fl_string_dynamic_terminate_after_ - -/** - * Resize the dynamic string array to a smaller size, by 1. - * - * This will shrink the size by size - 1. - * This will not shrink the size to less than 0. - * - * @param strings - * 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_fl_string_dynamics_decrease_ - extern f_status_t fl_string_dynamics_decrease(f_string_dynamics_t *strings); -#endif // _di_fl_string_dynamics_decrease_ - -/** - * Resize the dynamic string array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decrease the size by. - * @param strings - * 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_fl_string_dynamics_decrease_by_ - extern f_status_t fl_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *strings); -#endif // _di_fl_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_fl_string_dynamics_delete_ - extern f_status_t fl_string_dynamics_delete(f_string_dynamics_t *strings); -#endif // _di_fl_string_dynamics_delete_ - -/** - * 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 - * 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. - * F_array_too_large (with error bit) if the new array length is too large. - */ -#ifndef _di_fl_string_dynamics_increase_ - extern f_status_t fl_string_dynamics_increase(f_string_dynamics_t *strings); -#endif // _di_fl_string_dynamics_increase_ - -/** - * Resize the dynamic string 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 strings - * 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. - * F_array_too_large (with error bit) if the new array length is too large. - */ -#ifndef _di_fl_string_dynamics_increase_by_ - extern f_status_t fl_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *strings); -#endif // _di_fl_string_dynamics_increase_by_ - -/** - * Resize the string maps array to a smaller size, by 1. - * - * This will shrink the size by size - 1. - * This will not shrink the size to less than 0. - * - * @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_fl_string_maps_decrease_ - extern f_status_t fl_string_maps_decrease(f_string_maps_t *maps); -#endif // _di_fl_string_maps_decrease_ - -/** - * 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 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_fl_string_maps_decrease_by_ - extern f_status_t fl_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps); -#endif // _di_fl_string_maps_decrease_by_ - -/** - * Delete the array of string maps. - * - * @param maps - * The maps to delete. - * - * @return - * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_string_maps_delete_ - extern f_status_t fl_string_maps_delete(f_string_maps_t *maps); -#endif // _di_fl_string_maps_delete_ - -/** - * Increase the size of the string maps 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 maps - * The string maps 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_fl_string_maps_increase_ - extern f_status_t fl_string_maps_increase(f_string_maps_t *maps); -#endif // _di_fl_string_maps_increase_ - -/** - * Resize the string maps 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 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. - * F_array_too_large (with error bit) if the new array length is too large. - */ -#ifndef _di_fl_string_maps_increase_by_ - extern f_status_t fl_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps); -#endif // _di_fl_string_maps_increase_by_ - -/** - * Append the source string onto the destination with the glue in between. - * - * If the destination string is empty, then no glue is appended. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param length - * The length of source to append. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_mash_ - extern f_status_t fl_string_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_mash_ - -/** - * Append the source string onto the destination with the glue in between. - * - * If the destination string is empty, then no glue is appended. - * - * Skips over NULL characters from glue and source when appending. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param length - * The length of source to append. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_mash_nulless_ - extern f_status_t fl_string_mash_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_mash_nulless_ - -/** - * Prepend the source string onto the destination with the glue in between. - * - * If the destination string is empty, then no glue is appended. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param length - * The length of source to append. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_mish_ - extern f_status_t fl_string_mish(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_mish_ - -/** - * Prepend the source string onto the destination with the glue in between. - * - * If the destination string is empty, then no glue is appended. - * - * Skips over NULL characters from glue and source when appending. - * - * @param glue - * A string to append between the source and destination, such as a space: ' '. - * @param glue_length - * The number of bytes the glue takes up. - * @param source - * The source string to append. - * @param length - * The length of source to append. - * @param destination - * The destination string the source and glue are appended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_mish_nulless_ - extern f_status_t fl_string_mish_nulless(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_mish_nulless_ - -/** - * Prepend the source string onto the destination. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * @param source - * The source string to prepend. - * @param length - * The length of source to append. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_prepend_ - extern f_status_t fl_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_prepend_ - -/** - * Prepend the source string onto the destination, but only if the string is not already at the beginning. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * This ignores NULL characters when comparing both the source and the destination. - * - * @param source - * The source string to prepend. - * @param length - * The length of source to append. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_prepend_assure_ - extern f_status_t fl_string_prepend_assure(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_prepend_assure_ - -/** - * Prepend the source string onto the destination, but only if the string is not already at the beginning. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * This ignores NULL characters when comparing both the source and the destination. - * Skips over NULL characters from source when prepending. - * - * @param source - * The source string to prepend. - * @param length - * The length of source to append. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_prepend_assure_nulless_ - extern f_status_t fl_string_prepend_assure_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_prepend_assure_nulless_ - -/** - * Prepend the source string onto the destination, but only if the string is not already at the beginning. - * - * Prepend operations require memory move operations and are therefore likely more expensive than append operations. - * - * This ignores NULL characters when comparing both the source and the destination. - * Skips over NULL characters from source when prepending. - * - * @param source - * The source string to prepend. - * @param length - * The length of source to append. - * @param destination - * The destination string the source is prepended onto. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - */ -#ifndef _di_fl_string_prepend_nulless_ - extern f_status_t fl_string_prepend_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_prepend_nulless_ - -/** - * Allocate a new string from the provided range in the string. - * - * Ignores leading and trailing whitespace. - * Ignores leading and trailing NULL characters. - * As a result, resulting size may be smaller than requested length. - * - * @param source - * The string to rip from. - * @param length - * The length of source to append. - * @param destination - * The new string, which will be allocated or reallocated as necessary. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_utf_is_whitespace(). - * - * @see f_utf_is_whitespace() - */ -#ifndef _di_fl_string_rip_ - extern f_status_t fl_string_rip(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_rip_ - -/** - * Allocate a new string from the provided range in the string. - * - * Ignores leading and trailing whitespace. - * Ignores leading and trailing NULL characters. - * As a result, resulting size may be smaller than requested length. - * - * Skips over NULL characters from source when ripping. - * - * @param source - * The string to rip from. - * @param length - * The length of source to append. - * @param destination - * The new string, which will be allocated or reallocated as necessary. - * - * @return - * F_none on success. - * F_data_not_eos if source length is 0. - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_utf_is_whitespace(). - * - * @see f_utf_is_whitespace() - */ -#ifndef _di_fl_string_rip_nulless_ - extern f_status_t fl_string_rip_nulless(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); -#endif // _di_fl_string_rip_nulless_ - -/** * Seek the string location forward until the character (1-byte wide) or EOL is reached. * * @param string diff --git a/level_1/fl_utf/c/private-utf.c b/level_1/fl_utf/c/private-utf.c index 912f926..dd135f0 100644 --- a/level_1/fl_utf/c/private-utf.c +++ b/level_1/fl_utf/c/private-utf.c @@ -93,8 +93,8 @@ extern "C" { } #endif // !defined(_di_fl_utf_string_append_nulless_) || !defined(_di_fl_utf_string_dynamic_append_nulless_) || !defined(_di_fl_utf_string_mash_nulless_) || !defined(_di_fl_utf_string_dynamic_mash_nulless_) -#if !defined(_di_fl_utf_string_compare_) || !defined(_di_fl_utf_string_dynamic_compare_) || !defined(_di_fl_utf_string_dynamic_partial_compare_) - f_status_t private_fl_utf_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t offset1, const f_utf_string_length_t offset2, const f_utf_string_length_t stop1, const f_utf_string_length_t stop2) { +#if !defined(_di_fl_utfl_string_compare_) || !defined(_di_fl_utfl_string_dynamic_compare_) || !defined(_di_fl_utfl_string_dynamic_partial_compare_) + f_status_t private_fl_utfl_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t offset1, const f_utf_string_length_t offset2, const f_utf_string_length_t stop1, const f_utf_string_length_t stop2) { f_utf_string_length_t i1 = offset1; f_utf_string_length_t i2 = offset2; @@ -122,10 +122,10 @@ extern "C" { return F_equal_to; } -#endif // !defined(_di_fl_utf_string_compare_) || !defined(_di_fl_utf_string_dynamic_compare_) || !defined(_di_fl_utf_string_dynamic_partial_compare_) +#endif // !defined(_di_fl_utfl_string_compare_) || !defined(_di_fl_utfl_string_dynamic_compare_) || !defined(_di_fl_utfl_string_dynamic_partial_compare_) -#if !defined(_di_fl_utf_string_compare_trim_) || !defined(_di_fl_utf_string_dynamic_compare_trim_) || !defined(_di_fl_utf_string_dynamic_partial_compare_trim_) - f_status_t private_fl_utf_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t offset1, const f_utf_string_length_t offset2, const f_utf_string_length_t stop1, const f_utf_string_length_t stop2) { +#if !defined(_di_fl_utfl_string_compare_trim_) || !defined(_di_fl_utfl_string_dynamic_compare_trim_) || !defined(_di_fl_utfl_string_dynamic_partial_compare_trim_) + f_status_t private_fl_utfl_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t offset1, const f_utf_string_length_t offset2, const f_utf_string_length_t stop1, const f_utf_string_length_t stop2) { f_utf_string_length_t i1 = offset1; f_utf_string_length_t i2 = offset2; @@ -248,7 +248,7 @@ extern "C" { return F_equal_to; } -#endif // !defined(_di_fl_utf_string_compare_trim_) || !defined(_di_fl_utf_string_dynamic_compare_trim_) || !defined(_di_fl_utf_string_dynamic_partial_compare_trim_) +#endif // !defined(_di_fl_utfl_string_compare_trim_) || !defined(_di_fl_utfl_string_dynamic_compare_trim_) || !defined(_di_fl_utfl_string_dynamic_partial_compare_trim_) #if !defined(_di_fl_utf_string_prepend_) || !defined(_di_fl_utf_string_dynamic_prepend_) f_status_t private_fl_utf_string_prepend(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { @@ -356,8 +356,8 @@ extern "C" { } #endif // !defined(_di_fl_utf_string_prepend_nulless_) || !defined(_di_fl_utf_string_dynamic_prepend_nulless_) -#if !defined(_di_fl_utf_string_rip_) || !defined(_di_fl_utf_string_dynamic_rip_) || !defined(_di_fl_utf_string_rip_nulless_) || !defined(_di_fl_utf_string_dynamic_rip_nulless_) - f_status_t private_fl_utf_string_rip_find_range(const f_utf_string_t source, f_utf_string_length_t *start, f_utf_string_length_t *stop) { +#if !defined(_di_fl_utfl_string_rip_) || !defined(_di_fl_utfl_string_dynamic_rip_) || !defined(_di_fl_utfl_string_rip_nulless_) || !defined(_di_fl_utfl_string_dynamic_rip_nulless_) + f_status_t private_fl_utfl_string_rip_find_range(const f_utf_string_t source, f_utf_string_length_t *start, f_utf_string_length_t *stop) { f_status_t status = F_none; @@ -418,7 +418,7 @@ extern "C" { return F_none; } -#endif // !defined(_di_fl_utf_string_rip_) || !defined(_di_fl_utf_string_dynamic_rip_) || !defined(_di_fl_utf_string_rip_nulless_) || !defined(_di_fl_utf_string_dynamic_rip_nulless_) +#endif // !defined(_di_fl_utfl_string_rip_) || !defined(_di_fl_utfl_string_dynamic_rip_) || !defined(_di_fl_utfl_string_rip_nulless_) || !defined(_di_fl_utfl_string_dynamic_rip_nulless_) #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_utf/c/private-utf.h b/level_1/fl_utf/c/private-utf.h index 29f1bb5..9348449 100644 --- a/level_1/fl_utf/c/private-utf.h +++ b/level_1/fl_utf/c/private-utf.h @@ -74,7 +74,7 @@ extern "C" { #endif // !defined(_di_fl_utf_string_append_nulless_) || !defined(_di_fl_utf_string_dynamic_append_nulless_) || !defined(_di_fl_utf_string_mash_nulless_) || !defined(_di_fl_utf_string_dynamic_mash_nulless_) /** - * Private implementation of fl_utf_string_compare(). + * Private implementation of fl_utfl_string_compare(). * * Intended to be shared to each of the different implementation variations. * @@ -96,16 +96,16 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * @see fl_utf_string_compare() - * @see fl_utf_string_dynamic_compare() - * @see fl_utf_string_dynamic_partial_compare() + * @see fl_utfl_string_compare() + * @see fl_utfl_string_dynamic_compare() + * @see fl_utfl_string_dynamic_partial_compare() */ -#if !defined(_di_fl_utf_string_compare_) || !defined(_di_fl_utf_string_dynamic_compare_) || !defined(_di_fl_utf_string_dynamic_partial_compare_) - extern f_status_t private_fl_utf_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t offset1, const f_utf_string_length_t offset2, const f_utf_string_length_t stop1, const f_utf_string_length_t stop2) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_utf_string_compare_) || !defined(_di_fl_utf_string_dynamic_compare_) || !defined(_di_fl_utf_string_dynamic_partial_compare_) +#if !defined(_di_fl_utfl_string_compare_) || !defined(_di_fl_utfl_string_dynamic_compare_) || !defined(_di_fl_utfl_string_dynamic_partial_compare_) + extern f_status_t private_fl_utfl_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t offset1, const f_utf_string_length_t offset2, const f_utf_string_length_t stop1, const f_utf_string_length_t stop2) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_fl_utfl_string_compare_) || !defined(_di_fl_utfl_string_dynamic_compare_) || !defined(_di_fl_utfl_string_dynamic_partial_compare_) /** - * Private implementation of fl_utf_string_compare_trim(). + * Private implementation of fl_utfl_string_compare_trim(). * * Intended to be shared to each of the different implementation variations. * @@ -127,13 +127,13 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * @see fl_utf_string_compare_trim() - * @see fl_utf_string_dynamic_compare_trim() - * @see fl_utf_string_dynamic_partial_compare_trim() + * @see fl_utfl_string_compare_trim() + * @see fl_utfl_string_dynamic_compare_trim() + * @see fl_utfl_string_dynamic_partial_compare_trim() */ -#if !defined(_di_fl_utf_string_compare_trim_) || !defined(_di_fl_utf_string_dynamic_compare_trim_) || !defined(_di_fl_utf_string_dynamic_partial_compare_trim_) - extern f_status_t private_fl_utf_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t offset1, const f_utf_string_length_t offset2, const f_utf_string_length_t stop1, const f_utf_string_length_t stop2) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_utf_string_compare_trim_) || !defined(_di_fl_utf_string_dynamic_compare_trim_) || !defined(_di_fl_utf_string_dynamic_partial_compare_trim_) +#if !defined(_di_fl_utfl_string_compare_trim_) || !defined(_di_fl_utfl_string_dynamic_compare_trim_) || !defined(_di_fl_utfl_string_dynamic_partial_compare_trim_) + extern f_status_t private_fl_utfl_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t offset1, const f_utf_string_length_t offset2, const f_utf_string_length_t stop1, const f_utf_string_length_t stop2) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_fl_utfl_string_compare_trim_) || !defined(_di_fl_utfl_string_dynamic_compare_trim_) || !defined(_di_fl_utfl_string_dynamic_partial_compare_trim_) /** * Private implementation of fl_utf_string_prepend(). @@ -188,7 +188,7 @@ extern "C" { #endif // !defined(_di_fl_utf_string_prepend_nulless_) || !defined(_di_fl_utf_string_dynamic_prepend_nulless_) || !defined(_di_fl_utf_string_append_mish_) || !defined(_di_fl_utf_string_dynamic_mish_) /** - * Private implementation of fl_utf_string_rip(), but only the part for finding the start/stop range. + * Private implementation of fl_utfl_string_rip(), but only the part for finding the start/stop range. * * Intended to be shared to each of the different implementation variations. * @@ -208,12 +208,12 @@ extern "C" { * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * - * @see fl_utf_string_dynamic_rip() - * @see fl_utf_string_rip() + * @see fl_utfl_string_dynamic_rip() + * @see fl_utfl_string_rip() */ -#if !defined(_di_fl_utf_string_rip_) || !defined(_di_fl_utf_string_dynamic_rip_) || !defined(_di_fl_utf_string_rip_nulless_) || !defined(_di_fl_utf_string_dynamic_rip_nulless_) - extern f_status_t private_fl_utf_string_rip_find_range(const f_utf_string_t source, f_utf_string_length_t *start, f_utf_string_length_t *stop) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_utf_string_rip_) || !defined(_di_fl_utf_string_dynamic_rip_) || !defined(_di_fl_utf_string_rip_nulless_) || !defined(_di_fl_utf_string_dynamic_rip_nulless_) +#if !defined(_di_fl_utfl_string_rip_) || !defined(_di_fl_utfl_string_dynamic_rip_) || !defined(_di_fl_utfl_string_rip_nulless_) || !defined(_di_fl_utfl_string_dynamic_rip_nulless_) + extern f_status_t private_fl_utfl_string_rip_find_range(const f_utf_string_t source, f_utf_string_length_t *start, f_utf_string_length_t *stop) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_fl_utfl_string_rip_) || !defined(_di_fl_utfl_string_dynamic_rip_) || !defined(_di_fl_utfl_string_rip_nulless_) || !defined(_di_fl_utfl_string_dynamic_rip_nulless_) #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_utf/c/utf.c b/level_1/fl_utf/c/utf.c index dc09db0..a6c240e 100644 --- a/level_1/fl_utf/c/utf.c +++ b/level_1/fl_utf/c/utf.c @@ -107,17 +107,17 @@ extern "C" { } #endif // _di_fl_utf_string_append_nulless_ -#ifndef _di_fl_utf_string_compare_ - f_status_t fl_utf_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t length1, const f_utf_string_length_t length2) { - return private_fl_utf_string_compare(string1, string2, 0, 0, length1, length2); +#ifndef _di_fl_utfl_string_compare_ + f_status_t fl_utfl_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t length1, const f_utf_string_length_t length2) { + return private_fl_utfl_string_compare(string1, string2, 0, 0, length1, length2); } -#endif // _di_fl_utf_string_compare_ +#endif // _di_fl_utfl_string_compare_ -#ifndef _di_fl_utf_string_compare_trim_ - f_status_t fl_utf_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t length1, const f_utf_string_length_t length2) { - return private_fl_utf_string_compare_trim(string1, string2, 0, 0, length1, length2); +#ifndef _di_fl_utfl_string_compare_trim_ + f_status_t fl_utfl_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t length1, const f_utf_string_length_t length2) { + return private_fl_utfl_string_compare_trim(string1, string2, 0, 0, length1, length2); } -#endif // _di_fl_utf_string_compare_trim_ +#endif // _di_fl_utfl_string_compare_trim_ #ifndef _di_fl_utf_string_dynamic_append_ f_status_t fl_utf_string_dynamic_append(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { @@ -221,17 +221,17 @@ extern "C" { } #endif // _di_fl_utf_string_dynamic_append_nulless_ -#ifndef _di_fl_utf_string_dynamic_compare_ - f_status_t fl_utf_string_dynamic_compare(const f_utf_string_static_t string1, const f_utf_string_static_t string2) { - return private_fl_utf_string_compare(string1.string, string2.string, 0, 0, string1.used, string2.used); +#ifndef _di_fl_utfl_string_dynamic_compare_ + f_status_t fl_utfl_string_dynamic_compare(const f_utf_string_static_t string1, const f_utf_string_static_t string2) { + return private_fl_utfl_string_compare(string1.string, string2.string, 0, 0, string1.used, string2.used); } -#endif // _di_fl_utf_string_dynamic_compare_ +#endif // _di_fl_utfl_string_dynamic_compare_ -#ifndef _di_f_utf_string_dynamic_compare_trim_ - f_status_t f_utf_string_dynamic_compare_trim(const f_utf_string_static_t string1, const f_utf_string_static_t string2) { - return private_fl_utf_string_compare_trim(string1.string, string2.string, 0, 0, string1.used, string2.used); +#ifndef _di_f_utfl_string_dynamic_compare_trim_ + f_status_t f_utfl_string_dynamic_compare_trim(const f_utf_string_static_t string1, const f_utf_string_static_t string2) { + return private_fl_utfl_string_compare_trim(string1.string, string2.string, 0, 0, string1.used, string2.used); } -#endif // _di_f_utf_string_dynamic_compare_trim_ +#endif // _di_f_utfl_string_dynamic_compare_trim_ #ifndef _di_fl_utf_string_dynamic_mash_ f_status_t fl_utf_string_dynamic_mash(const f_utf_string_t glue, const f_utf_string_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { @@ -411,27 +411,27 @@ extern "C" { } #endif // _di_fl_utf_string_dynamic_partial_append_nulless_ -#ifndef _di_fl_utf_string_dynamic_partial_compare_ - f_status_t fl_utf_string_dynamic_partial_compare(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_utf_string_range_t range1, const f_utf_string_range_t range2) { +#ifndef _di_fl_utfl_string_dynamic_partial_compare_ + f_status_t fl_utfl_string_dynamic_partial_compare(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_utf_string_range_t range1, const f_utf_string_range_t range2) { #ifndef _di_level_1_parameter_checking_ if (string1.used <= range1.stop) return F_status_set_error(F_parameter); if (string2.used <= range2.stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - return private_fl_utf_string_compare(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); + return private_fl_utfl_string_compare(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); } -#endif // _di_fl_utf_string_dynamic_partial_compare_ +#endif // _di_fl_utfl_string_dynamic_partial_compare_ -#ifndef _di_fl_utf_string_dynamic_partial_compare_trim_ - f_status_t fl_utf_string_dynamic_partial_comparetrim(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_utf_string_range_t range1, const f_utf_string_range_t range2) { +#ifndef _di_fl_utfl_string_dynamic_partial_compare_trim_ + f_status_t fl_utfl_string_dynamic_partial_comparetrim(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_utf_string_range_t range1, const f_utf_string_range_t range2) { #ifndef _di_level_1_parameter_checking_ if (string1.used <= range1.stop) return F_status_set_error(F_parameter); if (string2.used <= range2.stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - return private_fl_utf_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); + return private_fl_utfl_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); } -#endif // _di_fl_utf_string_dynamic_partial_compare_trim_ +#endif // _di_fl_utfl_string_dynamic_partial_compare_trim_ #ifndef _di_fl_utf_string_dynamic_partial_mash_ f_status_t fl_utf_string_dynamic_partial_mash(const f_utf_string_t glue, const f_utf_string_length_t glue_length, const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination) { @@ -725,8 +725,8 @@ extern "C" { } #endif // _di_fl_utf_string_dynamic_prepend_nulless_ -#ifndef _di_fl_utf_string_dynamic_rip_ - f_status_t fl_utf_string_dynamic_rip(const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination) { +#ifndef _di_fl_utfl_string_dynamic_rip_ + f_status_t fl_utfl_string_dynamic_rip(const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (source.used <= range.start) return F_status_set_error(F_parameter); if (source.used <= range.stop) return F_status_set_error(F_parameter); @@ -738,10 +738,10 @@ extern "C" { return private_fl_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); } -#endif // _di_fl_utf_string_dynamic_rip_ +#endif // _di_fl_utfl_string_dynamic_rip_ -#ifndef _di_fl_utf_string_dynamic_rip_nulless_ - f_status_t fl_utf_string_dynamic_rip_nulless(const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination) { +#ifndef _di_fl_utfl_string_dynamic_rip_nulless_ + f_status_t fl_utfl_string_dynamic_rip_nulless(const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (source.used <= range.start) return F_status_set_error(F_parameter); if (source.used <= range.stop) return F_status_set_error(F_parameter); @@ -753,10 +753,10 @@ extern "C" { return private_fl_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); } -#endif // _di_fl_utf_string_dynamic_rip_nulless_ +#endif // _di_fl_utfl_string_dynamic_rip_nulless_ -#ifndef _di_fl_utf_string_dynamic_seek_line_to_ - f_status_t fl_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this) { +#ifndef _di_fl_utfl_string_dynamic_seek_line_to_ + f_status_t fl_utfl_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -786,10 +786,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_dynamic_seek_line_to_ +#endif // _di_fl_utfl_string_dynamic_seek_line_to_ -#ifndef _di_fl_utf_string_dynamic_seek_line_to_char_ - f_status_t fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const int8_t seek_to_this) { +#ifndef _di_fl_utfl_string_dynamic_seek_line_to_char_ + f_status_t fl_utfl_string_dynamic_seek_line_to_char(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -823,10 +823,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_dynamic_seek_line_to_character_ +#endif // _di_fl_utfl_string_dynamic_seek_line_to_character_ -#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_ - f_status_t fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t placeholder) { +#ifndef _di_fl_utfl_string_dynamic_seek_line_until_graph_ + f_status_t fl_utfl_string_dynamic_seek_line_until_graph(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t placeholder) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -861,10 +861,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_dynamic_seek_line_until_graph_ +#endif // _di_fl_utfl_string_dynamic_seek_line_until_graph_ -#ifndef _di_fl_utf_string_dynamic_seek_line_until_non_graph_ - f_status_t fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t placeholder) { +#ifndef _di_fl_utfl_string_dynamic_seek_line_until_non_graph_ + f_status_t fl_utfl_string_dynamic_seek_line_until_non_graph(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t placeholder) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -899,10 +899,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_dynamic_seek_line_until_non_graph_ +#endif // _di_fl_utfl_string_dynamic_seek_line_until_non_graph_ -#ifndef _di_fl_utf_string_dynamic_seek_to_ - f_status_t fl_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this) { +#ifndef _di_fl_utfl_string_dynamic_seek_to_ + f_status_t fl_utfl_string_dynamic_seek_to(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -929,10 +929,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_dynamic_seek_to_ +#endif // _di_fl_utfl_string_dynamic_seek_to_ -#ifndef _di_fl_utf_string_dynamic_seek_to_char_ - f_status_t fl_utf_string_dynamic_seek_to_char(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const int8_t seek_to_this) { +#ifndef _di_fl_utfl_string_dynamic_seek_to_char_ + f_status_t fl_utfl_string_dynamic_seek_to_char(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -961,7 +961,7 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_dynamic_seek_to_char_ +#endif // _di_fl_utfl_string_dynamic_seek_to_char_ #ifndef _di_fl_utf_string_dynamic_terminate_ f_status_t fl_utf_string_dynamic_terminate(f_utf_string_dynamic_t *destination) { @@ -1198,8 +1198,8 @@ extern "C" { } #endif // _di_fl_utf_string_prepend_nulless_ -#ifndef _di_fl_utf_string_rip_ - f_status_t fl_utf_string_rip(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { +#ifndef _di_fl_utfl_string_rip_ + f_status_t fl_utfl_string_rip(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1209,17 +1209,17 @@ extern "C" { f_utf_string_length_t begin = 0; f_utf_string_length_t end = length - 1; - f_status_t status = private_fl_utf_string_rip_find_range(source, &begin, &end); + f_status_t status = private_fl_utfl_string_rip_find_range(source, &begin, &end); if (F_status_is_error(status)) return status; if (status == F_data_not) return status; return private_fl_utf_string_append(source + begin, (end - begin) + 1, destination); } -#endif // _di_fl_utf_string_rip_ +#endif // _di_fl_utfl_string_rip_ -#ifndef _di_fl_utf_string_rip_nulless_ - f_status_t fl_utf_string_rip_nulless(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { +#ifndef _di_fl_utfl_string_rip_nulless_ + f_status_t fl_utfl_string_rip_nulless(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1229,17 +1229,17 @@ extern "C" { f_utf_string_length_t begin = 0; f_utf_string_length_t end = length - 1; - f_status_t status = private_fl_utf_string_rip_find_range(source, &begin, &end); + f_status_t status = private_fl_utfl_string_rip_find_range(source, &begin, &end); if (F_status_is_error(status)) return status; if (status == F_data_not) return status; return private_fl_utf_string_append_nulless(source + begin, (end - begin) + 1, destination); } -#endif // _di_fl_utf_string_rip_nulless_ +#endif // _di_fl_utfl_string_rip_nulless_ -#ifndef _di_fl_utf_string_seek_line_to_ - f_status_t fl_utf_string_seek_line_to(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t seek_to_this) { +#ifndef _di_fl_utfl_string_seek_line_to_ + f_status_t fl_utfl_string_seek_line_to(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1267,10 +1267,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_seek_line_to_ +#endif // _di_fl_utfl_string_seek_line_to_ -#ifndef _di_fl_utf_string_seek_line_to_char_ - f_status_t fl_utf_string_seek_line_to_char(const f_utf_string_t string, f_utf_string_range_t *range, const int8_t seek_to_this) { +#ifndef _di_fl_utfl_string_seek_line_to_char_ + f_status_t fl_utfl_string_seek_line_to_char(const f_utf_string_t string, f_utf_string_range_t *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1291,10 +1291,10 @@ extern "C" { return F_none_stop; } -#endif // _di_fl_utf_string_seek_line_to_char_ +#endif // _di_fl_utfl_string_seek_line_to_char_ -#ifndef _di_fl_utf_string_seek_line_until_graph_ - f_status_t fl_utf_string_seek_line_until_graph(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t placeholder) { +#ifndef _di_fl_utfl_string_seek_line_until_graph_ + f_status_t fl_utfl_string_seek_line_until_graph(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t placeholder) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1325,10 +1325,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_seek_line_until_graph_ +#endif // _di_fl_utfl_string_seek_line_until_graph_ -#ifndef _di_fl_utf_string_seek_line_until_non_graph_ - f_status_t fl_utf_string_seek_line_until_non_graph(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t placeholder) { +#ifndef _di_fl_utfl_string_seek_line_until_non_graph_ + f_status_t fl_utfl_string_seek_line_until_non_graph(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t placeholder) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1357,10 +1357,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_seek_line_until_non_graph_ +#endif // _di_fl_utfl_string_seek_line_until_non_graph_ -#ifndef _di_fl_utf_string_seek_to_ - f_status_t fl_utf_string_seek_to(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t seek_to_this) { +#ifndef _di_fl_utfl_string_seek_to_ + f_status_t fl_utfl_string_seek_to(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1383,10 +1383,10 @@ extern "C" { return F_none; } -#endif // _di_fl_utf_string_seek_to_ +#endif // _di_fl_utfl_string_seek_to_ -#ifndef _di_fl_utf_string_seek_to_char_ - f_status_t fl_utf_string_seek_to_char(const f_utf_string_t string, f_utf_string_range_t *range, const int8_t seek_to_this) { +#ifndef _di_fl_utfl_string_seek_to_char_ + f_status_t fl_utfl_string_seek_to_char(const f_utf_string_t string, f_utf_string_range_t *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1414,7 +1414,7 @@ extern "C" { return F_none_stop; } -#endif // _di_fl_utf_string_seek_to_utf_character_ +#endif // _di_fl_utfl_string_seek_to_utf_character_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_utf/c/utf.h b/level_1/fl_utf/c/utf.h index 005075e..0f46d78 100644 --- a/level_1/fl_utf/c/utf.h +++ b/level_1/fl_utf/c/utf.h @@ -150,9 +150,9 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_fl_utf_string_compare_ - extern f_status_t fl_utf_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t length1, const f_utf_string_length_t length2); -#endif // _di_fl_utf_string_compare_ +#ifndef _di_fl_utfl_string_compare_ + extern f_status_t fl_utfl_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t length1, const f_utf_string_length_t length2); +#endif // _di_fl_utfl_string_compare_ /** * Compare two UTF-8 strings, similar to strncmp(). @@ -179,9 +179,9 @@ extern "C" { * * @see f_utf_character_is_whitespace() */ -#ifndef _di_fl_utf_string_compare_trim_ - extern f_status_t fl_utf_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t length1, const f_utf_string_length_t length2); -#endif // _di_fl_utf_string_compare_trim_ +#ifndef _di_fl_utfl_string_compare_trim_ + extern f_status_t fl_utfl_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_utf_string_length_t length1, const f_utf_string_length_t length2); +#endif // _di_fl_utfl_string_compare_trim_ /** * Append the UTF-8 source string onto the destination. @@ -284,9 +284,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. */ -#ifndef _di_fl_utf_string_dynamic_compare_ - extern f_status_t fl_utf_string_dynamic_compare(const f_utf_string_static_t string1, const f_utf_string_static_t string2); -#endif // _di_fl_utf_string_dynamic_compare_ +#ifndef _di_fl_utfl_string_dynamic_compare_ + extern f_status_t fl_utfl_string_dynamic_compare(const f_utf_string_static_t string1, const f_utf_string_static_t string2); +#endif // _di_fl_utfl_string_dynamic_compare_ /** * Compare two UTF-8 strings, similar to strncmp(). @@ -310,9 +310,9 @@ extern "C" { * * @see f_utf_character_is_whitespace() */ -#ifndef _di_f_utf_string_dynamic_compare_trim_ - extern f_status_t f_utf_string_dynamic_compare_trim(const f_utf_string_static_t string1, const f_utf_string_static_t string2); -#endif // _di_f_utf_string_dynamic_compare_trim_ +#ifndef _di_f_utfl_string_dynamic_compare_trim_ + extern f_status_t f_utfl_string_dynamic_compare_trim(const f_utf_string_static_t string1, const f_utf_string_static_t string2); +#endif // _di_f_utfl_string_dynamic_compare_trim_ /** * Append the UTF-8 source string onto the destination with the glue in between. @@ -542,9 +542,9 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_fl_utf_string_dynamic_partial_compare_ - extern f_status_t fl_utf_string_dynamic_partial_compare(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_utf_string_range_t range1, const f_utf_string_range_t range2); -#endif // _di_fl_utf_string_dynamic_partial_compare_ +#ifndef _di_fl_utfl_string_dynamic_partial_compare_ + extern f_status_t fl_utfl_string_dynamic_partial_compare(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_utf_string_range_t range1, const f_utf_string_range_t range2); +#endif // _di_fl_utfl_string_dynamic_partial_compare_ /** * Compare two UTF-8 strings, similar to strncmp(), but restricted to the given ranges. @@ -571,9 +571,9 @@ extern "C" { * * @see f_utf_character_is_whitespace() */ -#ifndef _di_fl_utf_string_dynamic_partial_compare_trim_ - extern f_status_t fl_utf_string_dynamic_partial_compare_trim(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_utf_string_range_t range1, const f_utf_string_range_t range2); -#endif // _di_fl_utf_string_dynamic_partial_compare_trim_ +#ifndef _di_fl_utfl_string_dynamic_partial_compare_trim_ + extern f_status_t fl_utfl_string_dynamic_partial_compare_trim(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_utf_string_range_t range1, const f_utf_string_range_t range2); +#endif // _di_fl_utfl_string_dynamic_partial_compare_trim_ /** * Append the UTF-8 source string onto the destination with the glue in between, but restricted to the given range. @@ -917,9 +917,9 @@ extern "C" { * 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_fl_utf_string_dynamic_rip_ - extern f_status_t fl_utf_string_dynamic_rip(const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination); -#endif // _di_fl_utf_string_dynamic_rip_ +#ifndef _di_fl_utfl_string_dynamic_rip_ + extern f_status_t fl_utfl_string_dynamic_rip(const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination); +#endif // _di_fl_utfl_string_dynamic_rip_ /** * Allocate a new UTF-8 string from the provided range in the buffer. @@ -944,9 +944,9 @@ extern "C" { * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_fl_utf_string_dynamic_rip_nulless_ - extern f_status_t fl_utf_string_dynamic_rip_nulless(const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination); -#endif // _di_fl_utf_string_dynamic_rip_nulless_ +#ifndef _di_fl_utfl_string_dynamic_rip_nulless_ + extern f_status_t fl_utfl_string_dynamic_rip_nulless(const f_utf_string_static_t source, const f_utf_string_range_t range, f_utf_string_dynamic_t *destination); +#endif // _di_fl_utfl_string_dynamic_rip_nulless_ /** * Seek the buffer location forward until the UTF-8 character or EOL is reached. @@ -969,9 +969,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. */ -#ifndef _di_fl_utf_string_dynamic_seek_line_to_ - extern f_status_t fl_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); -#endif // _di_fl_utf_string_dynamic_seek_line_to_ +#ifndef _di_fl_utfl_string_dynamic_seek_line_to_ + extern f_status_t fl_utfl_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); +#endif // _di_fl_utfl_string_dynamic_seek_line_to_ /** * Seek the buffer location forward until the (1-byte wide) character or EOL is reached. @@ -993,9 +993,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. */ -#ifndef _di_fl_utf_string_seek_line_to_char_ - extern f_status_t fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const int8_t seek_to_this); -#endif // _di_fl_utf_string_seek_line_to_char_ +#ifndef _di_fl_utfl_string_seek_line_to_char_ + extern f_status_t fl_utfl_string_dynamic_seek_line_to_char(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const int8_t seek_to_this); +#endif // _di_fl_utfl_string_seek_line_to_char_ /** * Increment buffer location until a graph character or an EOL is matched. @@ -1020,9 +1020,9 @@ extern "C" { * * @see f_utf_character_is_graph() */ -#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_ - extern f_status_t fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t placeholder); -#endif // _di_fl_utf_string_dynamic_seek_line_until_graph_ +#ifndef _di_fl_utfl_string_dynamic_seek_line_until_graph_ + extern f_status_t fl_utfl_string_dynamic_seek_line_until_graph(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t placeholder); +#endif // _di_fl_utfl_string_dynamic_seek_line_until_graph_ /** * Increment buffer location until a non-graph character or an EOL is matched. @@ -1048,9 +1048,9 @@ extern "C" { * * @see f_utf_character_is_graph() */ -#ifndef _di_fl_utf_string_dynamic_seek_line_until_non_graph_ - extern f_status_t fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t placeholder); -#endif // _di_fl_utf_string_dynamic_seek_line_until_non_graph_ +#ifndef _di_fl_utfl_string_dynamic_seek_line_until_non_graph_ + extern f_status_t fl_utfl_string_dynamic_seek_line_until_non_graph(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t placeholder); +#endif // _di_fl_utfl_string_dynamic_seek_line_until_non_graph_ /** * Seek the buffer location forward until the UTF-8 character is reached. @@ -1072,9 +1072,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. */ -#ifndef _di_fl_utf_string_dynamic_seek_to_ - extern f_status_t fl_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); -#endif // _di_fl_utf_string_dynamic_seek_to_ +#ifndef _di_fl_utfl_string_dynamic_seek_to_ + extern f_status_t fl_utfl_string_dynamic_seek_to(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); +#endif // _di_fl_utfl_string_dynamic_seek_to_ /** * Seek the buffer location forward until the UTF-8 character (1-byte wide) is reached. @@ -1096,9 +1096,9 @@ extern "C" { * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_fl_utf_string_dynamic_seek_to_char_ - extern f_status_t fl_utf_string_dynamic_seek_to_char(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const int8_t seek_to_this); -#endif // _di_fl_utf_string_dynamic_seek_to_char_ +#ifndef _di_fl_utfl_string_dynamic_seek_to_char_ + extern f_status_t fl_utfl_string_dynamic_seek_to_char(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const int8_t seek_to_this); +#endif // _di_fl_utfl_string_dynamic_seek_to_char_ /** * Seek the buffer location forward until the (4-byte wide) UTF-8 character is reached. @@ -1123,9 +1123,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. */ -#ifndef _di_fl_utf_string_dynamic_seek_to_utf_character_ - extern f_status_t fl_utf_string_dynamic_seek_to_utf_character(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); -#endif // _di_fl_utf_string_dynamic_seek_to_utf_character_ +#ifndef _di_fl_utfl_string_dynamic_seek_to_utf_character_ + extern f_status_t fl_utfl_string_dynamic_seek_to_utf_character(const f_utf_string_static_t buffer, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); +#endif // _di_fl_utfl_string_dynamic_seek_to_utf_character_ /** * Guarantee that an end of UTF-8 string (NULL) exists at the end of the string. @@ -1415,9 +1415,9 @@ extern "C" { * * @see f_utf_character_is_whitespace() */ -#ifndef _di_fl_utf_string_rip_ - extern f_status_t fl_utf_string_rip(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); -#endif // _di_fl_utf_string_rip_ +#ifndef _di_fl_utfl_string_rip_ + extern f_status_t fl_utfl_string_rip(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); +#endif // _di_fl_utfl_string_rip_ /** * Allocate a new UTF-8 string from the provided range in the string. @@ -1445,9 +1445,9 @@ extern "C" { * * @see f_utf_character_is_whitespace() */ -#ifndef _di_fl_utf_string_rip_nulless_ - extern f_status_t fl_utf_string_rip_nulless(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); -#endif // _di_fl_utf_string_rip_nulless_ +#ifndef _di_fl_utfl_string_rip_nulless_ + extern f_status_t fl_utfl_string_rip_nulless(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); +#endif // _di_fl_utfl_string_rip_nulless_ /** * Seek the UTF-8 string location forward until the character (1-byte wide) or EOL is reached. @@ -1467,9 +1467,9 @@ extern "C" { * F_data_not_stop if range.start > range.stop. * F_parameter (with error bit) if a parameter is invalid. */ -#ifndef _di_fl_utf_string_seek_line_to_ - extern f_status_t fl_utf_string_seek_line_to(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); -#endif // _di_fl_utf_string_seek_line_to_ +#ifndef _di_fl_utfl_string_seek_line_to_ + extern f_status_t fl_utfl_string_seek_line_to(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); +#endif // _di_fl_utfl_string_seek_line_to_ /** * Seek the string location forward until the 1-byte wide character or EOL is reached. @@ -1490,9 +1490,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. */ -#ifndef _di_fl_utf_string_seek_line_to_char_ - extern f_status_t fl_utf_string_seek_line_to_char(const f_utf_string_t string, f_utf_string_range_t *range, const int8_t seek_to_this); -#endif // _di_fl_utf_string_seek_line_to_char_ +#ifndef _di_fl_utfl_string_seek_line_to_char_ + extern f_status_t fl_utfl_string_seek_line_to_char(const f_utf_string_t string, f_utf_string_range_t *range, const int8_t seek_to_this); +#endif // _di_fl_utfl_string_seek_line_to_char_ /** * Increment string location until a UTF-8 graph character or an EOL is matched. @@ -1520,9 +1520,9 @@ extern "C" { * * @see f_utf_character_is_graph() */ -#ifndef _di_fl_utf_string_seek_line_until_graph_ - extern f_status_t fl_utf_string_seek_line_until_graph(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t placeholder); -#endif // _di_fl_utf_string_seek_line_until_graph_ +#ifndef _di_fl_utfl_string_seek_line_until_graph_ + extern f_status_t fl_utfl_string_seek_line_until_graph(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t placeholder); +#endif // _di_fl_utfl_string_seek_line_until_graph_ /** * Increment string location until a non-graph UTF-8 character or an EOL is matched. @@ -1551,9 +1551,9 @@ extern "C" { * * @see f_utf_character_is_graph() */ -#ifndef _di_fl_utf_string_seek_line_until_non_graph_ - extern f_status_t fl_utf_string_seek_line_until_non_graph(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t placeholder); -#endif // _di_fl_utf_string_seek_line_until_non_graph_ +#ifndef _di_fl_utfl_string_seek_line_until_non_graph_ + extern f_status_t fl_utfl_string_seek_line_until_non_graph(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t placeholder); +#endif // _di_fl_utfl_string_seek_line_until_non_graph_ /** * Seek the string location forward until the character (1-byte wide) is reached. @@ -1573,9 +1573,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. */ -#ifndef _di_fl_utf_string_seek_to_ - extern f_status_t fl_utf_string_seek_to(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); -#endif // _di_fl_utf_string_seek_to_ +#ifndef _di_fl_utfl_string_seek_to_ + extern f_status_t fl_utfl_string_seek_to(const f_utf_string_t string, f_utf_string_range_t *range, const f_utf_character_t seek_to_this); +#endif // _di_fl_utfl_string_seek_to_ /** * Seek the string location forward until the UTF-8 character (up to 4-byte wide) is reached. @@ -1596,8 +1596,8 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. */ -#ifndef _di_fl_utf_string_seek_to_character_ - extern f_status_t fl_utf_string_seek_to_char(const f_utf_string_t string, f_utf_string_range_t *range, const int8_t seek_to_this); +#ifndef _di_fl_utfl_string_seek_to_character_ + extern f_status_t fl_utfl_string_seek_to_char(const f_utf_string_t string, f_utf_string_range_t *range, const int8_t seek_to_this); #endif // _di_fl_utf_string__seek_to_character_ #ifdef __cplusplus diff --git a/level_2/fll_environment/c/environment.c b/level_2/fll_environment/c/environment.c index e359de6..9080187 100644 --- a/level_2/fll_environment/c/environment.c +++ b/level_2/fll_environment/c/environment.c @@ -15,7 +15,7 @@ extern "C" { return F_data_not; } - f_status_t status = fl_string_maps_increase(environment); + f_status_t status = f_string_maps_increase(environment); if (F_status_is_error(status)) return status; environment->array[environment->used].name.used = 0; @@ -23,7 +23,7 @@ extern "C" { const f_string_static_t name_string = f_macro_string_static_t_initialize(name, length); - status = fl_string_dynamic_append_nulless(name_string, &environment->array[environment->used].name); + status = f_string_dynamic_append_nulless(name_string, &environment->array[environment->used].name); if (F_status_is_error(status)) return status; status = f_environment_get_dynamic(name_string, &environment->array[environment->used].value); @@ -54,7 +54,7 @@ extern "C" { return F_data_not; } - f_status_t status = fl_string_maps_increase_by(names.used, environment); + f_status_t status = f_string_maps_increase_by(names.used, environment); if (F_status_is_error(status)) return status; for (f_array_length_t i = 0; i < names.used; ++i) { @@ -62,7 +62,7 @@ extern "C" { environment->array[environment->used].name.used = 0; environment->array[environment->used].value.used = 0; - status = fl_string_dynamic_append_nulless(names.array[i], &environment->array[environment->used].name); + status = f_string_dynamic_append_nulless(names.array[i], &environment->array[environment->used].name); if (F_status_is_error(status)) return status; status = f_environment_get_dynamic(names.array[i], &environment->array[environment->used].value); diff --git a/level_2/fll_environment/c/environment.h b/level_2/fll_environment/c/environment.h index 9970964..24b39e1 100644 --- a/level_2/fll_environment/c/environment.h +++ b/level_2/fll_environment/c/environment.h @@ -48,12 +48,12 @@ extern "C" { * F_exist_not if name does not exist. * * Errors (with error bit) from: f_environment_get_dynamic(). - * Errors (with error bit) from: fl_string_dynamic_append_nulless(). - * Errors (with error bit) from: fl_string_maps_increase_by(). + * Errors (with error bit) from: f_string_dynamic_append_nulless(). + * Errors (with error bit) from: f_string_maps_increase_by(). * * @see f_environment_get_dynamic() - * @see fl_string_dynamic_append_nulless() - * @see fl_string_maps_increase_by() + * @see f_string_dynamic_append_nulless() + * @see f_string_maps_increase_by() */ #ifndef _di_fll_environment_load_name_ extern f_status_t fll_environment_load_name(const f_string_t name, const f_string_length_t length, f_string_maps_t *environment); @@ -78,12 +78,12 @@ extern "C" { * F_data_not if names.used is 0. * * Errors (with error bit) from: f_environment_get_dynamic(). - * Errors (with error bit) from: fl_string_dynamic_append_nulless(). - * Errors (with error bit) from: fl_string_maps_increase_by(). + * Errors (with error bit) from: f_string_dynamic_append_nulless(). + * Errors (with error bit) from: f_string_maps_increase_by(). * * @see f_environment_get_dynamic() - * @see fl_string_dynamic_append_nulless() - * @see fl_string_maps_increase_by() + * @see f_string_dynamic_append_nulless() + * @see f_string_maps_increase_by() */ #ifndef _di_fll_environment_load_names_ extern f_status_t fll_environment_load_names(const f_string_dynamics_t names, f_string_maps_t *environment); diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index fa70c70..1782b6d 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -205,13 +205,13 @@ extern "C" { } if (F_status_is_error(status)) { - fl_string_dynamic_delete(&path); - fl_string_dynamics_delete(&paths); + f_string_dynamic_delete(&path); + f_string_dynamics_delete(&paths); return status; } - status = fl_string_dynamic_delete(&path); + status = f_string_dynamic_delete(&path); if (F_status_is_error(status)) { f_macro_string_dynamics_t_delete_simple(paths); @@ -223,10 +223,10 @@ extern "C" { for (f_array_length_t i = 0; i < paths.used; i++) { - status = fl_string_append(program_name, name_size, &paths.array[i]); + status = f_string_append(program_name, name_size, &paths.array[i]); if (F_status_is_error_not(status)) { - status = fl_string_dynamic_terminate(&paths.array[i]); + status = f_string_dynamic_terminate(&paths.array[i]); } if (F_status_is_error_not(status)) { @@ -254,14 +254,14 @@ extern "C" { } if (F_status_is_error(status)) { - fl_string_dynamics_delete(&paths); + f_string_dynamics_delete(&paths); return status; } } // for if (!found) { - fl_string_dynamics_delete(&paths); + f_string_dynamics_delete(&paths); return F_status_set_error(F_file_found_not); } @@ -270,7 +270,7 @@ extern "C" { memcpy(&program_path, found->string, found->used); - status = fl_string_dynamics_delete(&paths); + status = f_string_dynamics_delete(&paths); if (F_status_is_error(status)) return status; if (parameter && parameter->data) { diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index c12bde5..a9006b6 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -72,16 +72,16 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_macro_string_dynamics_t_resize(). - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_macro_string_dynamics_t_resize() - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_add_ extern f_status_t fll_execute_arguments_add(const f_string_t source, const f_string_length_t length, f_string_dynamics_t *arguments); @@ -117,15 +117,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_add_parameter_ extern f_status_t fll_execute_arguments_add_parameter(const f_string_t prefix, const f_string_length_t prefix_length, const f_string_t name, const f_string_length_t name_length, const f_string_t value, const f_string_length_t value_length, f_string_dynamics_t *arguments); @@ -163,15 +163,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_add_parameter_set_ extern f_status_t fll_execute_arguments_add_parameter_set(const f_string_t prefix[], const f_string_length_t prefix_length[], const f_string_t name[], const f_string_length_t name_length[], const f_string_t value[], const f_string_length_t value_length[], const f_array_length_t size, f_string_dynamics_t *arguments); @@ -195,15 +195,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_add_set_ extern f_status_t fll_execute_arguments_add_set(const f_string_t source[], const f_string_length_t length[], const f_array_length_t size, f_string_dynamics_t *arguments); @@ -223,15 +223,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_dynamic_add_ extern f_status_t fll_execute_arguments_dynamic_add(const f_string_static_t source, f_string_dynamics_t *arguments); @@ -261,15 +261,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_ extern f_status_t fll_execute_arguments_dynamic_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments); @@ -301,15 +301,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_set_ extern f_status_t fll_execute_arguments_dynamic_add_parameter_set(const f_string_static_t prefix[], const f_string_static_t name[], const f_string_static_t value[], const f_array_length_t size, f_string_dynamics_t *arguments); @@ -331,15 +331,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() */ #ifndef _di_fll_execute_arguments_dynamic_add_set_ extern f_status_t fll_execute_arguments_dynamic_add_set(const f_string_static_t source[], const f_array_length_t size, f_string_dynamics_t *arguments); @@ -454,9 +454,9 @@ extern "C" { * Errors (with error bit) from: f_signal_mask(). * Errors (with error bit) from: f_thread_signal_mask(). * Errors (with error bit) from: fl_environment_path_explode_dynamic(). - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). * * @see close() * @see clearenv() @@ -485,8 +485,8 @@ extern "C" { * @see f_thread_signal_mask() * @see fl_control_group_apply() * @see fl_environment_path_explode_dynamic() - * @see fl_string_append() - * @see fl_string_dynamic_terminate() + * @see f_string_append() + * @see f_string_dynamic_terminate() */ #ifndef _di_fll_execute_program_ extern f_status_t fll_execute_program(const f_string_t program, const f_string_statics_t arguments, fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, int *result); diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index ffd52ab..78a3067 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -8,24 +8,24 @@ extern "C" { #if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) f_status_t private_fll_execute_arguments_add(const f_string_t source, const f_string_length_t length, f_string_dynamics_t *arguments) { - f_status_t status = fl_string_dynamics_increase(arguments); + f_status_t status = f_string_dynamics_increase(arguments); if (F_status_is_error(status)) return status; f_string_dynamic_t argument = f_string_dynamic_t_initialize; if (length) { - status = fl_string_append(source, length, &argument); + status = f_string_append(source, length, &argument); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); return status; } } - status = fl_string_dynamic_terminate(&argument); + status = f_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); return status; } @@ -41,35 +41,35 @@ extern "C" { #if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) f_status_t private_fll_execute_arguments_add_parameter(const f_string_t prefix, const f_string_length_t prefix_length, const f_string_t name, const f_string_length_t name_length, const f_string_t value, const f_string_length_t value_length, f_string_dynamics_t *arguments) { - f_status_t status = fl_string_dynamics_increase(arguments); + f_status_t status = f_string_dynamics_increase(arguments); if (F_status_is_error(status)) return status; f_string_dynamic_t argument = f_string_dynamic_t_initialize; if (prefix_length) { - status = fl_string_append(prefix, prefix_length, &argument); + status = f_string_append(prefix, prefix_length, &argument); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); return status; } } if (name_length) { - status = fl_string_append(name, name_length, &argument); + status = f_string_append(name, name_length, &argument); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); return status; } } - status = fl_string_dynamic_terminate(&argument); + status = f_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); return status; } @@ -82,27 +82,27 @@ extern "C" { f_macro_string_dynamic_t_clear(argument); if (value_length) { - status = fl_string_append(value, value_length, &argument); + status = f_string_append(value, value_length, &argument); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); return status; } } - status = fl_string_dynamic_terminate(&argument); + status = f_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); return status; } - status = fl_string_dynamics_increase(arguments); + status = f_string_dynamics_increase(arguments); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); return status; } diff --git a/level_2/fll_execute/c/private-execute.h b/level_2/fll_execute/c/private-execute.h index 5ffa8ed..d24136c 100644 --- a/level_2/fll_execute/c/private-execute.h +++ b/level_2/fll_execute/c/private-execute.h @@ -30,15 +30,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). - * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). + * + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() * @see fll_execute_arguments_add() * @see fll_execute_arguments_add_set() * @see fll_execute_arguments_dynamic_add() @@ -71,15 +71,15 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_delete(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamics_increase(). * - * @see fl_string_append() - * @see fl_string_dynamic_delete() - * @see fl_string_dynamic_terminate() - * @see fl_string_dynamics_increase() + * @see f_string_append() + * @see f_string_dynamic_delete() + * @see f_string_dynamic_terminate() + * @see f_string_dynamics_increase() * @see fll_execute_arguments_add_parameter() * @see fll_execute_arguments_add_parameter_set() * @see fll_execute_arguments_dynamic_add_parameter() diff --git a/level_2/fll_fss/c/fss.c b/level_2/fll_fss/c/fss.c index 6974354..3a39465 100644 --- a/level_2/fll_fss/c/fss.c +++ b/level_2/fll_fss/c/fss.c @@ -85,7 +85,7 @@ extern "C" { if (!contents.array[i].used) continue; - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], values[j]); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], values[j]); if (F_status_is_error(status)) return status; if (indexs) { @@ -149,7 +149,7 @@ extern "C" { for (k = 0; k < contents.array[i].used; k++) { - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]); if (F_status_is_error(status)) return status; values[j]->used++; @@ -202,10 +202,10 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_equal_to_not) continue; - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&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)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } if (status == F_equal_to) { matched = F_true; - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&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) { - fl_string_dynamic_delete(&name); + 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)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&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)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } @@ -271,10 +271,10 @@ extern "C" { map = &values[j]->array[values[j]->used]; if (contents.array[i].used > 1) { - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[1], &map->value); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[1], &map->value); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } } @@ -294,7 +294,7 @@ extern "C" { } // for } // for - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return F_none; } #endif // _di_fll_fss_snatch_map_ @@ -359,7 +359,7 @@ extern "C" { map_multi = &values[j]->array[values[j]->used]; - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map_multi->name); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map_multi->name); if (F_status_is_error(status)) return status; values[j]->used++; @@ -379,7 +379,7 @@ extern "C" { for (k = 1; k < contents.array[i].used; k++) { - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], &map_multi->value.array[map_multi->value.used]); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], &map_multi->value.array[map_multi->value.used]); if (F_status_is_error(status)) return status; map_multi->value.used++; @@ -452,7 +452,7 @@ extern "C" { map = &values[j]->array[values[j]->used]; - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map->name); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map->name); if (F_status_is_error(status)) return status; values[j]->used++; @@ -465,7 +465,7 @@ extern "C" { if (contents.array[i].used > 1) { for (k = 1; k < contents.array[i].used; k++) { - status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &map->value); + status = f_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &map->value); if (F_status_is_error(status)) return status; } // for } @@ -511,10 +511,10 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_equal_to_not) continue; - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } @@ -526,7 +526,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)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } @@ -597,7 +597,7 @@ extern "C" { for (k = 1; k < contents.array[i].used; k++) { - status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &map_multi->value.array[map_multi->value.used]); + status = f_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &map_multi->value.array[map_multi->value.used]); if (F_status_is_error(status)) return status; } // for @@ -605,7 +605,7 @@ extern "C" { } // for } // for - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return F_none; } #endif // _di_fll_fss_snatch_map_mash_apart_ @@ -646,10 +646,10 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_equal_to_not) continue; - status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } @@ -661,14 +661,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)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } if (status == F_equal_to) { matched = F_true; - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); break; } } // for @@ -682,14 +682,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) { - fl_string_dynamic_delete(&name); + 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)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } @@ -702,7 +702,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)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } @@ -730,17 +730,17 @@ extern "C" { } if (contents.array[i].used > 1) { - status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[1], &map->value); + status = f_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[1], &map->value); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } } } // for } // for - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return F_none; } #endif // _di_fll_fss_snatch_map_together_ @@ -784,7 +784,7 @@ extern "C" { for (k = 0; k < contents.array[i].used; k++) { - status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]); + status = f_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]); if (F_status_is_error(status)) return status; } // for @@ -855,7 +855,7 @@ extern "C" { for (k = 0; k < contents.array[i].used; k++) { - status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]); + status = f_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]); if (F_status_is_error(status)) return status; } // for @@ -904,7 +904,7 @@ extern "C" { for (k = 0; k < contents.array[i].used; k++) { - status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]); + status = f_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]); if (F_status_is_error(status)) return status; } // for diff --git a/level_2/fll_fss/c/fss.h b/level_2/fll_fss/c/fss.h index 7a3f77c..809b20e 100644 --- a/level_2/fll_fss/c/fss.h +++ b/level_2/fll_fss/c/fss.h @@ -111,10 +111,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() - * @see fl_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_ extern f_status_t fll_fss_snatch(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, f_string_dynamic_t *values[], f_array_length_t *indexs[]); @@ -157,10 +157,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() - * @see fl_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_apart_ extern f_status_t fll_fss_snatch_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, f_string_dynamics_t *values[], f_array_lengths_t *indexs[]); @@ -205,10 +205,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() - * @see fl_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_map_ extern f_status_t fll_fss_snatch_map(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, f_string_maps_t *values[], f_array_lengths_t *indexs[]); @@ -255,10 +255,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() - * @see fl_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_map_apart_ extern f_status_t fll_fss_snatch_map_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, f_string_map_multis_t *values[], f_array_lengths_t *indexs[]); @@ -308,7 +308,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_mash_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_mash_nulless(). */ #ifndef _di_fll_fss_snatch_map_mash_ extern f_status_t fll_fss_snatch_map_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, const f_string_t glue, const f_string_length_t glue_length, f_string_maps_t *values[], f_array_lengths_t *indexs[]); @@ -359,10 +359,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() - * @see fl_string_dynamic_partial_mash_nulless() + * @see f_string_dynamic_partial_mash_nulless() */ #ifndef _di_fll_fss_snatch_map_mash_apart_ extern f_status_t fll_fss_snatch_map_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, const f_string_t glue, const f_string_length_t glue_length, f_string_map_multis_t *values[], f_array_lengths_t *indexs[]); @@ -412,10 +412,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() - * @see fl_string_dynamic_partial_mash_nulless() + * @see f_string_dynamic_partial_mash_nulless() */ #ifndef _di_fll_fss_snatch_map_together_ extern f_status_t fll_fss_snatch_map_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, const f_string_t glue, const f_string_length_t glue_length, f_string_maps_t *values[], f_array_lengths_t *indexs[]); @@ -462,7 +462,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_mash_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_mash_nulless(). */ #ifndef _di_fll_fss_snatch_mash_ extern f_status_t fll_fss_snatch_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, const f_string_t glue, const f_string_length_t glue_length, f_string_dynamic_t *values[], f_array_length_t *indexs[]); @@ -510,10 +510,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() - * @see fl_string_dynamic_partial_mash_nulless() + * @see f_string_dynamic_partial_mash_nulless() */ #ifndef _di_fll_fss_snatch_mash_apart_ extern f_status_t fll_fss_snatch_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, const f_string_t glue, const f_string_length_t glue_length, f_string_dynamics_t *values[], f_array_lengths_t *indexs[]); @@ -554,10 +554,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: fl_string_compare_trim(). - * Errors (with error bit) from: fl_string_dynamic_partial_mash_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_mash_nulless(). * * @see fl_string_compare_trim() - * @see fl_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_together_ extern f_status_t fll_fss_snatch_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, const f_string_t glue, const f_string_length_t glue_length, f_string_dynamic_t *values[], f_array_length_t *indexs[]); diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index 5110406..770fa2a 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -179,7 +179,7 @@ extern "C" { } else { if (destination->used + 1 > destination->size) { - status = fl_string_dynamic_increase_by(f_fss_default_allocation_step, destination); + status = f_string_dynamic_increase_by(f_fss_default_allocation_step, destination); if (F_status_is_error(status)) return status; } diff --git a/level_2/fll_fss/c/fss_basic.h b/level_2/fll_fss/c/fss_basic.h index c0da80e..a7b7aeb 100644 --- a/level_2/fll_fss/c/fss_basic.h +++ b/level_2/fll_fss/c/fss_basic.h @@ -96,7 +96,7 @@ extern "C" { * * Errors (with error bit) from: fl_fss_basic_content_write_string(). * Errors (with error bit) from: fl_fss_basic_object_write_string(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_fss_basic_write_string_ extern f_status_t fll_fss_basic_write_string(const f_string_static_t object, const f_string_static_t content, const f_fss_quote_t quote, f_string_dynamic_t *destination); diff --git a/level_2/fll_fss/c/fss_basic_list.h b/level_2/fll_fss/c/fss_basic_list.h index ab0ff8b..b4fc04b 100644 --- a/level_2/fll_fss/c/fss_basic_list.h +++ b/level_2/fll_fss/c/fss_basic_list.h @@ -95,7 +95,7 @@ extern "C" { * * Errors (with error bit) from: fl_fss_basic_list_content_write_string(). * Errors (with error bit) from: fl_fss_basic_list_object_write_string(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_fss_basic_list_write_string_ extern f_status_t fll_fss_basic_list_write_string(const f_string_static_t object, const f_string_static_t content, const f_string_static_t *content_prepend, f_string_dynamic_t *destination); diff --git a/level_2/fll_fss/c/fss_embedded_list.h b/level_2/fll_fss/c/fss_embedded_list.h index 5ed6a9a..7b5b6aa 100644 --- a/level_2/fll_fss/c/fss_embedded_list.h +++ b/level_2/fll_fss/c/fss_embedded_list.h @@ -104,7 +104,7 @@ extern "C" { * * Errors (with error bit) from: fl_fss_embedded_list_content_write_string(). * Errors (with error bit) from: fl_fss_embedded_list_object_write_string(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_fss_embedded_list_write_string_ extern f_status_t fll_fss_embedded_list_write_string(const f_string_static_t object, const f_string_static_t content, const f_string_static_t *content_prepend, const f_string_ranges_t *ignore, f_string_dynamic_t *destination); diff --git a/level_2/fll_fss/c/fss_extended.h b/level_2/fll_fss/c/fss_extended.h index 925f2df..b558275 100644 --- a/level_2/fll_fss/c/fss_extended.h +++ b/level_2/fll_fss/c/fss_extended.h @@ -97,7 +97,7 @@ extern "C" { * * Errors (with error bit) from: fl_fss_extended_content_write_string(). * Errors (with error bit) from: fl_fss_extended_object_write_string(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_fss_extended_write_string_ extern f_status_t fll_fss_extended_write_string(const f_string_static_t object, const f_string_statics_t contents, const f_fss_quote_t quote, f_string_dynamic_t *destination); diff --git a/level_2/fll_fss/c/fss_extended_list.h b/level_2/fll_fss/c/fss_extended_list.h index 29f1759..f13a05f 100644 --- a/level_2/fll_fss/c/fss_extended_list.h +++ b/level_2/fll_fss/c/fss_extended_list.h @@ -108,7 +108,7 @@ extern "C" { * * Errors (with error bit) from: fl_fss_extended_list_content_write_string(). * Errors (with error bit) from: fl_fss_extended_list_object_write_string(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_fss_extended_list_write_string_ extern f_status_t fll_fss_extended_list_write_string(const f_string_static_t object, const f_string_static_t content, const f_string_static_t *content_prepend, const f_string_ranges_t *ignore, f_string_dynamic_t *destination); diff --git a/level_2/fll_iki/c/iki.h b/level_2/fll_iki/c/iki.h index 2a90983..7be8305 100644 --- a/level_2/fll_iki/c/iki.h +++ b/level_2/fll_iki/c/iki.h @@ -53,7 +53,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_iki_content_escape_ extern f_status_t fll_iki_content_escape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *escaped); @@ -80,7 +80,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_iki_content_partial_escape_ extern f_status_t fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped); @@ -106,7 +106,7 @@ extern "C" { * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_iki_content_escape_un_ extern f_status_t fll_iki_content_escape_un(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped); @@ -134,7 +134,7 @@ extern "C" { * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #ifndef _di_fll_iki_content_partial_escape_un_ extern f_status_t fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped); diff --git a/level_2/fll_iki/c/private-iki.c b/level_2/fll_iki/c/private-iki.c index 305f56b..685cce8 100644 --- a/level_2/fll_iki/c/private-iki.c +++ b/level_2/fll_iki/c/private-iki.c @@ -23,7 +23,7 @@ extern "C" { if (content.string[i] == quote) { if (escaped->used + delimits + 2 > escaped->size) { - status = fl_string_dynamic_increase_by(delimits + 2, escaped); + status = f_string_dynamic_increase_by(delimits + 2, escaped); if (F_status_is_error(status)) return status; } @@ -38,7 +38,7 @@ extern "C" { } else if (content.string[i]) { if (escaped->used + 1 > escaped->size) { - status = fl_string_dynamic_increase_by(f_memory_default_allocation_step, escaped); + status = f_string_dynamic_increase_by(f_memory_default_allocation_step, escaped); if (F_status_is_error(status)) return status; } @@ -56,7 +56,7 @@ extern "C" { // delimits found at the end must be escaped to prevent escaping the end quote. if (delimits) { if (escaped->used + delimits > escaped->size) { - status = fl_string_dynamic_increase_by(delimits, escaped); + status = f_string_dynamic_increase_by(delimits, escaped); if (F_status_is_error(status)) return status; } @@ -113,7 +113,7 @@ extern "C" { delimits /= 2; if (unescaped->used + delimits + 1 > unescaped->size) { - status = fl_string_dynamic_increase_by(delimits + 1, unescaped); + status = f_string_dynamic_increase_by(delimits + 1, unescaped); if (F_status_is_error(status)) return status; } @@ -130,7 +130,7 @@ extern "C" { } else if (content.string[j]) { if (unescaped->used + (j - i) + 1 > unescaped->size) { - status = fl_string_dynamic_increase_by((j - i) + 1, unescaped); + status = f_string_dynamic_increase_by((j - i) + 1, unescaped); if (F_status_is_error(status)) return status; } @@ -160,7 +160,7 @@ extern "C" { delimits /= 2; if (unescaped->used + delimits > unescaped->size) { - status = fl_string_dynamic_increase_by(delimits, unescaped); + status = f_string_dynamic_increase_by(delimits, unescaped); if (F_status_is_error(status)) return status; } @@ -173,7 +173,7 @@ extern "C" { } else if (content.string[i]) { if (unescaped->used + 1 > unescaped->size) { - status = fl_string_dynamic_increase_by(f_memory_default_allocation_step, unescaped); + status = f_string_dynamic_increase_by(f_memory_default_allocation_step, unescaped); if (F_status_is_error(status)) return status; } diff --git a/level_2/fll_iki/c/private-iki.h b/level_2/fll_iki/c/private-iki.h index 6ef0328..efe9359 100644 --- a/level_2/fll_iki/c/private-iki.h +++ b/level_2/fll_iki/c/private-iki.h @@ -36,7 +36,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #if !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_) extern f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped) f_gcc_attribute_visibility_internal; @@ -64,7 +64,7 @@ extern "C" { * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). - * Errors (with error bit) from: fl_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). */ #if !defined(_di_fll_iki_content_escape_un_) || !defined(_di_fll_iki_content_partial_escape_un_) extern f_status_t private_fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) f_gcc_attribute_visibility_internal; diff --git a/level_2/fll_path/c/path.c b/level_2/fll_path/c/path.c index 0b7d37c..9fc221d 100644 --- a/level_2/fll_path/c/path.c +++ b/level_2/fll_path/c/path.c @@ -34,7 +34,7 @@ extern "C" { at = 0; } - status = fl_string_append_assure("/", 1, canonical); + status = f_string_append_assure("/", 1, canonical); if (F_status_is_error(status)) return status; for (; path[at]; at++) { @@ -78,7 +78,7 @@ extern "C" { size_chunk++; if (size_chunk) { - status = fl_string_append(path + position, size_chunk, canonical); + status = f_string_append(path + position, size_chunk, canonical); if (F_status_is_error(status)) return status; } } @@ -120,7 +120,7 @@ extern "C" { } else if (!(previous_1 == f_path_separator_current_s[0] || previous_1 == f_path_separator_s[0])) { if (size_chunk) { - status = fl_string_append(path + position, size_chunk, canonical); + status = f_string_append(path + position, size_chunk, canonical); if (F_status_is_error(status)) return status; } } @@ -130,7 +130,7 @@ extern "C" { canonical->used--; } - status = fl_string_dynamic_terminate_after(canonical); + status = f_string_dynamic_terminate_after(canonical); if (F_status_is_error(status)) return status; return F_none; diff --git a/level_2/fll_path/c/path.h b/level_2/fll_path/c/path.h index fed68ca..e178100 100644 --- a/level_2/fll_path/c/path.h +++ b/level_2/fll_path/c/path.h @@ -47,9 +47,9 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_path_current(). - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_append_assure(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_append_assure(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). */ #ifndef _di_fll_path_canonical_ extern f_status_t fll_path_canonical(const f_string_t path, f_string_dynamic_t *canonical); diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index d3ddfae..4f86b8a 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -151,7 +151,7 @@ extern "C" { if (length > 0) { f_string_dynamic_t ripped = f_string_dynamic_t_initialize; - status = fl_string_append(argv[values.array[i]], length, &ripped); + status = f_string_append(argv[values.array[i]], length, &ripped); if (F_status_is_error(status)) return status; if (status == F_data_not) { @@ -193,7 +193,7 @@ extern "C" { length = strnlen(argv[values.array[i]], f_console_length_size); if (length > 0) { - status = fl_string_mash(glue, glue_length, argv[values.array[i]], length, destination); + status = f_string_mash(glue, glue_length, argv[values.array[i]], length, destination); if (F_status_is_error(status)) return F_status_set_error(F_string_too_large); } } // for @@ -272,15 +272,15 @@ extern "C" { status = fl_string_rip(argv[values.array[i]], length, &ripped); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&ripped); + f_string_dynamic_delete(&ripped); return status; } if (ripped.used > 0) { - status = fl_string_dynamic_mash(glue, glue_length, ripped, destination); + status = f_string_dynamic_mash(glue, glue_length, ripped, destination); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&ripped); + f_string_dynamic_delete(&ripped); return F_status_set_error(F_string_too_large); } } @@ -288,7 +288,7 @@ extern "C" { } // for if (ripped.size) { - status = fl_string_dynamic_delete(&ripped); + status = f_string_dynamic_delete(&ripped); } if (status == F_none && start == destination->used) { diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index 3a1ced7..450392b 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -227,9 +227,9 @@ extern "C" { * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: fl_string_append(). + * Errors (with error bit) from: f_string_append(). * - * @see fl_string_append() + * @see f_string_append() */ #ifndef _di_fll_program_parameter_additional_append_ extern f_status_t fll_program_parameter_additional_append(const f_string_t *argv, const f_array_lengths_t values, f_string_dynamics_t *destination); @@ -257,9 +257,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if the combined string is too large. * - * Errors (with error bit) from: fl_string_mash(). + * Errors (with error bit) from: f_string_mash(). * - * @see fl_string_mash() + * @see f_string_mash() */ #ifndef _di_fll_program_parameter_additional_mash_ extern f_status_t fll_program_parameter_additional_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t *argv, const f_array_lengths_t values, f_string_dynamic_t *destination); @@ -316,10 +316,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if the combined string is too large. * - * Errors (with error bit) from: fl_string_dynamic_mash(). + * Errors (with error bit) from: f_string_dynamic_mash(). * Errors (with error bit) from: fl_string_rip(). * - * @see fl_string_dynamic_mash() + * @see f_string_dynamic_mash() * @see fl_string_rip() */ #ifndef _di_fll_program_parameter_additional_rip_mash_ diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index 2f0659e..63ba882 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -181,11 +181,11 @@ extern "C" { } } else { - status = fl_string_append(controller_path_settings, controller_path_settings_length, &setting.path_setting); + status = f_string_append(controller_path_settings, controller_path_settings_length, &setting.path_setting); if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append", F_true); } } } @@ -224,19 +224,19 @@ extern "C" { // a pid file path is required. if (!setting.path_pid.used) { - status = fl_string_append(controller_path_pid, controller_path_pid_length, &setting.path_pid); + status = f_string_append(controller_path_pid, controller_path_pid_length, &setting.path_pid); if (F_status_is_error_not(status)) { - status = fl_string_append(entry_name.string, entry_name.used, &setting.path_pid); + status = f_string_append(entry_name.string, entry_name.used, &setting.path_pid); } if (F_status_is_error_not(status)) { - status = fl_string_append(controller_path_suffix, controller_path_suffix_length, &setting.path_pid); + status = f_string_append(controller_path_suffix, controller_path_suffix_length, &setting.path_pid); } if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append", F_true); } } } @@ -275,11 +275,11 @@ extern "C" { // a control file path is required. if (!setting.path_control.used) { - status = fl_string_append(controller_path_control, controller_path_control_length, &setting.path_control); + status = f_string_append(controller_path_control, controller_path_control_length, &setting.path_control); if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append", F_true); } } } diff --git a/level_3/controller/c/private-common.h b/level_3/controller/c/private-common.h index 0b8aa4a..c5a2047 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) \ - fl_string_dynamics_delete(&action.parameters); + f_string_dynamics_delete(&action.parameters); #endif // _di_controller_rule_action_t_ #ifndef _di_controller_rule_actions_t_ @@ -525,16 +525,16 @@ extern "C" { } #define controller_macro_rule_t_delete_simple(rule) \ - fl_string_dynamic_delete(&rule.id); \ - fl_string_dynamic_delete(&rule.name); \ - fl_string_dynamic_delete(&rule.path); \ - fl_string_dynamic_delete(&rule.script); \ + 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_maps_t_delete_simple(rule.define) \ f_macro_string_maps_t_delete_simple(rule.parameter) \ - fl_string_dynamics_delete(&rule.environment); \ - fl_string_dynamics_delete(&rule.need); \ - fl_string_dynamics_delete(&rule.want); \ - fl_string_dynamics_delete(&rule.wish); \ + 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_capability_delete(&rule.capability); \ fl_control_group_delete(&rule.control_group); \ @@ -609,7 +609,7 @@ extern "C" { } #define controller_macro_entry_action_t_delete_simple(action) \ - fl_string_dynamics_delete(&action.parameters); + f_string_dynamics_delete(&action.parameters); #endif // _di_controller_entry_action_t_ #ifndef _di_controller_entry_actions_t_ @@ -653,7 +653,7 @@ extern "C" { } #define controller_macro_entry_item_t_delete_simple(item) \ - fl_string_dynamic_delete(&item.name); \ + f_string_dynamic_delete(&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) \ - fl_string_dynamic_delete(&setting.path_control); \ - fl_string_dynamic_delete(&setting.path_pid); \ - fl_string_dynamic_delete(&setting.path_setting); \ + f_string_dynamic_delete(&setting.path_control); \ + f_string_dynamic_delete(&setting.path_pid); \ + f_string_dynamic_delete(&setting.path_setting); \ controller_macro_entry_t_delete_simple(setting.entry) \ controller_macro_rules_t_delete_simple(setting.rules) #endif // _di_controller_setting_t @@ -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) \ - fl_string_dynamic_delete(&cache.buffer_file); \ - fl_string_dynamic_delete(&cache.buffer_item); \ - fl_string_dynamic_delete(&cache.buffer_other); \ - fl_string_dynamic_delete(&cache.buffer_path); \ - fl_string_dynamic_delete(&cache.name_action); \ - fl_string_dynamic_delete(&cache.name_file); \ - fl_string_dynamic_delete(&cache.name_item); + 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); #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 80b2693..a0f2924 100644 --- a/level_3/controller/c/private-controller.c +++ b/level_3/controller/c/private-controller.c @@ -15,27 +15,27 @@ extern "C" { f_status_t status = fl_string_dynamic_rip_nulless(source, range, destination); if (F_status_is_error(status)) return status; - return fl_string_dynamic_terminate_after(destination); + return f_string_dynamic_terminate_after(destination); } #endif // _di_controller_string_dynamic_rip_nulless_terminated_ #ifndef _di_controller_string_dynamic_append_terminated_ f_status_t controller_string_dynamic_append_terminated(const f_string_static_t source, f_string_dynamic_t *destination) { - f_status_t status = fl_string_dynamic_append(source, destination); + f_status_t status = f_string_dynamic_append(source, destination); if (F_status_is_error(status)) return status; - return fl_string_dynamic_terminate_after(destination); + return f_string_dynamic_terminate_after(destination); } #endif // _di_controller_string_dynamic_append_terminated_ #ifndef _di_controller_string_dynamic_partial_append_terminated_ f_status_t controller_string_dynamic_partial_append_terminated(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) { - f_status_t status = fl_string_dynamic_partial_append(source, range, destination); + f_status_t status = f_string_dynamic_partial_append(source, range, destination); if (F_status_is_error(status)) return status; - return fl_string_dynamic_terminate_after(destination); + return f_string_dynamic_terminate_after(destination); } #endif // _di_controller_string_dynamic_partial_append_terminated_ @@ -49,33 +49,33 @@ extern "C" { f_macro_time_spec_t_clear(cache->timestamp); - status = fl_string_append(path_prefix, path_prefix_length, &cache->name_file); + status = f_string_append(path_prefix, path_prefix_length, &cache->name_file); if (F_status_is_error_not(status)) { - status = fl_string_append(f_path_separator_s, f_path_separator_length, &cache->name_file); + status = f_string_append(f_path_separator_s, f_path_separator_length, &cache->name_file); } if (F_status_is_error_not(status)) { - status = fl_string_append(path_name.string, path_name.used, &cache->name_file); + status = f_string_append(path_name.string, path_name.used, &cache->name_file); } if (F_status_is_error_not(status)) { - status = fl_string_append(f_path_extension_separator, f_path_extension_separator_length, &cache->name_file); + status = f_string_append(f_path_extension_separator, f_path_extension_separator_length, &cache->name_file); } if (F_status_is_error_not(status)) { - status = fl_string_append(path_suffix, path_suffix_length, &cache->name_file); + status = f_string_append(path_suffix, path_suffix_length, &cache->name_file); } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } - status = fl_string_dynamic_terminate_after(&cache->name_file); + status = f_string_dynamic_terminate_after(&cache->name_file); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); return status; } @@ -144,7 +144,7 @@ extern "C" { status = f_directory_exists(path_directory.string); } - fl_string_dynamic_delete(&path_directory); + f_string_dynamic_delete(&path_directory); if (F_status_is_error(status)) return status; @@ -214,7 +214,7 @@ extern "C" { } } - fl_string_dynamic_delete(&pid_buffer); + f_string_dynamic_delete(&pid_buffer); } #endif // _di_controller_file_pid_delete_ @@ -231,7 +231,7 @@ extern "C" { if (status == F_number) { cache->buffer_other.used = 0; - status = fl_string_dynamic_partial_append_nulless(buffer, range, &cache->buffer_other); + status = f_string_dynamic_partial_append_nulless(buffer, range, &cache->buffer_other); if (F_status_is_error(status)) { return F_status_set_error(status); @@ -273,7 +273,7 @@ extern "C" { if (status == F_number) { cache->buffer_other.used = 0; - status = fl_string_dynamic_partial_append_nulless(buffer, range, &cache->buffer_other); + status = f_string_dynamic_partial_append_nulless(buffer, range, &cache->buffer_other); if (F_status_is_error(status)) { return F_status_set_error(status); diff --git a/level_3/controller/c/private-controller.h b/level_3/controller/c/private-controller.h index 4db2ff5..ff5b90c 100644 --- a/level_3/controller/c/private-controller.h +++ b/level_3/controller/c/private-controller.h @@ -24,10 +24,10 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: fl_string_dynamic_rip_nulless(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * * @see fl_string_dynamic_rip_nulless() - * @see fl_string_dynamic_terminate_after() + * @see f_string_dynamic_terminate_after() */ #ifndef _di_controller_string_dynamic_rip_nulless_terminated_ extern f_status_t controller_string_dynamic_rip_nulless_terminated(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; @@ -44,11 +44,11 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_dynamic_append(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_dynamic_append(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * - * @see fl_string_dynamic_append() - * @see fl_string_dynamic_terminate_after() + * @see f_string_dynamic_append() + * @see f_string_dynamic_terminate_after() */ #ifndef _di_controller_string_dynamic_append_terminated_ extern f_status_t controller_string_dynamic_append_terminated(const f_string_static_t from, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; @@ -67,11 +67,11 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_dynamic_append(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_dynamic_append(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * - * @see fl_string_dynamic_append() - * @see fl_string_dynamic_terminate_after() + * @see f_string_dynamic_append() + * @see f_string_dynamic_terminate_after() */ #ifndef _di_controller_string_dynamic_partial_append_terminated_ extern f_status_t controller_string_dynamic_partial_append_terminated(const f_string_static_t from, const f_string_range_t range, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; @@ -106,14 +106,14 @@ extern "C" { * Errors (with error bit) from: f_file_stat(). * Errors (with error bit) from: f_file_stream_open(). * Errors (with error bit) from: f_file_stream_read(). - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * * @see f_file_stat() * @see f_file_stream_open() * @see f_file_stream_read() - * @see fl_string_append() - * @see fl_string_dynamic_terminate_after() + * @see f_string_append() + * @see f_string_dynamic_terminate_after() */ #ifndef _di_controller_file_load_ extern f_status_t controller_file_load(const controller_data_t data, const controller_setting_t setting, const f_string_t path_prefix, const f_string_static_t path_name, const f_string_t path_suffix, const f_string_length_t path_prefix_length, const f_string_length_t path_suffix_length, controller_cache_t *cache) f_gcc_attribute_visibility_internal; @@ -250,15 +250,15 @@ 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: fl_string_dynamic_append(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * 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 fl_string_dynamic_append() - * @see fl_string_dynamic_terminate_after() + * @see f_string_dynamic_append() + * @see f_string_dynamic_terminate_after() * @see fl_type_array_lengths_increase_by() */ #ifndef _di_controller_preprocess_entry_ diff --git a/level_3/controller/c/private-entry.c b/level_3/controller/c/private-entry.c index 9b7ab74..8bc1fa7 100644 --- a/level_3/controller/c/private-entry.c +++ b/level_3/controller/c/private-entry.c @@ -275,10 +275,10 @@ extern "C" { } if (allocate) { - status = fl_string_dynamics_increase_by(allocate, &action->parameters); + status = f_string_dynamics_increase_by(allocate, &action->parameters); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true); action->status = status; @@ -293,10 +293,10 @@ extern "C" { action->parameters.array[j].used = 0; - status = fl_string_dynamic_partial_append_nulless(cache->buffer_file, cache->content_actions.array[i].array[j], &action->parameters.array[j]); + status = f_string_dynamic_partial_append_nulless(cache->buffer_file, cache->content_actions.array[i].array[j], &action->parameters.array[j]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); action->status = status; @@ -368,10 +368,10 @@ extern "C" { if (fl_string_dynamic_compare(action->parameters.array[1], cache->buffer_path) == F_equal_to_not) { if (data.error.verbosity != f_console_verbosity_quiet) { - status = fl_string_dynamic_terminate_after(&cache->buffer_path); + status = f_string_dynamic_terminate_after(&cache->buffer_path); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); action->status = status; diff --git a/level_3/controller/c/private-entry.h b/level_3/controller/c/private-entry.h index 0b9b4a6..829c43a 100644 --- a/level_3/controller/c/private-entry.h +++ b/level_3/controller/c/private-entry.h @@ -80,19 +80,19 @@ extern "C" { * Errors (with error bit) from: controller_entry_actions_increase_by(). * Errors (with error bit) from: f_fss_count_lines(). * Errors (with error bit) from: fl_fss_apply_delimit(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * Errors (with error bit) from: fl_string_dynamic_rip_nulless(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). - * Errors (with error bit) from: fl_string_dynamics_increase_by(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_dynamics_increase_by(). * Errors (with error bit) from: fll_fss_extended_read(). * * @see controller_entry_actions_increase_by() * @see f_fss_count_lines() * @see fl_fss_apply_delimit() - * @see fl_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_partial_append_nulless() * @see fl_string_dynamic_rip_nulless() - * @see fl_string_dynamic_terminate_after() - * @see fl_string_dynamics_increase_by() + * @see f_string_dynamic_terminate_after() + * @see f_string_dynamics_increase_by() * @see fll_fss_extended_read() */ #ifndef _di_controller_entry_actions_read_ @@ -165,9 +165,9 @@ extern "C" { * Errors (with error bit) from: controller_string_dynamic_partial_append_terminated(). * Errors (with error bit) from: f_fss_count_lines(). * Errors (with error bit) from: fl_fss_apply_delimit(). - * Errors (with error bit) from: fl_string_dynamic_append(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: fl_string_dynamic_terminate(). + * Errors (with error bit) from: f_string_dynamic_append(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: fll_fss_basic_list_read(). * * @see controller_entry_actions_read() @@ -178,9 +178,9 @@ extern "C" { * @see controller_string_dynamic_partial_append_terminated() * @see f_fss_count_lines() * @see fl_fss_apply_delimit() - * @see fl_string_dynamic_append() - * @see fl_string_dynamic_partial_append_nulless() - * @see fl_string_dynamic_terminate() + * @see f_string_dynamic_append() + * @see f_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_terminate() * @see fll_fss_basic_list_read() */ #ifndef _di_controller_entry_read_ diff --git a/level_3/controller/c/private-rule.c b/level_3/controller/c/private-rule.c index cea0397..193fac9 100644 --- a/level_3/controller/c/private-rule.c +++ b/level_3/controller/c/private-rule.c @@ -37,26 +37,26 @@ extern "C" { parameters->used = 0; if (object && object->start <= object->start) { - status = fl_string_dynamics_increase(parameters); + status = f_string_dynamics_increase(parameters); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); return status; } parameters->array[parameters->used].used = 0; - status = fl_string_dynamic_partial_append_nulless(buffer, *object, ¶meters->array[0]); + status = f_string_dynamic_partial_append_nulless(buffer, *object, ¶meters->array[0]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); return status; } - status = fl_string_dynamic_terminate_after(¶meters->array[0]); + status = f_string_dynamic_terminate_after(¶meters->array[0]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); return status; } @@ -68,26 +68,26 @@ extern "C" { if (content->array[i].start > content->array[i].start) continue; - status = fl_string_dynamics_increase(parameters); + status = f_string_dynamics_increase(parameters); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); return status; } parameters->array[parameters->used].used = 0; - status = fl_string_dynamic_partial_append_nulless(buffer, content->array[i], ¶meters->array[parameters->used]); + status = f_string_dynamic_partial_append_nulless(buffer, content->array[i], ¶meters->array[parameters->used]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); return status; } - status = fl_string_dynamic_terminate_after(¶meters->array[parameters->used]); + status = f_string_dynamic_terminate_after(¶meters->array[parameters->used]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); return status; } @@ -210,10 +210,10 @@ extern "C" { if (item->type == controller_rule_item_type_script) { actions->array[actions->used].parameters.used = 0; - status = fl_string_dynamics_increase(&actions->array[actions->used].parameters); + status = f_string_dynamics_increase(&actions->array[actions->used].parameters); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); } else { actions->array[actions->used].type = type; @@ -221,16 +221,16 @@ extern "C" { actions->array[actions->used].parameters.used = 0; actions->array[actions->used].status = F_known_not; - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_action.array[0], &actions->array[actions->used].parameters.array[0]); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_action.array[0], &actions->array[actions->used].parameters.array[0]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); } - status = fl_string_dynamic_terminate_after(&actions->array[actions->used].parameters.array[0]); + status = f_string_dynamic_terminate_after(&actions->array[actions->used].parameters.array[0]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } else { actions->array[actions->used].parameters.used = 1; @@ -278,10 +278,10 @@ extern "C" { actions->array[actions->used].parameters.used = 0; actions->array[actions->used].status = F_known_not; - status = fl_string_dynamics_increase(&actions->array[actions->used].parameters); + status = f_string_dynamics_increase(&actions->array[actions->used].parameters); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); actions->array[actions->used].status = controller_status_simplify(F_status_set_fine(status)); break; @@ -318,10 +318,10 @@ extern "C" { fll_error_print(data.error, F_status_set_fine(status), "fl_fss_apply_delimit", F_true); } else if (item->type == controller_rule_item_type_script) { - status = fl_string_dynamics_increase(&actions->array[actions->used].parameters); + status = f_string_dynamics_increase(&actions->array[actions->used].parameters); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); } else { @@ -333,15 +333,15 @@ extern "C" { for (f_array_length_t i = 0; i < cache->content_action.used; ++i) { - status = fl_string_dynamic_partial_mash_nulless(f_string_space_s, f_string_space_length, cache->buffer_item, cache->content_action.array[i], &actions->array[actions->used].parameters.array[0]); + status = f_string_dynamic_partial_mash_nulless(f_string_space_s, f_string_space_length, cache->buffer_item, cache->content_action.array[i], &actions->array[actions->used].parameters.array[0]); if (F_status_is_error(status)) break; } // for if (F_status_is_error_not(status)) { - status = fl_string_dynamic_terminate_after(&actions->array[actions->used].parameters.array[0]); + status = f_string_dynamic_terminate_after(&actions->array[actions->used].parameters.array[0]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } else { actions->array[actions->used].parameters.used = 1; @@ -672,7 +672,7 @@ extern "C" { if (status == F_child || status == F_signal || F_status_is_error(status) && !simulate) break; } // for - fl_string_maps_delete(&environment); + f_string_maps_delete(&environment); if (status == F_child) { return status; @@ -876,31 +876,31 @@ extern "C" { id->used = 0; - status = fl_string_dynamic_partial_append_nulless(source, directory, id); + status = f_string_dynamic_partial_append_nulless(source, directory, id); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); return status; } - status = fl_string_append(f_path_separator_s, f_path_separator_length, id); + status = f_string_append(f_path_separator_s, f_path_separator_length, id); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } - status = fl_string_dynamic_partial_append_nulless(source, basename, id); + status = f_string_dynamic_partial_append_nulless(source, basename, id); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); return status; } - status = fl_string_dynamic_terminate_after(id); + status = f_string_dynamic_terminate_after(id); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } return status; @@ -1211,50 +1211,50 @@ extern "C" { path->used = 0; if (setting.path_setting.used) { - status = fl_string_append(setting.path_setting.string, setting.path_setting.used, path); + status = f_string_append(setting.path_setting.string, setting.path_setting.used, path); if (F_status_is_error_not(status)) { - status = fl_string_append(f_path_separator_s, f_path_separator_length, path); + status = f_string_append(f_path_separator_s, f_path_separator_length, path); } } if (F_status_is_error_not(status)) { - status = fl_string_append(controller_string_rules_s, controller_string_rules_length, path); + status = f_string_append(controller_string_rules_s, controller_string_rules_length, path); } if (F_status_is_error_not(status)) { - status = fl_string_append(f_path_separator_s, f_path_separator_length, path); + status = f_string_append(f_path_separator_s, f_path_separator_length, path); } if (F_status_is_error_not(status)) { - status = fl_string_append(path_directory.string, path_directory.used, path); + status = f_string_append(path_directory.string, path_directory.used, path); } if (F_status_is_error_not(status)) { - status = fl_string_append(f_path_separator_s, f_path_separator_length, path); + status = f_string_append(f_path_separator_s, f_path_separator_length, path); } if (F_status_is_error_not(status)) { - status = fl_string_append(path_name.string, path_name.used, path); + status = f_string_append(path_name.string, path_name.used, path); } if (F_status_is_error_not(status)) { - status = fl_string_append(f_path_extension_separator_s, f_path_extension_separator_length, path); + status = f_string_append(f_path_extension_separator_s, f_path_extension_separator_length, path); } if (F_status_is_error_not(status)) { - status = fl_string_append(controller_string_rule_s, controller_string_rule_length, path); + status = f_string_append(controller_string_rule_s, controller_string_rule_length, path); } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } - status = fl_string_dynamic_terminate_after(path); + status = f_string_dynamic_terminate_after(path); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); return status; } @@ -1342,45 +1342,45 @@ extern "C" { cache->name_item.used = 0; cache->name_file.used = 0; - status = fl_string_append(controller_string_rules_s, controller_string_rules_length, &cache->name_file); + status = f_string_append(controller_string_rules_s, controller_string_rules_length, &cache->name_file); if (F_status_is_error_not(status)) { - status = fl_string_append(f_path_separator_s, f_path_separator_length, &cache->name_file); + status = f_string_append(f_path_separator_s, f_path_separator_length, &cache->name_file); } if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append", F_true); controller_rule_error_print(data->error, *cache, F_true); return status; } - status = fl_string_dynamic_append(setting->rules.array[index].id, &cache->name_file); + status = f_string_dynamic_append(setting->rules.array[index].id, &cache->name_file); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamic_append", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamic_append", F_true); controller_rule_error_print(data->error, *cache, F_true); return status; } - status = fl_string_append(f_path_extension_separator, f_path_extension_separator_length, &cache->name_file); + status = f_string_append(f_path_extension_separator, f_path_extension_separator_length, &cache->name_file); if (F_status_is_error_not(status)) { - status = fl_string_append(controller_string_rule_s, controller_string_rule_length, &cache->name_file); + status = f_string_append(controller_string_rule_s, controller_string_rule_length, &cache->name_file); } if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append", F_true); controller_rule_error_print(data->error, *cache, F_true); return status; } - status = fl_string_dynamic_terminate_after(&cache->name_file); + status = f_string_dynamic_terminate_after(&cache->name_file); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); controller_rule_error_print(data->error, *cache, F_true); return status; @@ -1674,16 +1674,16 @@ extern "C" { cache->name_file.used = 0; cache->name_item.used = 0; - status = fl_string_dynamic_append_nulless(rule_id, &rule->id); + status = f_string_dynamic_append_nulless(rule_id, &rule->id); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); } else { - status = fl_string_dynamic_terminate_after(&rule->id); + status = f_string_dynamic_terminate_after(&rule->id); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } else { status = controller_file_load(data, setting, controller_string_rules_s, rule->id, controller_string_rule_s, controller_string_rules_length, controller_string_rule_length, cache); @@ -1791,17 +1791,17 @@ extern "C" { continue; } - status = fl_string_dynamic_partial_append(cache->buffer_file, cache->content_items.array[i].array[0], &cache->buffer_item); + status = f_string_dynamic_partial_append(cache->buffer_file, cache->content_items.array[i].array[0], &cache->buffer_item); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append", F_true); break; } - status = fl_string_dynamic_terminate_after(&cache->buffer_item); + status = f_string_dynamic_terminate_after(&cache->buffer_item); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); break; } @@ -1880,16 +1880,16 @@ extern "C" { // name_item is used to store the setting name. cache->name_item.used = 0; - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, cache->object_actions.array[i], &cache->name_item); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->object_actions.array[i], &cache->name_item); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); } else { - status = fl_string_dynamic_terminate_after(&cache->name_item); + status = f_string_dynamic_terminate_after(&cache->name_item); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } } @@ -2005,16 +2005,16 @@ extern "C" { range2.start = cache->content_actions.array[i].array[0].start; range2.stop = cache->content_actions.array[i].array[cache->content_actions.array[i].used - 1].stop; - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, range2, &cache->name_action); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, range2, &cache->name_action); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); } else { - status = fl_string_dynamic_terminate_after(&cache->name_action); + status = f_string_dynamic_terminate_after(&cache->name_action); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } } @@ -2184,10 +2184,10 @@ extern "C" { setting_maps = &rule->parameter; } - status = fl_string_maps_increase(setting_maps); + status = f_string_maps_increase(setting_maps); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_maps_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_maps_increase", F_true); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -2211,10 +2211,10 @@ extern "C" { setting_maps->array[setting_maps->used].name.used = 0; setting_maps->array[setting_maps->used].value.used = 0; - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &setting_maps->array[setting_maps->used].name); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &setting_maps->array[setting_maps->used].name); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -2235,16 +2235,16 @@ extern "C" { continue; } - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[1], &setting_maps->array[setting_maps->used].value); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[1], &setting_maps->array[setting_maps->used].value); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); } else { - status = fl_string_dynamic_terminate_after(&setting_maps->array[setting_maps->used].value); + status = f_string_dynamic_terminate_after(&setting_maps->array[setting_maps->used].value); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } } @@ -2329,33 +2329,33 @@ extern "C" { rule->control_group.path.used = 0; // @todo path prefix needs to be configurable via a parameter. - status = fl_string_append(f_control_group_path_system_prefix, f_control_group_path_system_prefix_length, &rule->control_group.path); + status = f_string_append(f_control_group_path_system_prefix, f_control_group_path_system_prefix_length, &rule->control_group.path); if (F_status_is_error_not(status)) { - status = fl_string_append(f_control_group_path_system_default, f_control_group_path_system_default_length, &rule->control_group.path); + status = f_string_append(f_control_group_path_system_default, f_control_group_path_system_default_length, &rule->control_group.path); } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); } else { rule->control_group.groups.used = 0; for (j = 1; j < cache->content_actions.array[i].used; ++j) { - status = fl_string_dynamics_increase(&rule->control_group.groups); + status = f_string_dynamics_increase(&rule->control_group.groups); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); break; } rule->control_group.groups.array[rule->control_group.groups.used].used = 0; - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[j], &rule->control_group.groups.array[rule->control_group.groups.used]); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[j], &rule->control_group.groups.array[rule->control_group.groups.used]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); break; } @@ -2717,16 +2717,16 @@ extern "C" { } } else if (type == controller_rule_setting_type_path) { - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], setting_value); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], setting_value); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); } else { - status = fl_string_dynamic_terminate_after(setting_value); + status = f_string_dynamic_terminate_after(setting_value); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } } @@ -2921,10 +2921,10 @@ extern "C" { if (type == controller_rule_setting_type_capability) { cache->buffer_other.used = 0; - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->buffer_other); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->buffer_other); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); // get the current line number within the settings item. cache->line_item = line_item; @@ -2944,10 +2944,10 @@ extern "C" { } } - status = fl_string_dynamic_terminate_after(&cache->buffer_other); + status = f_string_dynamic_terminate_after(&cache->buffer_other); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); // get the current line number within the settings item. cache->line_item = line_item; @@ -3239,10 +3239,10 @@ extern "C" { for (j = 0; j < cache->content_actions.array[i].used; ++j) { - status = fl_string_dynamics_increase(setting_values); + status = f_string_dynamics_increase(setting_values); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase", F_true); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -3265,16 +3265,16 @@ extern "C" { setting_values->array[setting_values->used].used = 0; - status = fl_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[j], &setting_values->array[setting_values->used]); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[j], &setting_values->array[setting_values->used]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); } else { - status = fl_string_dynamic_terminate_after(&setting_values->array[setting_values->used]); + status = f_string_dynamic_terminate_after(&setting_values->array[setting_values->used]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); } } @@ -3384,10 +3384,10 @@ extern "C" { setting_values = &rule->wish; } - status = fl_string_dynamics_increase_by(controller_default_allocation_step, setting_values); + status = f_string_dynamics_increase_by(controller_default_allocation_step, setting_values); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true); if (F_status_set_fine(status) == F_memory_not) { status_return = status; diff --git a/level_3/controller/c/private-rule.h b/level_3/controller/c/private-rule.h index 2e8e2b4..c39bd5a 100644 --- a/level_3/controller/c/private-rule.h +++ b/level_3/controller/c/private-rule.h @@ -48,12 +48,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_fss_count_lines(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: fl_string_dynamics_increase(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_fss_count_lines() - * @see fl_string_dynamic_partial_append_nulless() - * @see fl_string_dynamics_increase() + * @see f_string_dynamic_partial_append_nulless() + * @see f_string_dynamics_increase() */ #ifndef _di_controller_rule_parameters_read_ extern f_status_t controller_rule_parameters_read(const controller_data_t data, const f_string_static_t buffer, f_fss_object_t *object, f_fss_content_t *content, f_string_dynamics_t *parameters) f_gcc_attribute_visibility_internal; @@ -372,12 +372,12 @@ extern "C" { * @return * F_none on success. * - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * * @see f_string_append() - * @see fl_string_dynamic_partial_append_nulless() - * @see fl_string_dynamic_terminate_after() + * @see f_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_terminate_after() */ #ifndef _di_controller_rule_id_construct_ extern f_status_t controller_rule_id_construct(const controller_data_t data, const f_string_static_t source, const f_string_range_t directory, const f_string_range_t basename, f_string_dynamic_t *id) f_gcc_attribute_visibility_internal; @@ -399,13 +399,13 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_fss_count_lines(). - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * * @see controller_rule_action_read() * @see f_fss_count_lines() - * @see fl_string_dynamic_partial_append_nulless() - * @see fl_string_dynamic_terminate_after() + * @see f_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_terminate_after() */ #ifndef _di_controller_rule_item_read_ extern f_status_t controller_rule_item_read(const controller_data_t data, controller_cache_t *cache, controller_rule_item_t *item) f_gcc_attribute_visibility_internal; @@ -480,15 +480,15 @@ extern "C" { * * Errors (with error bit) from: f_file_stream_open(). * Errors (with error bit) from: f_file_stream_read(). - * Errors (with error bit) from: fl_string_append(). - * Errors (with error bit) from: fl_string_dynamic_terminate_after(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_terminate_after(). * Errors (with error bit) from: fll_path_canonical(). * * @see f_file_stat() * @see f_file_stream_open() * @see f_file_stream_read() - * @see fl_string_append() - * @see fl_string_dynamic_terminate_after() + * @see f_string_append() + * @see f_string_dynamic_terminate_after() * @see fll_path_canonical() */ #ifndef _di_controller_rule_path_ @@ -564,9 +564,9 @@ extern "C" { * @see f_file_stream_read(). * @see f_fss_count_lines(). * @see fl_fss_apply_delimit(). - * @see fl_string_dynamic_partial_append(). - * @see fl_string_dynamic_partial_append_nulless(). - * @see fl_string_dynamic_terminate_after(). + * @see f_string_dynamic_partial_append(). + * @see f_string_dynamic_partial_append_nulless(). + * @see f_string_dynamic_terminate_after(). * @see fll_fss_basic_list_read(). */ #ifndef _di_controller_rule_read_ @@ -594,17 +594,17 @@ extern "C" { * F_none on success. * F_valid_not (with error bit) on success but there were one or more invalid settings encountered. * - * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). * Errors (with error bit) from: fl_string_dynamic_rip_nulless(). - * Errors (with error bit) from: fl_string_dynamics_increase(). - * Errors (with error bit) from: fl_string_maps_increase(). + * Errors (with error bit) from: f_string_dynamics_increase(). + * Errors (with error bit) from: f_string_maps_increase(). * Errors (with error bit) from: fll_fss_extended_read(). * Errors (with error bit) from: fll_path_canonical(). * - * @see fl_string_dynamic_partial_append_nulless() + * @see f_string_dynamic_partial_append_nulless() * @see fl_string_dynamic_rip_nulless() - * @see fl_string_dynamics_increase() - * @see fl_string_maps_increase() + * @see f_string_dynamics_increase() + * @see f_string_maps_increase() * @see fll_fss_extended_read() * @see fll_path_canonical() */ diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index fb72841..642f972 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); - fl_string_dynamics_delete(&data->define); - fl_string_dynamic_delete(&data->fakefile); - fl_string_dynamics_delete(&data->mode); - fl_string_dynamic_delete(&data->process); - fl_string_dynamic_delete(&data->settings); - - fl_string_dynamic_delete(&data->path_build); - fl_string_dynamic_delete(&data->path_build_documents); - fl_string_dynamic_delete(&data->path_build_includes); - fl_string_dynamic_delete(&data->path_build_libraries); - fl_string_dynamic_delete(&data->path_build_libraries_script); - fl_string_dynamic_delete(&data->path_build_libraries_shared); - fl_string_dynamic_delete(&data->path_build_libraries_static); - fl_string_dynamic_delete(&data->path_build_objects); - fl_string_dynamic_delete(&data->path_build_programs); - fl_string_dynamic_delete(&data->path_build_programs_script); - fl_string_dynamic_delete(&data->path_build_programs_shared); - fl_string_dynamic_delete(&data->path_build_programs_static); - fl_string_dynamic_delete(&data->path_build_settings); - fl_string_dynamic_delete(&data->path_build_stage); - fl_string_dynamic_delete(&data->path_work); - - fl_string_dynamic_delete(&data->path_data); - fl_string_dynamic_delete(&data->path_data_build); - - fl_string_dynamic_delete(&data->path_data_settings); - - fl_string_dynamic_delete(&data->path_documents); - - fl_string_dynamic_delete(&data->path_licenses); - - fl_string_dynamic_delete(&data->path_sources); - fl_string_dynamic_delete(&data->path_sources_bash); - fl_string_dynamic_delete(&data->path_sources_c); - fl_string_dynamic_delete(&data->path_sources_cpp); - fl_string_dynamic_delete(&data->path_sources_script); - - fl_string_dynamic_delete(&data->path_work); - fl_string_dynamic_delete(&data->path_work_includes); - fl_string_dynamic_delete(&data->path_work_libraries); - fl_string_dynamic_delete(&data->path_work_libraries_script); - fl_string_dynamic_delete(&data->path_work_libraries_shared); - fl_string_dynamic_delete(&data->path_work_libraries_static); - fl_string_dynamic_delete(&data->path_work_programs); - fl_string_dynamic_delete(&data->path_work_programs_script); - fl_string_dynamic_delete(&data->path_work_programs_shared); - fl_string_dynamic_delete(&data->path_work_programs_static); - - fl_string_dynamic_delete(&data->file_data_build_defines); - fl_string_dynamic_delete(&data->file_data_build_dependencies); - fl_string_dynamic_delete(&data->file_data_build_fakefile); - fl_string_dynamic_delete(&data->file_data_build_settings); - - fl_string_dynamic_delete(&data->file_documents_readme); + 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_color_context_t_delete_simple(data->context); diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index c2355eb..8bb234a 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -190,7 +190,7 @@ extern "C" { if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), "f_macro_string_dynamic_t_new", F_true); - fl_string_dynamic_delete(&path_source); + f_string_dynamic_delete(&path_source); return; } @@ -210,17 +210,17 @@ extern "C" { path_source.used = source.used; - *status = fl_string_dynamic_append_nulless(files.array[i], &path_source); + *status = f_string_dynamic_append_nulless(files.array[i], &path_source); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); break; } - *status = fl_string_dynamic_terminate_after(&path_source); + *status = f_string_dynamic_terminate_after(&path_source); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } @@ -239,10 +239,10 @@ extern "C" { if (*status == F_true) { destination_directory.used = 0; - *status = fl_string_dynamic_append(destination, &destination_directory); + *status = f_string_dynamic_append(destination, &destination_directory); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append", F_true); break; } @@ -253,10 +253,10 @@ extern "C" { break; } - *status = fl_string_dynamic_terminate_after(&destination_directory); + *status = f_string_dynamic_terminate_after(&destination_directory); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } @@ -285,18 +285,18 @@ extern "C" { destination_file.used = 0; destination_directory.used = 0; - *status = fl_string_dynamic_append_nulless(destination, &destination_file); + *status = f_string_dynamic_append_nulless(destination, &destination_file); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); break; } if (preserve && preserve < path_source.used) { - *status = fl_string_dynamic_append_nulless(destination, &destination_directory); + *status = f_string_dynamic_append_nulless(destination, &destination_directory); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); break; } @@ -307,10 +307,10 @@ extern "C" { break; } - *status = fl_string_dynamic_terminate_after(&destination_directory); + *status = f_string_dynamic_terminate_after(&destination_directory); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } @@ -321,10 +321,10 @@ extern "C" { break; } - *status = fl_string_append(path_source.string + preserve, path_source.used - preserve, &destination_file); + *status = f_string_append(path_source.string + preserve, path_source.used - preserve, &destination_file); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); break; } } @@ -337,10 +337,10 @@ extern "C" { } } - *status = fl_string_dynamic_terminate_after(&destination_file); + *status = f_string_dynamic_terminate_after(&destination_file); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } @@ -369,9 +369,9 @@ extern "C" { } // for f_macro_directory_statuss_t_delete_simple(failures); - fl_string_dynamic_delete(&path_source); - fl_string_dynamic_delete(&destination_file); - fl_string_dynamic_delete(&destination_directory); + f_string_dynamic_delete(&path_source); + f_string_dynamic_delete(&destination_file); + f_string_dynamic_delete(&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); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return 0; } @@ -526,7 +526,7 @@ extern "C" { if (data.define.used) { for (f_array_length_t i = 0; i < data.define.used; i++) { - *status = fl_string_dynamic_mash(f_string_space_s, 1, data.define.array[i], &defines); + *status = f_string_dynamic_mash(f_string_space_s, 1, data.define.array[i], &defines); if (F_status_is_error(*status)) { break; @@ -534,20 +534,20 @@ extern "C" { } // for if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_mash", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_mash", F_true); - fl_string_dynamic_delete(&defines); - fl_string_dynamics_delete(&arguments); + f_string_dynamic_delete(&defines); + f_string_dynamics_delete(&arguments); return 0; } - *status = fl_string_dynamic_terminate_after(&defines); + *status = f_string_dynamic_terminate_after(&defines); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); - fl_string_dynamic_delete(&defines); - fl_string_dynamics_delete(&arguments); + f_string_dynamic_delete(&defines); + f_string_dynamics_delete(&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); - fl_string_dynamic_delete(&defines); + f_string_dynamic_delete(&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); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return 0; } } @@ -628,26 +628,26 @@ extern "C" { f_string_t function = 0; { - function = "fl_string_dynamic_append_nulless"; + function = "f_string_dynamic_append_nulless"; if (process_script.string[0] != '/') { - *status = fl_string_dynamic_append_nulless(data.path_data_build, &path); + *status = f_string_dynamic_append_nulless(data.path_data_build, &path); } if (F_status_is_error_not(*status)) { - *status = fl_string_dynamic_append_nulless(process_script, &path); + *status = f_string_dynamic_append_nulless(process_script, &path); } if (F_status_is_error_not(*status)) { - function = "fl_string_dynamic_terminate_after"; - *status = fl_string_dynamic_terminate_after(&path); + function = "f_string_dynamic_terminate_after"; + *status = f_string_dynamic_terminate_after(&path); } if (F_status_is_error(*status)) { fll_error_print(data.error, F_status_set_fine(*status), function, F_true); - fl_string_dynamic_delete(&path); - fl_string_dynamics_delete(&arguments); + f_string_dynamic_delete(&path); + f_string_dynamics_delete(&arguments); return 0; } } @@ -657,8 +657,8 @@ extern "C" { if (fake_signal_received(data)) { *status = F_status_set_error(F_signal); - fl_string_dynamic_delete(&path); - fl_string_dynamics_delete(&arguments); + f_string_dynamic_delete(&path); + f_string_dynamics_delete(&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); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); if (fake_signal_received(data)) { *status = F_status_set_error(F_signal); @@ -696,7 +696,7 @@ extern "C" { } } - fl_string_dynamic_delete(&path); + f_string_dynamic_delete(&path); return return_code; } @@ -724,10 +724,10 @@ extern "C" { } } // for - status = fl_string_dynamic_terminate_after(name); + status = f_string_dynamic_terminate_after(name); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); return status; } @@ -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); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&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); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&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); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); if (F_status_is_error(*status)) { return 0; @@ -1132,24 +1132,24 @@ extern "C" { } if (source_path.used) { - *status = fl_string_dynamic_prepend(data.path_build_objects, &source_path); + *status = f_string_dynamic_prepend(data.path_build_objects, &source_path); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_prepend", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_prepend", F_true); break; } - *status = fl_string_append_assure(f_path_separator_s, f_path_separator_length, &source_path); + *status = f_string_append_assure(f_path_separator_s, f_path_separator_length, &source_path); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append_assure", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append_assure", F_true); break; } - *status = fl_string_dynamic_terminate_after(&source_path); + *status = f_string_dynamic_terminate_after(&source_path); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } @@ -1189,9 +1189,9 @@ extern "C" { result = fake_execute(data, data_build.environment, data_build.setting.build_indexer, arguments, status); } - fl_string_dynamic_delete(&file_name); - fl_string_dynamic_delete(&source_path); - fl_string_dynamics_delete(&arguments); + f_string_dynamic_delete(&file_name); + f_string_dynamic_delete(&source_path); + f_string_dynamics_delete(&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); } - fl_string_dynamic_delete(&buffer); + f_string_dynamic_delete(&buffer); f_macro_fss_objects_t_delete_simple(objects); f_macro_fss_contents_t_delete_simple(contents); } @@ -1622,7 +1622,7 @@ extern "C" { } for (j = 0; j < fake_build_setting_total; j++) { - fl_string_dynamic_delete(&settings_mode_name_dynamic[j]); + f_string_dynamic_delete(&settings_mode_name_dynamic[j]); } // for if (F_status_is_error(*status)) break; @@ -1962,56 +1962,56 @@ extern "C" { // replace any potential existing value. settings_single_destination[i]->used = 0; - *status = fl_string_dynamic_append_nulless(settings_single_source[i]->array[0], settings_single_destination[i]); + *status = f_string_dynamic_append_nulless(settings_single_source[i]->array[0], settings_single_destination[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); break; } if (settings_single_type[i] == 2) { - *status = fl_string_append_assure(f_path_separator_s, f_path_separator_length, settings_single_destination[i]); + *status = f_string_append_assure(f_path_separator_s, f_path_separator_length, settings_single_destination[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append_assure", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append_assure", F_true); break; } } - *status = fl_string_dynamic_terminate_after(settings_single_destination[i]); + *status = f_string_dynamic_terminate_after(settings_single_destination[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } } } // for } - fl_string_dynamics_delete(&build_compiler); - fl_string_dynamics_delete(&build_indexer); - fl_string_dynamics_delete(&build_language); - fl_string_dynamics_delete(&build_script); - fl_string_dynamics_delete(&build_shared); - fl_string_dynamics_delete(&build_static); - fl_string_dynamics_delete(&path_headers); - fl_string_dynamics_delete(&path_headers_preserve); - fl_string_dynamics_delete(&path_language); - fl_string_dynamics_delete(&path_library_script); - fl_string_dynamics_delete(&path_library_shared); - fl_string_dynamics_delete(&path_library_static); - fl_string_dynamics_delete(&path_program_script); - fl_string_dynamics_delete(&path_program_shared); - fl_string_dynamics_delete(&path_program_static); - fl_string_dynamics_delete(&path_sources); - fl_string_dynamics_delete(&path_standard); - fl_string_dynamics_delete(&process_post); - fl_string_dynamics_delete(&process_pre); - fl_string_dynamics_delete(&project_name); - fl_string_dynamics_delete(&search_exclusive); - fl_string_dynamics_delete(&search_shared); - fl_string_dynamics_delete(&search_static); - fl_string_dynamics_delete(&version_major); - fl_string_dynamics_delete(&version_micro); - fl_string_dynamics_delete(&version_minor); - fl_string_dynamics_delete(&version_target); + 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); } #endif // _di_fake_build_load_setting_process_ @@ -2046,17 +2046,17 @@ extern "C" { for (uint8_t i = 0; i < 3; i++) { if (destinations[i]->used > 0) continue; - *status = fl_string_append_assure(sources[i], lengths[i], destinations[i]); + *status = f_string_append_assure(sources[i], lengths[i], destinations[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append_assure", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append_assure", F_true); break; } - *status = fl_string_dynamic_terminate_after(destinations[i]); + *status = f_string_dynamic_terminate_after(destinations[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } } // for @@ -2250,66 +2250,66 @@ extern "C" { for (uint8_t i = 0; i < fake_build_stage_total; i++) { - *status = fl_string_dynamic_append_nulless(data.path_build_stage, values[i]); + *status = f_string_dynamic_append_nulless(data.path_build_stage, values[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); break; } if (data.process.used) { - *status = fl_string_append(data.process.string, data.process.used, values[i]); + *status = f_string_append(data.process.string, data.process.used, values[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); break; } - *status = fl_string_append(fake_build_stage_separate, fake_build_stage_separate_length, values[i]); + *status = f_string_append(fake_build_stage_separate, fake_build_stage_separate_length, values[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); break; } } - *status = fl_string_append_nulless(names[i], lengths[i], values[i]); + *status = f_string_append_nulless(names[i], lengths[i], values[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); break; } - *status = fl_string_append(fake_build_stage_separate, fake_build_stage_separate_length, values[i]); + *status = f_string_append(fake_build_stage_separate, fake_build_stage_separate_length, values[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); break; } - *status = fl_string_dynamic_append(settings_file_base, values[i]); + *status = f_string_dynamic_append(settings_file_base, values[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append", F_true); break; } - *status = fl_string_append(fake_build_stage_built, fake_build_stage_built_length, values[i]); + *status = f_string_append(fake_build_stage_built, fake_build_stage_built_length, values[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); break; } - *status = fl_string_dynamic_terminate_after(values[i]); + *status = f_string_dynamic_terminate_after(values[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } } // for - fl_string_dynamic_delete(&settings_file_base); + f_string_dynamic_delete(&settings_file_base); } #endif // _di_fake_build_load_stage_ @@ -2377,24 +2377,24 @@ extern "C" { } if (destination_path.used) { - *status = fl_string_dynamic_prepend(data.path_build_objects, &destination_path); + *status = f_string_dynamic_prepend(data.path_build_objects, &destination_path); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_prepend", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_prepend", F_true); break; } - *status = fl_string_append_assure(f_path_separator_s, f_path_separator_length, &destination_path); + *status = f_string_append_assure(f_path_separator_s, f_path_separator_length, &destination_path); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append_assure", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append_assure", F_true); break; } - *status = fl_string_dynamic_terminate_after(&destination_path); + *status = f_string_dynamic_terminate_after(&destination_path); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } @@ -2496,14 +2496,14 @@ extern "C" { result = fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); if (F_status_is_error(*status) || *status == F_child) break; } // for - fl_string_dynamic_delete(&file_name); - fl_string_dynamic_delete(&destination_path); - fl_string_dynamics_delete(&arguments); + f_string_dynamic_delete(&file_name); + f_string_dynamic_delete(&destination_path); + f_string_dynamics_delete(&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); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return 0; } int result = fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&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); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return 0; } int result = fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&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 c0b6e59..2527a76 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) \ - fl_string_dynamic_delete(&setting.build_compiler); \ - fl_string_dynamic_delete(&setting.build_indexer); \ - fl_string_dynamic_delete(&setting.path_headers); \ - fl_string_dynamic_delete(&setting.path_language); \ - fl_string_dynamic_delete(&setting.path_library_script); \ - fl_string_dynamic_delete(&setting.path_library_shared); \ - fl_string_dynamic_delete(&setting.path_library_static); \ - fl_string_dynamic_delete(&setting.path_program_script); \ - fl_string_dynamic_delete(&setting.path_program_shared); \ - fl_string_dynamic_delete(&setting.path_program_static); \ - fl_string_dynamic_delete(&setting.path_sources); \ - fl_string_dynamic_delete(&setting.process_post); \ - fl_string_dynamic_delete(&setting.process_pre); \ - fl_string_dynamic_delete(&setting.project_name); \ - fl_string_dynamic_delete(&setting.version_major); \ - fl_string_dynamic_delete(&setting.version_micro); \ - fl_string_dynamic_delete(&setting.version_minor); \ - fl_string_dynamics_delete(&setting.build_libraries); \ - fl_string_dynamics_delete(&setting.build_sources_headers); \ - fl_string_dynamics_delete(&setting.build_sources_library); \ - fl_string_dynamics_delete(&setting.build_sources_program); \ - fl_string_dynamics_delete(&setting.build_sources_setting); \ - fl_string_dynamics_delete(&setting.build_sources_script); \ - fl_string_dynamics_delete(&setting.defines_all); \ - fl_string_dynamics_delete(&setting.defines_shared); \ - fl_string_dynamics_delete(&setting.defines_static); \ - fl_string_dynamics_delete(&setting.environment); \ - fl_string_dynamics_delete(&setting.flags_all); \ - fl_string_dynamics_delete(&setting.flags_library); \ - fl_string_dynamics_delete(&setting.flags_program); \ - fl_string_dynamics_delete(&setting.flags_shared); \ - fl_string_dynamics_delete(&setting.flags_static); \ - fl_string_dynamics_delete(&setting.modes); \ - fl_string_dynamics_delete(&setting.modes_default); + 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); #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) \ - fl_string_dynamic_delete(&stage.file_libraries_script); \ - fl_string_dynamic_delete(&stage.file_libraries_shared); \ - fl_string_dynamic_delete(&stage.file_libraries_static); \ - fl_string_dynamic_delete(&stage.file_objects_static); \ - fl_string_dynamic_delete(&stage.file_process_post); \ - fl_string_dynamic_delete(&stage.file_process_pre); \ - fl_string_dynamic_delete(&stage.file_programs_script); \ - fl_string_dynamic_delete(&stage.file_programs_shared); \ - fl_string_dynamic_delete(&stage.file_programs_static); \ - fl_string_dynamic_delete(&stage.file_skeleton); \ - fl_string_dynamic_delete(&stage.file_sources_headers); \ - fl_string_dynamic_delete(&stage.file_sources_script); \ - fl_string_dynamic_delete(&stage.file_sources_settings); + 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); #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) \ - fl_string_maps_delete(&build.environment); + f_string_maps_delete(&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 df60317..fee3a88 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -110,7 +110,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, "allocate buffer size for", fll_error_file_type_file); - fl_string_dynamic_delete(&(*buffer)); + f_string_dynamic_delete(&(*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); - fl_string_dynamic_delete(&(*buffer)); + f_string_dynamic_delete(&(*buffer)); } return status; @@ -262,10 +262,10 @@ extern "C" { }; for (i = 0; i < 15; i++) { - status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); + status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append_nulless", F_true); return status; } } // for @@ -379,10 +379,10 @@ extern "C" { }; for (i = 0; i < 11; i++) { - status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); + status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append_nulless", F_true); return status; } } // for @@ -397,10 +397,10 @@ extern "C" { }; for (i = 0; i < 3; i++) { - status = fl_string_dynamic_append_nulless(data->path_work, parameters_value[i]); + status = f_string_dynamic_append_nulless(data->path_work, parameters_value[i]); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); return status; } } // for @@ -426,10 +426,10 @@ extern "C" { }; for (i = 0; i < 3; i++) { - status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); + status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append_nulless", F_true); return status; } } // for @@ -502,10 +502,10 @@ extern "C" { }; for (i = 0; i < 6; i++) { - status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); + status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append_nulless", F_true); return status; } } // for @@ -553,10 +553,10 @@ extern "C" { for (i = 0; i < 34; i++) { if (!parameters_value[i]->used) continue; - status = fl_string_dynamic_terminate_after(parameters_value[i]); + status = f_string_dynamic_terminate_after(parameters_value[i]); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true); return status; } } // for @@ -571,7 +571,7 @@ extern "C" { f_status_t status = F_none; for (uint8_t i = 0; i < length; i++) { - status = fl_string_dynamic_append_nulless(source, destination[i]); + status = f_string_dynamic_append_nulless(source, destination[i]); if (F_status_is_error(status)) return status; } // for @@ -673,7 +673,7 @@ extern "C" { } // for } - status = fl_string_append(arguments.argv[location], length, parameters_value[i]); + status = f_string_append(arguments.argv[location], length, parameters_value[i]); if (F_status_is_error(status)) { if (status == F_status_set_error(F_string_too_large)) { @@ -685,7 +685,7 @@ extern "C" { } } else { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append", F_true); } return status; diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 84c2c4f..727edfd 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -358,13 +358,13 @@ extern "C" { if (F_status_is_error_not(*status)) { data_make->setting_make.parameter.used = 1; - function_name = "fl_string_append"; - *status = fl_string_append(fake_make_setting_return, fake_make_setting_return_length, &data_make->setting_make.parameter.array[0].name); + function_name = "f_string_append"; + *status = f_string_append(fake_make_setting_return, fake_make_setting_return_length, &data_make->setting_make.parameter.array[0].name); } if (F_status_is_error_not(*status)) { - function_name = "fl_string_dynamic_terminate_after"; - *status = fl_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].name); + function_name = "f_string_dynamic_terminate_after"; + *status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].name); } if (F_status_is_error_not(*status)) { @@ -373,8 +373,8 @@ extern "C" { } if (F_status_is_error_not(*status)) { - function_name = "fl_string_dynamic_terminate_after"; - *status = fl_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]); + function_name = "f_string_dynamic_terminate_after"; + *status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]); } if (F_status_is_error(*status)) { @@ -423,17 +423,17 @@ extern "C" { for (; j < settings.contents.array[i].used; j++) { - *status = fl_string_dynamic_partial_append_nulless(data_make->buffer, settings.contents.array[i].array[j], &name_define); + *status = f_string_dynamic_partial_append_nulless(data_make->buffer, settings.contents.array[i].array[j], &name_define); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_partial_append_nulless", F_true); break; } - *status = fl_string_dynamic_terminate_after(&name_define); + *status = f_string_dynamic_terminate_after(&name_define); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } @@ -446,10 +446,10 @@ extern "C" { if (k == data_make->setting_build.environment.used) { if (data_make->setting_build.environment.used + 1 > data_make->setting_build.environment.size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->setting_build.environment); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->setting_build.environment); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); break; } } @@ -457,10 +457,10 @@ extern "C" { // Include the terminating NULL when copying. name_define.used++; - *status = fl_string_dynamic_append(name_define, &data_make->setting_build.environment.array[data_make->setting_build.environment.used]); + *status = f_string_dynamic_append(name_define, &data_make->setting_build.environment.array[data_make->setting_build.environment.used]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append", F_true); break; } @@ -486,12 +486,12 @@ extern "C" { } // for if (F_status_is_error(*status)) { - fl_string_dynamic_delete(&name_define); + f_string_dynamic_delete(&name_define); break; } *status = F_none; - fl_string_dynamic_delete(&name_define); + f_string_dynamic_delete(&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) { @@ -578,17 +578,17 @@ extern "C" { for (f_array_length_t j = 1; j < settings.contents.array[i].used; j++) { - function_name = "fl_string_dynamic_partial_append_nulless"; - *status = fl_string_dynamic_partial_append_nulless(data_make->buffer, settings.contents.array[i].array[j], &data_make->setting_make.parameter.array[0].value.array[0]); + function_name = "f_string_dynamic_partial_append_nulless"; + *status = f_string_dynamic_partial_append_nulless(data_make->buffer, settings.contents.array[i].array[j], &data_make->setting_make.parameter.array[0].value.array[0]); if (F_status_is_error_not(*status)) { - function_name = "fl_string_dynamic_terminate_after"; - *status = fl_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]); + function_name = "f_string_dynamic_terminate_after"; + *status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]); } if (F_status_is_error_not(*status) && j + 1 < settings.contents.array[i].used) { - function_name = "fl_string_append_assure"; - *status = fl_string_append_assure(f_string_space_s, 1, &data_make->setting_make.parameter.array[0].value.array[0]); + function_name = "f_string_append_assure"; + *status = f_string_append_assure(f_string_space_s, 1, &data_make->setting_make.parameter.array[0].value.array[0]); } if (F_status_is_error(*status)) { @@ -638,16 +638,16 @@ extern "C" { // if either compiler or linker is specified, each will replace any existing build_compiler or build_indexer, respectively. if (range_compiler) { data_make->setting_build.build_compiler.used = 0; - *status = fl_string_dynamic_partial_append(data_make->buffer, *range_compiler, &data_make->setting_build.build_compiler); + *status = f_string_dynamic_partial_append(data_make->buffer, *range_compiler, &data_make->setting_build.build_compiler); } if (F_status_is_error_not(*status) && range_linker) { data_make->setting_build.build_indexer.used = 0; - *status = fl_string_dynamic_partial_append(data_make->buffer, *range_linker, &data_make->setting_build.build_indexer); + *status = f_string_dynamic_partial_append(data_make->buffer, *range_linker, &data_make->setting_build.build_indexer); } if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_partial_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_partial_append", F_true); f_macro_fss_set_t_delete_simple(settings); return; @@ -702,19 +702,19 @@ extern "C" { for (f_array_length_t j = 0; j < define.array[i].value.used; j++) { - *status = fl_string_dynamic_mash(f_string_space_s, 1, define.array[i].value.array[j], &combined); + *status = f_string_dynamic_mash(f_string_space_s, 1, define.array[i].value.array[j], &combined); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_mash_nulless", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_mash_nulless", F_true); break; } } // for if (F_status_is_error(*status)) break; - *status = fl_string_dynamic_terminate_after(&combined); + *status = f_string_dynamic_terminate_after(&combined); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); break; } @@ -745,7 +745,7 @@ extern "C" { } } // for - fl_string_dynamic_delete(&combined); + f_string_dynamic_delete(&combined); } f_macro_string_map_multis_t_delete_simple(define); @@ -765,53 +765,53 @@ extern "C" { if (data.context.mode != f_color_mode_none) { if (data_make->parameter.color.used >= data_make->parameter.color.size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->parameter.color); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->parameter.color); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } if (data.context.mode == f_color_mode_no_color) { if (data.parameters[fake_parameter_no_color].type == f_console_type_normal) { - *status = fl_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } else if (data.parameters[fake_parameter_no_color].type == f_console_type_inverse) { - *status = fl_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } if (F_status_is_error_not(*status)) { - *status = fl_string_append(f_console_standard_short_no_color_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_standard_short_no_color_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } } else if (data.context.mode == f_color_mode_dark) { if (data.parameters[fake_parameter_dark].type == f_console_type_normal) { - *status = fl_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } else if (data.parameters[fake_parameter_dark].type == f_console_type_inverse) { - *status = fl_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } if (F_status_is_error_not(*status)) { - *status = fl_string_append(f_console_standard_short_dark_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_standard_short_dark_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } } else if (data.context.mode == f_color_mode_light) { if (data.parameters[fake_parameter_light].type == f_console_type_normal) { - *status = fl_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } else if (data.parameters[fake_parameter_light].type == f_console_type_inverse) { - *status = fl_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } if (F_status_is_error_not(*status)) { - *status = fl_string_append(f_console_standard_short_light_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); + *status = f_string_append(f_console_standard_short_light_s, 1, &data_make->parameter.color.array[data_make->parameter.color.used]); } } if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); return; } else { @@ -821,53 +821,53 @@ extern "C" { if (data.error.verbosity != f_console_verbosity_normal) { if (data_make->parameter.verbosity.used >= data_make->parameter.verbosity.size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->parameter.verbosity); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->parameter.verbosity); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } if (data.error.verbosity == f_console_verbosity_quiet) { if (data.parameters[fake_parameter_verbosity_quiet].type == f_console_type_normal) { - *status = fl_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } else if (data.parameters[fake_parameter_verbosity_quiet].type == f_console_type_inverse) { - *status = fl_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } if (F_status_is_error_not(*status)) { - *status = fl_string_append(f_console_standard_short_quiet_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_standard_short_quiet_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } } else if (data.error.verbosity == f_console_verbosity_verbose) { if (data.parameters[fake_parameter_verbosity_verbose].type == f_console_type_normal) { - *status = fl_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } else if (data.parameters[fake_parameter_verbosity_verbose].type == f_console_type_inverse) { - *status = fl_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } if (F_status_is_error_not(*status)) { - *status = fl_string_append(f_console_standard_short_verbose_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_standard_short_verbose_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } } else if (data.error.verbosity == f_console_verbosity_debug) { if (data.parameters[fake_parameter_verbosity_debug].type == f_console_type_normal) { - *status = fl_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_symbol_short_enable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } else if (data.parameters[fake_parameter_verbosity_debug].type == f_console_type_inverse) { - *status = fl_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_symbol_short_disable_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } if (F_status_is_error_not(*status)) { - *status = fl_string_append(f_console_standard_short_debug_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + *status = f_string_append(f_console_standard_short_debug_s, 1, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } } if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); return; } else { @@ -904,27 +904,27 @@ extern "C" { for (j = 0; j < source[i]->used; j++) { if (destination[i]->used >= destination[i]->size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, destination[i]); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, destination[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } if (console[i]->type == f_console_type_normal) { - *status = fl_string_append(f_console_symbol_short_enable_s, 1, &destination[i]->array[destination[i]->used]); + *status = f_string_append(f_console_symbol_short_enable_s, 1, &destination[i]->array[destination[i]->used]); } else if (console[i]->type == f_console_type_inverse) { - *status = fl_string_append(f_console_symbol_short_disable_s, 1, &destination[i]->array[destination[i]->used]); + *status = f_string_append(f_console_symbol_short_disable_s, 1, &destination[i]->array[destination[i]->used]); } if (F_status_is_error_not(*status)) { - *status = fl_string_append(parameter[i], 1, &destination[i]->array[destination[i]->used]); + *status = f_string_append(parameter[i], 1, &destination[i]->array[destination[i]->used]); } if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); return; } else { @@ -932,18 +932,18 @@ extern "C" { } if (destination[i]->used >= destination[i]->size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, destination[i]); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, destination[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } - *status = fl_string_dynamic_append(source[i]->array[j], &destination[i]->array[destination[i]->used]); + *status = f_string_dynamic_append(source[i]->array[j], &destination[i]->array[destination[i]->used]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append", F_true); return; } else { @@ -997,27 +997,27 @@ extern "C" { for (uint8_t i = 0; i < 7; i ++) { if (destination[i]->used >= destination[i]->size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, destination[i]); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, destination[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } if (console[i]->type == f_console_type_normal) { - *status = fl_string_append(f_console_symbol_short_enable_s, 1, &destination[i]->array[destination[i]->used]); + *status = f_string_append(f_console_symbol_short_enable_s, 1, &destination[i]->array[destination[i]->used]); } else if (console[i]->type == f_console_type_inverse) { - *status = fl_string_append(f_console_symbol_short_disable_s, 1, &destination[i]->array[destination[i]->used]); + *status = f_string_append(f_console_symbol_short_disable_s, 1, &destination[i]->array[destination[i]->used]); } if (F_status_is_error_not(*status)) { - *status = fl_string_append(parameter[i], 1, &destination[i]->array[destination[i]->used]); + *status = f_string_append(parameter[i], 1, &destination[i]->array[destination[i]->used]); } if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_append", F_true); return; } else { @@ -1025,18 +1025,18 @@ extern "C" { } if (destination[i]->used >= destination[i]->size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, destination[i]); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, destination[i]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } - *status = fl_string_dynamic_append(*source[i], &destination[i]->array[destination[i]->used]); + *status = f_string_dynamic_append(*source[i], &destination[i]->array[destination[i]->used]); if (F_status_is_error(*status)) { - fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true); + fll_error_print(data.error, F_status_set_fine(*status), "f_string_dynamic_append", F_true); return; } else { @@ -1179,10 +1179,10 @@ extern "C" { // pre-allocate the known arguments size. if (arguments->used + content.used > arguments->size) { - *status = fl_string_dynamics_increase_by(content.used, arguments); + *status = f_string_dynamics_increase_by(content.used, arguments); if (F_status_is_error(*status) || *status == F_string_too_large) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } @@ -1273,10 +1273,10 @@ extern "C" { } if (arguments->used >= arguments->size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } @@ -1286,10 +1286,10 @@ extern "C" { range.start = content.array[i].start; range.stop = iki_variable.array[0].start - 1; - *status = fl_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]); + *status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_partial_append_nulless", F_true); break; } } @@ -1302,10 +1302,10 @@ extern "C" { range.start = previous + 1; range.stop = iki_variable.array[j].start - 1; - *status = fl_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]); + *status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_partial_append_nulless", F_true); break; } } @@ -1335,18 +1335,18 @@ extern "C" { if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_return, data_make->buffer, fake_make_parameter_variable_return_length, iki_content.array[j]) == F_equal_to) { if (data_make->setting_make.parameter.array[0].value.array[0].used) { - *status = fl_string_dynamic_append(data_make->setting_make.parameter.array[0].value.array[0], &arguments->array[arguments->used]); + *status = f_string_dynamic_append(data_make->setting_make.parameter.array[0].value.array[0], &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true); break; } } else { - *status = fl_string_append("0", 1, &arguments->array[arguments->used]); + *status = f_string_append("0", 1, &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_append", F_true); break; } } @@ -1359,10 +1359,10 @@ extern "C" { if (fl_string_dynamic_partial_compare_string(reserved_name[k], data_make->buffer, reserved_length[k], iki_content.array[j]) == F_equal_to) { if (arguments->used >= arguments->size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); return; } } @@ -1370,18 +1370,18 @@ extern "C" { for (l = 0; l < reserved_value[k]->used; l++) { if (l > 0) { - *status = fl_string_append(f_string_space_s, 1, &arguments->array[arguments->used]); + *status = f_string_append(f_string_space_s, 1, &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_append", F_true); break; } } - *status = fl_string_dynamic_append(reserved_value[k]->array[l], &arguments->array[arguments->used]); + *status = f_string_dynamic_append(reserved_value[k]->array[l], &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true); break; } } // for @@ -1411,42 +1411,42 @@ extern "C" { for (l = 0; l < parameter->array[k].value.used; l++) { if (l > 0) { - *status = fl_string_append(f_string_space_s, 1, &arguments->array[arguments->used]); + *status = f_string_append(f_string_space_s, 1, &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_append", F_true); break; } } - *status = fl_string_dynamic_append_nulless(parameter->array[k].value.array[l], &arguments->array[arguments->used]); + *status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); break; } } // for } else { if (arguments->used >= arguments->size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true); break; } } for (l = 0; l < parameter->array[k].value.used; l++) { - *status = fl_string_dynamic_append_nulless(parameter->array[k].value.array[l], &arguments->array[arguments->used]); + *status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); break; } - *status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used]); + *status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]); if (F_status_is_error(*status)) { fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_terminate_after", F_true); @@ -1498,13 +1498,13 @@ extern "C" { // if arguments.used was not incremented, then use the value, otherwise arguments.used is past the value to append to, so subtract 1. if (used_arguments == arguments->used) { - *status = fl_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]); + *status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]); } else { - *status = fl_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used - 1]); + *status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used - 1]); if (F_status_is_error_not(*status)) { - *status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used - 1]); + *status = f_string_dynamic_terminate_after(&arguments->array[arguments->used - 1]); if (F_status_is_error(*status)) { fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_terminate_after", F_true); @@ -1514,23 +1514,23 @@ extern "C" { } if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_partial_append_nulless", F_true); break; } } } else { - *status = fl_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &arguments->array[arguments->used]); + *status = f_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &arguments->array[arguments->used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_append_nulless", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_append_nulless", F_true); break; } } // if iki variable did not match (results in empty string) or iki variable is inside quotes, then increment. if (used_arguments == arguments->used) { - *status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used]); + *status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]); if (F_status_is_error(*status)) { fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_terminate_after", F_true); @@ -1626,10 +1626,10 @@ extern "C" { unmatched = F_false; if (bool_value[i]) { - status = fl_string_append(fake_common_setting_bool_yes, fake_common_setting_bool_yes_length, &value); + status = f_string_append(fake_common_setting_bool_yes, fake_common_setting_bool_yes_length, &value); } else { - status = fl_string_append(fake_common_setting_bool_no, fake_common_setting_bool_no_length, &value); + status = f_string_append(fake_common_setting_bool_no, fake_common_setting_bool_no_length, &value); } break; @@ -1705,7 +1705,7 @@ extern "C" { if (status == F_equal_to) { unmatched = F_false; - status = fl_string_dynamic_append(dynamic_value[i], &value); + status = f_string_dynamic_append(dynamic_value[i], &value); break; } } // for @@ -1781,7 +1781,7 @@ extern "C" { for (f_array_length_t j = 0; j < dynamics_value[i].used; j++) { - status = fl_string_dynamic_mash(f_string_space_s, 1, dynamics_value[i].array[j], &value); + status = f_string_dynamic_mash(f_string_space_s, 1, dynamics_value[i].array[j], &value); if (F_status_is_error(status)) { break; @@ -1794,26 +1794,26 @@ extern "C" { } if (F_status_is_error(status)) { - fl_string_dynamic_delete(&value); + f_string_dynamic_delete(&value); return status; } if (unmatched) { - fl_string_dynamic_delete(&value); + f_string_dynamic_delete(&value); return F_false; } if (quoted) { - status = fl_string_dynamic_append_nulless(value, &arguments->array[arguments->used]); + status = f_string_dynamic_append_nulless(value, &arguments->array[arguments->used]); } else { - status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); + status = f_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); if (F_status_is_error_not(status)) { - status = fl_string_dynamic_append_nulless(value, &arguments->array[arguments->used]); + status = f_string_dynamic_append_nulless(value, &arguments->array[arguments->used]); if (F_status_is_error_not(status)) { - status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used]); + status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]); if (F_status_is_error_not(status)) { arguments->used++; @@ -1822,7 +1822,7 @@ extern "C" { } } - fl_string_dynamic_delete(&value); + f_string_dynamic_delete(&value); if (F_status_is_error_not(status)) { return F_true; @@ -1842,34 +1842,34 @@ extern "C" { { f_string_dynamic_t name = f_string_dynamic_t_initialize; - status = fl_string_dynamic_partial_append_nulless(data_make->buffer, range_name, &name); + status = f_string_dynamic_partial_append_nulless(data_make->buffer, range_name, &name); if (F_status_is_error(status)) return status; status = f_environment_get(name.string, &value); - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); } if (F_status_is_error(status)) { - fl_string_dynamic_delete(&value); + f_string_dynamic_delete(&value); return status; } else if (status == F_exist_not) { - fl_string_dynamic_delete(&value); + f_string_dynamic_delete(&value); return F_false; } if (quoted) { - status = fl_string_dynamic_append_nulless(value, &arguments->array[arguments->used]); + status = f_string_dynamic_append_nulless(value, &arguments->array[arguments->used]); } else { - status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); + status = f_string_dynamics_increase_by(f_memory_default_allocation_step, arguments); if (F_status_is_error_not(status)) { - status = fl_string_dynamic_append_nulless(value, &arguments->array[arguments->used]); + status = f_string_dynamic_append_nulless(value, &arguments->array[arguments->used]); if (F_status_is_error_not(status)) { - status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used]); + status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]); if (F_status_is_error_not(status)) { arguments->used++; @@ -1878,7 +1878,7 @@ extern "C" { } } - fl_string_dynamic_delete(&value); + f_string_dynamic_delete(&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++) { - fl_string_dynamics_delete(&arguments[i]); + f_string_dynamics_delete(&arguments[i]); } // for return 0; @@ -2268,7 +2268,7 @@ extern "C" { } for (i = 0; i < section->objects.used; i++) { - fl_string_dynamics_delete(&arguments[i]); + f_string_dynamics_delete(&arguments[i]); } // for section_stack->used--; @@ -3563,7 +3563,7 @@ extern "C" { } if (operation == fake_make_operation_type_pop) { - fl_string_dynamic_delete(&data_make->path.stack.array[data_make->path.stack.used - 1]); + f_string_dynamic_delete(&data_make->path.stack.array[data_make->path.stack.used - 1]); data_make->path.stack.used--; @@ -3653,10 +3653,10 @@ extern "C" { } else { if (data_make->path.stack.used == data_make->path.stack.size) { - *status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->path.stack); + *status = f_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->path.stack); if (F_status_set_fine(*status) == F_array_too_large) { - fake_print_message_section_operation_path_stack_max(*data, data_make->error, F_array_too_large, "fl_string_dynamics_increase_by", "path stack"); + fake_print_message_section_operation_path_stack_max(*data, data_make->error, F_array_too_large, "f_string_dynamics_increase_by", "path stack"); return 0; } else if (F_status_is_error(*status)) { @@ -3668,10 +3668,10 @@ extern "C" { // copy the entire real path, including the trailing NULL. data_make->path_cache.used++; - fl_string_dynamic_append(data_make->path_cache, &data_make->path.stack.array[data_make->path.stack.used]); + f_string_dynamic_append(data_make->path_cache, &data_make->path.stack.array[data_make->path.stack.used]); if (F_status_is_error(*status)) { - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true); return 0; } @@ -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++) { - fl_string_dynamic_delete(&data_make->path.stack.array[i]); + f_string_dynamic_delete(&data_make->path.stack.array[i]); } // for data_make->path.stack.used = 1; @@ -3852,10 +3852,10 @@ extern "C" { if (!return_code) { if (F_status_is_error(*status)) { - status2 = fl_string_append("1", 1, &data_make->setting_make.parameter.array[0].value.array[0]); + status2 = f_string_append("1", 1, &data_make->setting_make.parameter.array[0].value.array[0]); } else { - status2 = fl_string_append("0", 1, &data_make->setting_make.parameter.array[0].value.array[0]); + status2 = f_string_append("0", 1, &data_make->setting_make.parameter.array[0].value.array[0]); } return; @@ -3871,32 +3871,32 @@ extern "C" { fll_error_print(data_make->error, F_status_set_fine(*status), "f_conversion_number_signed_to_string", F_true); - fl_string_dynamic_delete(&number); + f_string_dynamic_delete(&number); return; } - status2 = fl_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); + status2 = f_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); - fl_string_dynamic_delete(&number); + f_string_dynamic_delete(&number); } else { - status2 = fl_string_append("0", 1, &data_make->setting_make.parameter.array[0].value.array[0]); + status2 = f_string_append("0", 1, &data_make->setting_make.parameter.array[0].value.array[0]); } } if (F_status_is_error(status2)) { *status = status2; - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_append", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_append", F_true); return; } - status2 = fl_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]); + status2 = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]); if (F_status_is_error(status2)) { *status = status2; - fll_error_print(data_make->error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true); return; } @@ -3933,21 +3933,21 @@ extern "C" { for (f_array_length_t i = 0; i < args.size; i++) { - status = fl_string_dynamic_append(arguments.array[i + 1], &args.array[i]); + status = f_string_dynamic_append(arguments.array[i + 1], &args.array[i]); if (F_status_is_error(status)) { - fll_error_print(data_make->error, F_status_set_fine(status), "fl_string_dynamic_append", F_true); + fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_append", F_true); - fl_string_dynamics_delete(&args); + f_string_dynamics_delete(&args); return status; } - status = fl_string_dynamic_terminate(&args.array[i]); + status = f_string_dynamic_terminate(&args.array[i]); if (F_status_is_error(status)) { - fll_error_print(data_make->error, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true); + fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_terminate", F_true); - fl_string_dynamics_delete(&args); + f_string_dynamics_delete(&args); return status; } @@ -3957,7 +3957,7 @@ extern "C" { status = fake_make_operate_process_execute(data, *program, args, as_shell, data_make); - fl_string_dynamics_delete(&args); + f_string_dynamics_delete(&args); return status; } #endif // _di_fake_make_operate_process_run_ @@ -5206,10 +5206,10 @@ extern "C" { range.start = data_make->path.stack.array[0].used + 1; range.stop = range.start + (path.used - range.start) - 1; - f_status_t status = fl_string_dynamic_partial_append(path, range, &data_make->path_cache); + f_status_t status = f_string_dynamic_partial_append(path, range, &data_make->path_cache); if (F_status_is_error(status)) return status; - status = fl_string_dynamic_terminate(&data_make->path_cache); + status = f_string_dynamic_terminate(&data_make->path_cache); if (F_status_is_error(status)) return status; return status; diff --git a/level_3/fake/c/private-make.h b/level_3/fake/c/private-make.h index 371b0e6..1b2639e 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) \ - fl_string_dynamics_delete(¶meter.build); \ - fl_string_dynamics_delete(¶meter.color); \ - fl_string_dynamics_delete(¶meter.data); \ - fl_string_dynamics_delete(¶meter.define); \ - fl_string_dynamics_delete(¶meter.fakefile); \ - fl_string_dynamics_delete(¶meter.mode); \ - fl_string_dynamics_delete(¶meter.process); \ - fl_string_dynamics_delete(¶meter.settings); \ - fl_string_dynamics_delete(¶meter.sources); \ - fl_string_dynamics_delete(¶meter.verbosity); \ - fl_string_dynamics_delete(¶meter.work); + 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); #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) \ - fl_string_dynamics_delete(&path.stack); + f_string_dynamics_delete(&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) \ - fl_string_maps_delete(&data.environment); \ + f_string_maps_delete(&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) \ - fl_string_dynamic_delete(&data.buffer); \ - fl_string_dynamic_delete(&data.path_cache); + f_string_dynamic_delete(&data.buffer); \ + f_string_dynamic_delete(&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 2a89277..041a969 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)) { - fl_string_dynamic_delete(&file_data_build_process_post); - fl_string_dynamic_delete(&file_data_build_process_pre); + f_string_dynamic_delete(&file_data_build_process_post); + f_string_dynamic_delete(&file_data_build_process_pre); return status; } diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 2f1a54b..9a1155a 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; - fl_string_dynamics_delete(& parameters); + f_string_dynamics_delete(& 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); - fl_string_dynamic_delete(&file_path); + f_string_dynamic_delete(&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 - fl_string_dynamics_delete(&data->chains); + f_string_dynamics_delete(&data->chains); f_macro_string_lengths_t_delete_simple(data->remaining); - fl_string_dynamics_delete(&data->devices); + f_string_dynamics_delete(&data->devices); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 927620f..c856faa 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -44,7 +44,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi f_macro_string_dynamic_t_new(status, device, data.devices.array[local.device].used); if (F_status_is_error(status)) { - fl_string_dynamic_delete(&device); + f_string_dynamic_delete(&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; - fl_string_dynamic_delete(&ip_list); + f_string_dynamic_delete(&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) { - fl_string_dynamic_delete(&device); + f_string_dynamic_delete(&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 { - fl_string_dynamic_delete(&device); + f_string_dynamic_delete(&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 { - fl_string_dynamic_delete(&device); + f_string_dynamic_delete(&device); } device_all = F_false; @@ -230,7 +230,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi use_protocol = F_false; } else if (length > 0) { - fl_string_dynamic_delete(&protocol); + f_string_dynamic_delete(&protocol); f_macro_string_dynamic_t_new(status, protocol, length); if (F_status_is_error(status)) break; @@ -319,7 +319,7 @@ 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 - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); f_macro_string_dynamics_new(status, arguments, firewall_default_allocation_step); if (F_status_is_error(status)) break; @@ -335,7 +335,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } } - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); if (F_status_is_error(status)) break; @@ -369,7 +369,7 @@ 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)) { - fl_string_dynamic_delete(&argument); + f_string_dynamic_delete(&argument); break; } @@ -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]); - fl_string_dynamic_delete(&ip_list_action); + f_string_dynamic_delete(&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)) { - fl_string_dynamic_delete(&ip_argument); + f_string_dynamic_delete(&ip_argument); break; } @@ -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. - fl_string_dynamic_delete(&arguments.array[arguments.used]); + f_string_dynamic_delete(&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. - fl_string_dynamic_delete(&arguments.array[arguments.used]); + f_string_dynamic_delete(&arguments.array[arguments.used]); arguments.used--; break; } // remove ip_argument from arguments string. - fl_string_dynamic_delete(&arguments.array[arguments.used]); + f_string_dynamic_delete(&arguments.array[arguments.used]); arguments.used--; } // for - fl_string_dynamic_delete(&ip_argument); + f_string_dynamic_delete(&ip_argument); // remove ip_list_action from arguments string. - fl_string_dynamic_delete(&arguments.array[arguments.used]); + f_string_dynamic_delete(&arguments.array[arguments.used]); arguments.used--; } } @@ -806,8 +806,8 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } } - fl_string_dynamic_delete(&local_buffer); - fl_string_dynamic_delete(&file_path); + f_string_dynamic_delete(&local_buffer); + f_string_dynamic_delete(&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 - fl_string_dynamic_delete(&ip_list); - fl_string_dynamic_delete(&argument); - fl_string_dynamics_delete(&arguments); - fl_string_dynamic_delete(&device); - fl_string_dynamic_delete(&protocol); + 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); return status; } @@ -899,7 +899,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f f_macro_string_dynamic_t_new(status, arguments.array[0], firewall_chain_create_command_length); if (F_status_is_error(status)) { - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return status; } @@ -912,7 +912,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f if (F_status_is_error(status)) { arguments.used = 1; - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return status; } @@ -992,7 +992,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)) { - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return status; } @@ -1006,7 +1006,7 @@ 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)) { - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return status; } @@ -1015,7 +1015,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f f_macro_string_dynamic_t_new(status, data->chains.array[data->chains.used], length); if (F_status_is_error(status)) { - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return status; } @@ -1134,7 +1134,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]); } - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return status; } } @@ -1145,7 +1145,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f i++; } // while - fl_string_dynamics_delete(&arguments); + f_string_dynamics_delete(&arguments); return status; } @@ -1520,7 +1520,7 @@ f_status_t firewall_delete_local_data(firewall_local_data_t *local) { local->device = 0; local->chain = 0; - fl_string_dynamic_delete(&local->buffer); + f_string_dynamic_delete(&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 70b54db..1193a8a 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -66,7 +66,7 @@ typedef struct { } #define firewall_macro_delete_fss_buffers(status, buffer, objects, contents) \ - fl_string_dynamic_delete(&buffer); \ + f_string_dynamic_delete(&buffer); \ f_macro_fss_objects_t_delete(status, objects); \ f_macro_fss_contents_t_delete(status, contents); 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 370c3d8..ad0a0ac 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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 5f1b946..6ffaa73 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 @@ -95,7 +95,7 @@ extern "C" { status = fl_string_rip(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } else { - status = fl_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); + status = f_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } if (F_status_is_error(status)) { @@ -111,7 +111,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol_s[0]); } else { - f_string_t function = "fl_string_append"; + f_string_t function = "f_string_append"; if (data.parameters[fss_basic_list_read_parameter_trim].result == f_console_result_found) { function = "fl_string_rip"; @@ -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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 f53a780..64a8ea7 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,8 @@ 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 = fl_string_dynamic_delete(&structure.value_name); - #define fss_basic_list_read_macro_depth_t_delete_simple(structure) fl_string_dynamic_delete(&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); #endif // _di_fss_basic_list_read_depth_t_ /** 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 65c5d9b..31e3772 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" { } } - fl_string_dynamic_delete(&escaped); + f_string_dynamic_delete(&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" { } } - fl_string_dynamic_delete(&buffer); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&buffer); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&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 808c5b0..b546d05 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 @@ -105,10 +105,10 @@ extern "C" { } if (!object || !content) { - status = fl_string_append(f_string_eol, 1, buffer); + status = f_string_append(f_string_eol, 1, buffer); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } } @@ -172,10 +172,10 @@ extern "C" { } if (object.used + block.used > object.size) { - status = fl_string_dynamic_increase_by(block.used, &object); + status = f_string_dynamic_increase_by(block.used, &object); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -221,10 +221,10 @@ extern "C" { if (total) { if (content.used + total > content.size) { - status = fl_string_dynamic_increase_by(total, &content); + status = f_string_dynamic_increase_by(total, &content); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -275,9 +275,9 @@ extern "C" { status = fss_basic_list_write_process(data, output, quote, &object, &content, buffer); } - fl_string_dynamic_delete(&block); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&block); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&content); return status; } #endif // _di_fss_basic_list_write_process_pipe_ 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 e7eadf2..50962be 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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 07cc411..7873dce 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 @@ -95,7 +95,7 @@ extern "C" { status = fl_string_rip(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } else { - status = fl_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); + status = f_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } if (F_status_is_error(status)) { @@ -111,7 +111,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol_s[0]); } else { - f_string_t function = "fl_string_append"; + f_string_t function = "f_string_append"; if (data.parameters[fss_basic_read_parameter_trim].result == f_console_result_found) { function = "fl_string_rip"; @@ -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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 96f305f..8ab2be3 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 = fl_string_dynamic_delete(&structure.value_name); - #define fss_basic_read_macro_depth_t_delete_simple(structure) fl_string_dynamic_delete(&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); #endif // _di_fss_basic_read_depth_t_ /** 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 42865e2..fa8a824 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" { } } - fl_string_dynamic_delete(&escaped); + f_string_dynamic_delete(&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" { } } - fl_string_dynamic_delete(&buffer); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&buffer); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&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 7cf2f42..da64540 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 @@ -117,10 +117,10 @@ extern "C" { } if (!object || !content) { - status = fl_string_append(f_string_eol, 1, buffer); + status = f_string_append(f_string_eol, 1, buffer); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } } @@ -184,10 +184,10 @@ extern "C" { } if (object.used + block.used > object.size) { - status = fl_string_dynamic_increase_by(block.used, &object); + status = f_string_dynamic_increase_by(block.used, &object); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -233,10 +233,10 @@ extern "C" { if (total) { if (content.used + total > content.size) { - status = fl_string_dynamic_increase_by(total, &content); + status = f_string_dynamic_increase_by(total, &content); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -294,9 +294,9 @@ extern "C" { status = fss_basic_write_process(data, output, quote, &object, &content, buffer); } - fl_string_dynamic_delete(&block); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&block); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&content); return status; } #endif // _di_fss_basic_write_process_pipe_ 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 b669b45..a4234dc 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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&data->buffer); } // for if (F_status_is_error(status)) { f_macro_fss_nest_t_delete_simple(data->nest); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&data->buffer); } } @@ -530,7 +530,7 @@ extern "C" { f_macro_fss_nest_t_delete_simple(data->nest); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 d34a8d1..b7307c8 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 @@ -169,10 +169,10 @@ extern "C" { } } else { - status = fl_string_append(arguments.argv[values_order[i]], strnlen(arguments.argv[values_order[i]], f_console_length_size), &depths->array[depths->used].value_name); + status = f_string_append(arguments.argv[values_order[i]], strnlen(arguments.argv[values_order[i]], f_console_length_size), &depths->array[depths->used].value_name); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } } @@ -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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 c7f5898..61550a3 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,8 @@ 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 = fl_string_dynamic_delete(&structure.value_name) - #define fss_embedded_list_read_macro_depth_t_delete_simple(structure) fl_string_dynamic_delete(&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) #endif // _di_fss_embedded_list_read_depth_t_ /** 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 f9dd742..c46f9fe 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" { } } - fl_string_dynamic_delete(&escaped); + f_string_dynamic_delete(&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" { } } - fl_string_dynamic_delete(&buffer); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&buffer); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&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 720be72..8a5d113 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 @@ -105,10 +105,10 @@ extern "C" { } if (!object || !content) { - status = fl_string_append(f_string_eol, 1, buffer); + status = f_string_append(f_string_eol, 1, buffer); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } } @@ -177,10 +177,10 @@ extern "C" { } if (object.used + block.used > object.size) { - status = fl_string_dynamic_increase_by(block.used, &object); + status = f_string_dynamic_increase_by(block.used, &object); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -226,10 +226,10 @@ extern "C" { if (total) { if (content.used + total > content.size) { - status = fl_string_dynamic_increase_by(total, &content); + status = f_string_dynamic_increase_by(total, &content); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -314,9 +314,9 @@ extern "C" { status = fss_embedded_list_write_process(data, output, quote, &object, &content, ignore, buffer); } - fl_string_dynamic_delete(&block); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&block); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&content); return status; } #endif // _di_fss_embedded_list_write_process_pipe_ 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 056592e..dfa0044 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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 c919c70..150384f 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 @@ -95,7 +95,7 @@ extern "C" { status = fl_string_rip(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } else { - status = fl_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); + status = f_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } if (F_status_is_error(status)) { @@ -111,7 +111,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol_s[0]); } else { - f_string_t function = "fl_string_append"; + f_string_t function = "f_string_append"; if (data.parameters[fss_extended_list_read_parameter_trim].result == f_console_result_found) { function = "fl_string_rip"; @@ -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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 039513b..d852d17 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,8 @@ 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 = fl_string_dynamic_delete(&structure.value_name) - #define fss_extended_list_read_macro_depth_t_delete_simple(structure) fl_string_dynamic_delete(&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) #endif // _di_fss_extended_list_read_depth_t_ /** 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 8527d6e..9f212da 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" { } } - fl_string_dynamic_delete(&escaped); + f_string_dynamic_delete(&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" { } } - fl_string_dynamic_delete(&buffer); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&buffer); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&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 9f02571..106f3ed 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 @@ -105,10 +105,10 @@ extern "C" { } if (!object || !content) { - status = fl_string_append(f_string_eol, 1, buffer); + status = f_string_append(f_string_eol, 1, buffer); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } } @@ -177,10 +177,10 @@ extern "C" { } if (object.used + block.used > object.size) { - status = fl_string_dynamic_increase_by(block.used, &object); + status = f_string_dynamic_increase_by(block.used, &object); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -226,10 +226,10 @@ extern "C" { if (total) { if (content.used + total > content.size) { - status = fl_string_dynamic_increase_by(total, &content); + status = f_string_dynamic_increase_by(total, &content); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -314,9 +314,9 @@ extern "C" { status = fss_extended_list_write_process(data, output, quote, &object, &content, ignore, buffer); } - fl_string_dynamic_delete(&block); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&block); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&content); return status; } #endif // _di_fss_extended_list_write_process_pipe_ 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 c5f8d80..f8c0055 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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 5b3ad37..fc773e5 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 @@ -122,7 +122,7 @@ extern "C" { status = fl_string_rip(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } else { - status = fl_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); + status = f_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } if (F_status_is_error(status)) { @@ -138,7 +138,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol_s[0]); } else { - f_string_t function = "fl_string_append"; + f_string_t function = "f_string_append"; if (data.parameters[fss_extended_read_parameter_trim].result == f_console_result_found) { function = "fl_string_rip"; @@ -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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 eba29b4..36b5b17 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,8 @@ 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 = fl_string_dynamic_delete(&structure.value_name) - #define fss_extended_read_macro_depth_t_delete_simple(structure) fl_string_dynamic_delete(&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) #endif // _di_fss_extended_read_depth_t_ /** 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 e459a9a..45428ce 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -441,14 +441,14 @@ extern "C" { else { object.used = 0; - status = fl_string_dynamics_increase_by(data->parameters[fss_extended_write_parameter_content].values.used, &contents); + status = f_string_dynamics_increase_by(data->parameters[fss_extended_write_parameter_content].values.used, &contents); if (status == F_array_too_large) { status = F_status_set_error(status); } if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true); } else { f_array_length_t i = 0; @@ -504,10 +504,10 @@ extern "C" { if (content_current < object_current || content_current > object_next) break; } - status = fl_string_dynamics_increase_by(f_fss_default_allocation_step, &contents); + status = f_string_dynamics_increase_by(f_fss_default_allocation_step, &contents); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true); break; } @@ -515,10 +515,10 @@ extern "C" { contents.array[contents.used].used = 0; } - status = fl_string_append(arguments.argv[data->parameters[fss_extended_write_parameter_content].values.array[j]], strnlen(arguments.argv[data->parameters[fss_extended_write_parameter_content].values.array[j]], f_console_length_size), &contents.array[contents.used]); + status = f_string_append(arguments.argv[data->parameters[fss_extended_write_parameter_content].values.array[j]], strnlen(arguments.argv[data->parameters[fss_extended_write_parameter_content].values.array[j]], f_console_length_size), &contents.array[contents.used]); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append", F_true); break; } @@ -546,7 +546,7 @@ extern "C" { } } - fl_string_dynamic_delete(&escaped); + f_string_dynamic_delete(&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" { } } - fl_string_dynamic_delete(&buffer); - fl_string_dynamic_delete(&object); - fl_string_dynamics_delete(&contents); + f_string_dynamic_delete(&buffer); + f_string_dynamic_delete(&object); + f_string_dynamics_delete(&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 3b4fca8..bcf515a 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 @@ -121,10 +121,10 @@ extern "C" { } } else if (!object) { - status = fl_string_append(f_string_eol, 1, buffer); + status = f_string_append(f_string_eol, 1, buffer); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_append", F_true); return status; } } @@ -196,10 +196,10 @@ extern "C" { } if (object.used + block.used > object.size) { - status = fl_string_dynamic_increase_by(block.used, &object); + status = f_string_dynamic_increase_by(block.used, &object); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -237,10 +237,10 @@ extern "C" { if (state == 0x2) { if (contents.used + 1 > contents.size) { - status = fl_string_dynamics_increase_by(f_fss_default_allocation_step, &contents); + status = f_string_dynamics_increase_by(f_fss_default_allocation_step, &contents); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true); break; } } @@ -262,10 +262,10 @@ extern "C" { if (block.string[range.start] == fss_extended_write_pipe_content_start) { if (contents.used + 1 > contents.size) { - status = fl_string_dynamics_increase_by(f_fss_default_allocation_step, &contents); + status = f_string_dynamics_increase_by(f_fss_default_allocation_step, &contents); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamics_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true); break; } } @@ -293,10 +293,10 @@ extern "C" { } if (contents.array[contents.used - 1].used + 1 > contents.array[contents.used - 1].size) { - status = fl_string_dynamic_increase_by(f_fss_default_allocation_step, &contents.array[contents.used - 1]); + status = f_string_dynamic_increase_by(f_fss_default_allocation_step, &contents.array[contents.used - 1]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_increase_by", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); break; } } @@ -324,9 +324,9 @@ extern "C" { status = fss_extended_write_process(data, output, quote, &object, &contents, buffer); } - fl_string_dynamic_delete(&block); - fl_string_dynamic_delete(&object); - fl_string_dynamics_delete(&contents); + f_string_dynamic_delete(&block); + f_string_dynamic_delete(&object); + f_string_dynamics_delete(&contents); return status; } #endif // _di_fss_extended_write_process_pipe_ diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 7f8472c..278671c 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. - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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. - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&data->buffer); } // for } } @@ -482,7 +482,7 @@ extern "C" { } // for f_macro_string_lengths_t_delete_simple(data->remaining); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&data->buffer); f_macro_color_context_t_delete_simple(data->context); diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index 204c359..417f717 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -144,16 +144,16 @@ extern "C" { index = data->parameters[iki_read_parameter_name].values.array[i]; name.used = 0; - status = fl_string_append_nulless(arguments.argv[index], strlen(arguments.argv[index]), &name); + status = f_string_append_nulless(arguments.argv[index], strlen(arguments.argv[index]), &name); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append_nulless", F_true); for (f_array_length_t i = 0; i < variable->used; i++) { iki_read_macro_substitutions_t_delete_simple(substitutionss[i]); } // for - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } @@ -178,7 +178,7 @@ extern "C" { } // for } // for - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); if (unmatched) status = F_data_not; else status = F_none; @@ -286,10 +286,10 @@ extern "C" { break; } - status = fl_string_append_nulless(arguments.argv[index], length_argument, &names.array[names.used]); + status = f_string_append_nulless(arguments.argv[index], length_argument, &names.array[names.used]); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append_nulless", F_true); break; } @@ -302,7 +302,7 @@ extern "C" { iki_read_macro_substitutions_t_delete_simple(substitutionss[i]); } // for - fl_string_dynamics_delete(&names); + f_string_dynamics_delete(&names); return status; } } @@ -383,7 +383,7 @@ extern "C" { iki_read_macro_substitutions_t_delete_simple(substitutionss[i]); } // for - fl_string_dynamics_delete(&names); + f_string_dynamics_delete(&names); return F_none; } #endif // _di_iki_read_process_buffer_ranges_whole_ @@ -429,12 +429,12 @@ extern "C" { index = data->parameters[iki_read_parameter_name].values.array[i]; name.used = 0; - status = fl_string_append_nulless(arguments.argv[index], strlen(arguments.argv[index]), &name); + status = f_string_append_nulless(arguments.argv[index], strlen(arguments.argv[index]), &name); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_append_nulless", F_true); - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); return status; } @@ -447,7 +447,7 @@ extern "C" { } // for } // for - fl_string_dynamic_delete(&name); + f_string_dynamic_delete(&name); } else { total = variable->used; diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index 22bfc72..eb1946c 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -317,10 +317,10 @@ extern "C" { content.used = 0; if (buffer.used) { - status = fl_string_dynamic_partial_append_nulless(buffer, range, &content); + status = f_string_dynamic_partial_append_nulless(buffer, range, &content); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); break; } } @@ -335,10 +335,10 @@ extern "C" { else { object.used = 0; - status = fl_string_dynamic_partial_append_nulless(buffer, range, &object); + status = f_string_dynamic_partial_append_nulless(buffer, range, &object); if (F_status_is_error(status)) { - fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamic_partial_append_nulless", F_true); + fll_error_print(data->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); break; } @@ -366,9 +366,9 @@ extern "C" { status = F_status_set_error(F_parameter); } - fl_string_dynamic_delete(&buffer); - fl_string_dynamic_delete(&object); - fl_string_dynamic_delete(&content); + f_string_dynamic_delete(&buffer); + f_string_dynamic_delete(&object); + f_string_dynamic_delete(&content); } if (F_status_is_error_not(status)) { @@ -397,7 +397,7 @@ extern "C" { } } - fl_string_dynamic_delete(&escaped); + f_string_dynamic_delete(&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); - fl_string_dynamic_delete(&data->buffer); + f_string_dynamic_delete(&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 f603eac..b98eff0 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); - fl_string_dynamic_delete(&(*escaped)); + f_string_dynamic_delete(&(*escaped)); return F_status_set_error(F_failure); } diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index 59639df..8e08812 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); - fl_string_dynamic_delete(&data->setting_kernel.root); - fl_string_dynamic_delete(&data->setting_kernel.root_group); - fl_string_dynamic_delete(&data->setting_kernel.root_sub); - fl_string_dynamic_delete(&data->setting_kernel.run); - fl_string_dynamic_delete(&data->setting_kernel.settings); - fl_string_dynamic_delete(&data->setting_kernel.settings_name); + 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_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 25aa3c1..30460f0 100644 --- a/level_3/init/c/private-init.c +++ b/level_3/init/c/private-init.c @@ -228,10 +228,10 @@ Consider the "*.device" files such that they are also use IKI. parameter_value[j]->used = 0; if (content.array[j].start <= content.array[j].stop) { - status = fl_string_dynamic_partial_append(buffer, content.array[j], parameter_value[j]); + status = f_string_dynamic_partial_append(buffer, content.array[j], parameter_value[j]); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_string_dynamic_partial_append", F_true); + fll_error_print(data.error, F_status_set_fine(status), "f_string_dynamic_partial_append", F_true); i = variable.used; break; @@ -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); - fl_string_dynamic_delete(&cache); + f_string_dynamic_delete(&cache); } f_file_stream_close(F_true, &command_line); - fl_string_dynamic_delete(&buffer); + f_string_dynamic_delete(&buffer); return status; } -- 1.8.3.1